[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdegraphics/kdvi
From:       Stefan Kebekus <kebekus () kde ! org>
Date:       2006-02-01 8:49:27
Message-ID: 1138783767.207068.24827.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 504468 by kebekus:

fixes problems with PS header inclusion, fixes bug #105477


 M  +14 -3     dviRenderer_prescan.cpp  
 M  +1 -0      special.cpp  


--- branches/KDE/3.5/kdegraphics/kdvi/dviRenderer_prescan.cpp #504467:504468
@@ -284,8 +284,20 @@
   kdDebug(4300) << "PostScript-special, header " << cp.latin1() << endl;
 #endif
 
-  if (QFile::exists(cp)) 
-    PS_interface->PostScriptHeaderString->append( QString(" (%1) run\n").arg(cp) );
+  QString _file = cp;
+  
+  // If the file is not found in the current directory, use kpsewhich
+  // to find it.
+  if (!QFile::exists(_file)) {
+    // Otherwise, use kpsewhich to find the eps file.
+    KProcIO proc;
+    proc << "kpsewhich" << cp;
+    proc.start(KProcess::Block);
+    proc.readln(_file);
+  }
+  
+  if (QFile::exists(_file))
+    PS_interface->PostScriptHeaderString->append( QString(" (%1) run\n").arg(_file) );
 }
 
 
@@ -305,7 +317,6 @@
 {
 #ifdef DEBUG_PRESCAN
   kdError(4300) << "PostScript-special, literal PostScript " << cp.latin1() << endl;
-
 #endif
   
   double PS_H = (currinf.data.dvi_h*300.0)/(65536*1200)-300;
--- branches/KDE/3.5/kdegraphics/kdvi/special.cpp #504467:504468
@@ -697,6 +697,7 @@
       (strncasecmp(cp, "html:<A name=", 13) == 0) ||
       (strncasecmp(cp, "ps:", 3) == 0) ||
       (strncasecmp(cp, "papersize", 9) == 0) ||
+      (strncasecmp(cp, "header", 6) == 0) ||
       (strncasecmp(cp, "background", 10) == 0) )
     return;
   
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic