diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-08-24 14:45:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-08-24 14:46:31 +0100 |
commit | b5040d946ee078ab16ad175dbf6bdc072f9e80ec (patch) | |
tree | d5eb7a641c727f5e8b80a0fbc2ffca9a5b9837c1 /sw | |
parent | 87610049f8a1690598b84b0bf984cfa487ce1074 (diff) |
Resolves: fdo#40345 don't crash loading temp document to get frame styles
Diffstat (limited to 'sw')
-rwxr-xr-x | sw/source/core/layout/paintfrm.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 15cd791b5e35..61068a0ec305 100755 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2955,7 +2955,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const const SwContact* pContact = ::GetUserCall( pDrawObj ); const SwAnchoredObject* pObj = pContact->GetAnchoredObj( pDrawObj ); - const SwFrm* pAnchorFrm = pObj->GetAnchorFrm(); + const SwFrm* pAnchorFrm = pObj ? pObj->GetAnchorFrm() : NULL; bool bInHeaderFooter = false; // Handle all non anchored as character objects... others are handled elsewere @@ -3557,7 +3557,8 @@ sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh ) { // OD 13.10.2003 #i19919# - consider 'virtual' drawing objects // OD 2004-03-29 #i26791# - pAnch = ((SwDrawContact*)pUserCall)->GetAnchorFrm( pObj ); + SwDrawContact* pDrawContact = dynamic_cast<SwDrawContact*>(pUserCall); + pAnch = pDrawContact ? pDrawContact->GetAnchorFrm(pObj) : NULL; if ( pAnch ) { if ( !pAnch->GetValidPosFlag() ) |