[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Apr 19 21:16:00 PDT 2011


 sc/source/ui/view/output.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 52d4f09d7c99062842f0ec9ccd9bc5951712ae1d
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Apr 20 00:13:42 2011 -0400

    fdo#36365: Watch out for NULL pointer de-referencing.
    
    This causes print preview to crash under certain circumstances.

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 5cf2415..f37a2c8 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1222,6 +1222,9 @@ void ScOutputData::DrawFrame()
     // draw only rows with set RowInfo::bChanged flag
     size_t nRow1 = nFirstRow;
     drawinglayer::processor2d::BaseProcessor2D* pProcessor = CreateProcessor2D();
+    if (!pProcessor)
+        return;
+
     while( nRow1 <= nLastRow )
     {
         while( (nRow1 <= nLastRow) && !pRowInfo[ nRow1 ].bChanged ) ++nRow1;
@@ -1631,9 +1634,12 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
 
 drawinglayer::processor2d::BaseProcessor2D* ScOutputData::CreateProcessor2D( )
 {
-    basegfx::B2DRange aViewRange;
+    ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+    if (!pDrawLayer)
+        return NULL;
 
-    SdrPage *pDrawPage = pDoc->GetDrawLayer()->GetPage( static_cast< sal_uInt16 >( nTab ) );
+    basegfx::B2DRange aViewRange;
+    SdrPage *pDrawPage = pDrawLayer->GetPage( static_cast< sal_uInt16 >( nTab ) );
     const drawinglayer::geometry::ViewInformation2D aNewViewInfos(
             basegfx::B2DHomMatrix(  ),
             pDev->GetViewTransformation(),


More information about the Libreoffice-commits mailing list