[Kst] extragear/graphics/kst/src/libkstapp

George Staikos staikos at kde.org
Mon Jan 22 08:16:07 CET 2007


SVN commit 626108 by staikos:

remove redundancies


 M  +15 -17    kstviewwindow.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kstviewwindow.cpp #626107:626108
@@ -286,24 +286,22 @@
         QTextStream streamEPS(&fileEPS);
                 
         line = streamPS.readLine();
-        if (!line.isNull()) {
-          if (line.left(11) == "%!PS-Adobe-") {
-            //
-            // we have a ps file, so do the conversion...
-            //
-            streamEPS << "%!PS-Adobe-2.0 EPSF-2.0\n";
-            
+        if (line.startsWith("%!PS-Adobe-")) {
+          //
+          // we have a ps file, so do the conversion...
+          //
+          streamEPS << "%!PS-Adobe-2.0 EPSF-2.0\n";
+
+          line = streamPS.readLine();
+          if (line.startsWith("%%BoundingBox:")) {
+            streamEPS << "%%BoundingBox: 0 0 " << right << " " << bottom << "\n";            
+          } else {
+            streamEPS << line << "\n";
+          }
+
+          while (!streamPS.atEnd()) {
             line = streamPS.readLine();
-            if (!line.isNull() && line.left(14) == "%%BoundingBox:") {
-              streamEPS << "%%BoundingBox: 0 0 " << right << " " << bottom << "\n";            
-            } else {
-              streamEPS << line << "\n";
-            }
-            
-            while (!streamPS.atEnd()) {
-              line = streamPS.readLine();
-              streamEPS << line << "\n";
-            }
+            streamEPS << line << "\n";
           }
         }
         fileEPS.close();


More information about the Kst mailing list