[Libreoffice-commits] .: vcl/unx

Michael Meeks michael at kemper.freedesktop.org
Tue Dec 20 06:41:17 PST 2011


 vcl/unx/generic/gdi/salgdi.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 6f0af3c2e3bef9e4d683e27f783024c799452a63
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Tue Dec 20 14:40:51 2011 +0000

    catch rather unlikely vcl case and don't crash

diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index e3e1090..abd153a 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -494,6 +494,12 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
 void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // const
 {
     const SalDisplay *pDisplay = GetDisplay();
+    if (!pDisplay)
+    {
+        OSL_TRACE("Null display");
+        rDPIX = rDPIY = 96;
+        return;
+    }
 
     rDPIX = pDisplay->GetResolution().A();
     rDPIY = pDisplay->GetResolution().B();


More information about the Libreoffice-commits mailing list