]> git.lyx.org Git - features.git/commitdiff
* temporary fix for the crash of the pixmap cache on Mac with Qt 4.4.
authorStefan Schimanski <sts@lyx.org>
Thu, 23 Oct 2008 20:47:11 +0000 (20:47 +0000)
committerStefan Schimanski <sts@lyx.org>
Thu, 23 Oct 2008 20:47:11 +0000 (20:47 +0000)
  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

src/frontends/qt4/GuiPainter.cpp

index 4e6d516386bf50912ce34ac1527679cfd25b137d..68161d1be9edd4e561eb9dd1f2b6ba7dc20180ca 100644 (file)
@@ -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);