From 0334876ca61a7889578d5b705fc175d03c298904 Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Thu, 23 Oct 2008 20:47:11 +0000 Subject: [PATCH] * 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 --- src/frontends/qt4/GuiPainter.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.39.5