Bug 124652 - Crash when printing from the command line
Summary: Crash when printing from the command line
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Solaris
: NOR crash
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-31 17:08 UTC by Nicolas Brisset
Modified: 2006-04-03 10:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Testcase (21.02 KB, text/plain)
2006-03-31 17:11 UTC, Nicolas Brisset
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Brisset 2006-03-31 17:08:12 UTC
Version:           1.3.0_devel (using KDE 3.4.0, compiled sources)
Compiler:          gcc version 3.4.3
OS:                SunOS (sun4u) release 5.8

When printing from the command line, there sometimes are crashes. I have found a file that leads to such a crash, I will attach it to this report.
Comment 1 Nicolas Brisset 2006-03-31 17:11:40 UTC
Created attachment 15397 [details]
Testcase

When I do :
"kst ~/temp/debug.kst --print test.ps"
I get the following traces:

kdeprint: kdeprint: status message: Initialisation...
kdeprint: Resetting page size
kdeprint: ********************
kdeprint: kde-frompage = 0
kdeprint: kde-isspecial = 1
kdeprint: kde-orientation = Landscape
kdeprint: kde-outputfilename = test.ps
kdeprint: kde-outputtofile = 1
kdeprint: kde-pagesize = 2
kdeprint: kde-printcommand =
kdeprint: kde-range =
kdeprint: kde-special-command =
kdeprint: kde-topage = 0
kdeprint: kdeprint: status message: Création des données d'impression :
page 1
kst: Curve 1 said UPDATE
kst: Update plots
kst: Posting UpdateDataDialogs
kdeprint: kdeprint: status message: Création des données d'impression :
page 2
kdeprint: kdeprint: status message: Création des données d'impression :
page 3
QPainter::begin: Cannot paint null pixmap
QPainter::setPen: Will be reset by begin()
QPainter::setFont: Will be reset by begin()
QPainter::setWorldMatrix: Will be reset by begin()
QPainter::setPen: Will be reset by begin()
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kst path = <unknown> pid = 10635

It does not matter whether the datafile (gyrodata.dat, relative path) is found
or not.
Comment 2 George Staikos 2006-04-03 10:59:31 UTC
SVN commit 525906 by staikos:

can't "revert" when there is nothing to go back to
BUG: 124652


 M  +1 -1      kst/main.cpp  
 M  +4 -2      libkstapp/kst.cpp  
 M  +6 -6      libkstapp/kst.h  


--- trunk/extragear/graphics/kst/src/kst/main.cpp #525905:525906
@@ -786,7 +786,7 @@
 
     if (printfile != "<none>") {
       kst->forceUpdate();
-      kst->immediatePrintToFile(printfile);
+      kst->immediatePrintToFile(printfile, false);
     }
 
     if (pngfile != "<none>") {
--- trunk/extragear/graphics/kst/src/libkstapp/kst.cpp #525905:525906
@@ -1579,7 +1579,7 @@
 }
 
 
-void KstApp::immediatePrintToFile(const QString& filename) {
+void KstApp::immediatePrintToFile(const QString& filename, bool revert) {
   KMdiIterator<KMdiChildView*> *it = createIterator();
   if (!it) {
     return;
@@ -1613,7 +1613,9 @@
 
       view->view()->resizeForPrint(size);
       view->view()->paint(paint, QRegion());
-      view->view()->revertForPrint();
+      if (revert) {
+        view->view()->revertForPrint();
+      }
 
       firstPage = false;
     }
--- trunk/extragear/graphics/kst/src/libkstapp/kst.h #525905:525906
@@ -271,17 +271,17 @@
     void slotFilePrint();
 
     /** print without querying */
-    void immediatePrintToFile(const QString &filename);
-    void immediatePrintWindowToFile(KMdiChildView* pWindow, const QString& filename);
+    void immediatePrintToFile(const QString& filename, bool revert = true);
+    void immediatePrintWindowToFile(KMdiChildView *window, const QString& filename);
     void immediatePrintActiveWindowToFile(const QString& filename);
 
     /** export to png without querying */
-    void immediatePrintToPng(const QString &filename, const QString& format = "PNG", int iWidth=640, int iHeight=480, bool bAll=false, int display=0);
-    void immediatePrintWindowToPng(KMdiChildView* pWindow, const QString& filename, const QString& format = "PNG", int iWidth=640, int iHeight=480, int display=0);
-    void immediatePrintActiveWindowToPng(const QString& filename, const QString& format = "PNG", int iWidth=640, int iHeight=480, int display=0);
+    void immediatePrintToPng(const QString& filename, const QString& format = "PNG", int width = 640, int height = 480, bool all = false, int display = 0);
+    void immediatePrintWindowToPng(KMdiChildView *window, const QString& filename, const QString& format = "PNG", int width = 640, int height = 480, int display = 0);
+    void immediatePrintActiveWindowToPng(const QString& filename, const QString& format = "PNG", int width = 640, int height = 480, int display = 0);
 
     /** export to eps without querying */    
-    void immediatePrintToEps(const QString &filename, int iWidth=640, int iHeight=480, bool bAll=false, int display=0);
+    void immediatePrintToEps(const QString& filename, int width = 640, int height = 480, bool all=false, int display = 0);
     void immediatePrintWindowToEps(KMdiChildView *win, const QString& filename, int width, int height, int display);    
     void immediatePrintActiveWindowToEps(const QString& filename, int width, int height, int display);