summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-24 14:45:41 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-24 14:46:31 +0100
commitb5040d946ee078ab16ad175dbf6bdc072f9e80ec (patch)
treed5eb7a641c727f5e8b80a0fbc2ffca9a5b9837c1
parent87610049f8a1690598b84b0bf984cfa487ce1074 (diff)
Resolves: fdo#40345 don't crash loading temp document to get frame styles
-rwxr-xr-xsw/source/core/layout/paintfrm.cxx5
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() )