summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <nopower@novell.com>2011-05-11 13:51:16 +0200
committerJan Holesovsky <kendy@suse.cz>2011-05-11 13:51:16 +0200
commited0f8821d6a0bb61e061747d2b0875fd1c346a5e (patch)
tree330628d8ae9f90249fe8b9c52d0dc1027f925200
parentffe0767829727cd835d2d990e33248a36f4f6d82 (diff)
Fix crash when printing comments, fdo#37045.
Signed-off-by: Jan Holesovsky <kendy@suse.cz>
-rw-r--r--sw/source/core/layout/newfrm.cxx3
-rw-r--r--sw/source/core/layout/pagechg.cxx5
-rw-r--r--sw/source/core/view/viewsh.cxx4
3 files changed, 8 insertions, 4 deletions
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 2f02904abb..86eefcb9a2 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 f810f2fe7e..3b18c1634c 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 3917439352..f5b67cd5ae 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 );