Version: HEAD (using KDE KDE 3.5.0) Installed from: Compiled From Sources OS: Linux PROBLEM: When resizing a plot with a contained legend Kst may crash STEPS TO REPRODUCE: Start Kst Create a plot and show the legend Switch to layout mode Resize the plot from one of the central resize points either horizontally or vertically Shrink the plot down to its smallest possible size RESULTS: Crash 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: Application 'kst' crashing... EXPECTED RESULTS: No crash
SVN commit 568678 by arwalker: BUG:131693 Don't try to paint to an empty bitmap as it causes a crash. M +10 -8 kstviewlegend.cpp --- trunk/extragear/graphics/kst/src/libkstapp/kstviewlegend.cpp #568677:568678 @@ -219,14 +219,16 @@ setDirty(false); _backBuffer.buffer().resize(contentsRect().size()); - _backBuffer.buffer().fill(backgroundColor()); - KstPainter p; - p.begin(&_backBuffer.buffer()); - QPen pen; - pen.setColor(foregroundColor()); - p.setPen(pen); - drawToPainter(p); - p.end(); + if (!contentsRect().size().isEmpty()) { + _backBuffer.buffer().fill(backgroundColor()); + KstPainter p; + p.begin(&_backBuffer.buffer()); + QPen pen; + pen.setColor(foregroundColor()); + p.setPen(pen); + drawToPainter(p); + p.end(); + } }
Fix was reverted
Can't reproduce with trunk.