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

Jan Holesovsky kendy at kemper.freedesktop.org
Wed May 11 04:52:52 PDT 2011


 sw/source/core/layout/newfrm.cxx  |    3 ++-
 sw/source/core/layout/pagechg.cxx |    5 +++--
 sw/source/core/view/viewsh.cxx    |    4 +++-
 3 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit ed0f8821d6a0bb61e061747d2b0875fd1c346a5e
Author: Noel Power <nopower at novell.com>
Date:   Wed May 11 13:51:16 2011 +0200

    Fix crash when printing comments, fdo#37045.
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 2f02904..86eefcb 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -609,7 +609,8 @@ SwRootFrm::~SwRootFrm()
     pTurbo = 0;
     if(pBlink)
         pBlink->FrmDelete( this );
-    static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->GetDoc()->DelFrmFmt( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) );
+    if ( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) )
+        static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->GetDoc()->DelFrmFmt( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) );
     delete pDestroy;
     pDestroy = 0;
 
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index f810f2f..3b18c16 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -296,7 +296,7 @@ SwPageFrm::~SwPageFrm()
     //Damit der Zugriff auf zerstoerte Seiten verhindert werden kann.
     if ( !IsEmptyPage() ) //#59184# sollte fuer Leerseiten unnoetig sein.
     {
-        SwDoc *pDoc = GetFmt()->GetDoc();
+        SwDoc *pDoc = GetFmt() ? GetFmt()->GetDoc() : NULL;
         if( pDoc && !pDoc->IsInDtor() )
         {
             ViewShell *pSh = getRootFrm()->GetCurrShell();
@@ -864,7 +864,8 @@ void AdjustSizeChgNotify( SwRootFrm *pRoot )
             if( pRoot == pSh->GetLayout() )
             {
                 pSh->SizeChgNotify();
-                pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() );
+                if ( pSh->Imp() )
+                    pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() );
             }
             pSh = (ViewShell*)pSh->GetNext();
         } while ( pSh != pRoot->GetCurrShell() );
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 3917439..f5b67cd 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -918,7 +918,9 @@ void ViewShell::SetFirstVisPageInvalid()
 {
     ViewShell *pSh = this;
     do
-    {	pSh->Imp()->SetFirstVisPageInvalid();
+    {
+        if ( pSh->Imp() )
+            pSh->Imp()->SetFirstVisPageInvalid();
         pSh = (ViewShell*)pSh->GetNext();
 
     } while ( pSh != this );


More information about the Libreoffice-commits mailing list