From: Stefan Schimanski Date: Thu, 23 Oct 2008 20:47:11 +0000 (+0000) Subject: * temporary fix for the crash of the pixmap cache on Mac with Qt 4.4. X-Git-Tag: 1.6.10~2888 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0334876ca61a7889578d5b705fc175d03c298904;p=lyx.git * temporary fix for the crash of the pixmap cache on Mac with Qt 4.4. A better patch will follow soon, but this should go in for rc4. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27065 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp index 4e6d516386..68161d1be9 100644 --- a/src/frontends/qt4/GuiPainter.cpp +++ b/src/frontends/qt4/GuiPainter.cpp @@ -398,6 +398,11 @@ int GuiPainter::text(int x, int y, docstring const & s, int const w = textwidth + rb - lb; int const mD = fm.maxDescent(); int const h = mA + mD; + if (w <= 0 || h <= 0) { + LYXERR(Debug::PAINTING, "Invalid pixmap cache image for '" << s << "' h=" << h << " w=" << w); + return textwidth; + } + pm = QPixmap(w, h); pm.fill(Qt::transparent); GuiPainter p(&pm);