diff options
author | Noel Power <nopower@novell.com> | 2011-05-11 13:51:16 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-05-11 13:51:16 +0200 |
commit | 74dbd69f14bcc1f5fdf762aa8e26023948151375 (patch) | |
tree | 6e58128d090f21764806f6351aad8f027022e9ac | |
parent | 7d300e05388de9446225395ef4b995c577fba440 (diff) |
Fix crash when printing comments, fdo#37045.
Signed-off-by: Jan Holesovsky <kendy@suse.cz>
-rw-r--r-- | sw/source/core/layout/newfrm.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/pagechg.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index faefa9c3e8b0..60f7815144e2 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 aa7aa23e02c0..804d514dc7f6 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 e328e369e696..95bd505e3f7f 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 ); |