summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-26 13:18:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-26 21:27:25 +0100
commitfc8e7168b5d991d10dc556b5bf90efaa5d9c949e (patch)
tree3188f39700f04187dfaf85c06442631149488584 /filter
parente641975076db46381f39ebca82bd43c503c3880c (diff)
ofz#4435 Bad-cast
Change-Id: Ie0364c758af84097cee93e4f6c5e8af2816359d4 Reviewed-on: https://gerrit.libreoffice.org/45285 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/msdffimp.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index eac8803da7f4..9c3a8f6a10ee 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4100,11 +4100,15 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
return pRet;
sal_Int32 nShapeId;
SdrObject* pTmp = ImportGroup( aRecHd2, rSt, pClientData, aGroupClientAnchor, aGroupChildAnchor, nCalledByGroup + 1, &nShapeId );
- if ( pTmp && pRet && static_cast<SdrObjGroup*>(pRet)->GetSubList() )
+ if (pTmp)
{
- static_cast<SdrObjGroup*>(pRet)->GetSubList()->NbcInsertObject( pTmp );
- if( nShapeId )
- insertShapeId( nShapeId, pTmp );
+ SdrObjGroup* pGroup = dynamic_cast<SdrObjGroup*>(pRet);
+ if (pGroup && pGroup->GetSubList())
+ {
+ pGroup->GetSubList()->NbcInsertObject(pTmp);
+ if (nShapeId)
+ insertShapeId(nShapeId, pTmp);
+ }
}
}
else if ( aRecHd2.nRecType == DFF_msofbtSpContainer )
@@ -4113,11 +4117,15 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
return pRet;
sal_Int32 nShapeId;
SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRect, aGlobalChildRect, nCalledByGroup + 1, &nShapeId );
- if ( pTmp && pRet && static_cast<SdrObjGroup*>(pRet)->GetSubList())
+ if (pTmp)
{
- static_cast<SdrObjGroup*>(pRet)->GetSubList()->NbcInsertObject( pTmp );
- if( nShapeId )
- insertShapeId( nShapeId, pTmp );
+ SdrObjGroup* pGroup = dynamic_cast<SdrObjGroup*>(pRet);
+ if (pGroup && pGroup->GetSubList())
+ {
+ pGroup->GetSubList()->NbcInsertObject(pTmp);
+ if (nShapeId)
+ insertShapeId(nShapeId, pTmp);
+ }
}
}
if (!aRecHd2.SeekToEndOfRecord(rSt))