summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-30 09:28:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-30 17:11:14 +0100
commit75547495982dd0a87390254e9d5e5fee5c9bc613 (patch)
tree6b500dd350ce79f7e549bfe7ac7c82c7083a4ed9
parentOInterfaceContainerHelper3 needs to be thread-safe (diff)
downloadcore-75547495982dd0a87390254e9d5e5fee5c9bc613.tar.gz
core-75547495982dd0a87390254e9d5e5fee5c9bc613.zip
ofz#41510 make sure BackgroundColoredObjects doesn't contain dead objects
Change-Id: I42a96a998736b9921c6416eb76b39029279c8bca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126101 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
-rw-r--r--filter/source/msfilter/svdfppt.cxx8
-rw-r--r--include/filter/msfilter/svdfppt.hxx3
2 files changed, 7 insertions, 4 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index bcf243b3f920..fc4c64ab0dda 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2911,7 +2911,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
if ( pObj )
{
if ( aProcessData.pTableRowProperties )
- pObj = CreateTable(pObj, aProcessData.pTableRowProperties.get(), aProcessData.rPersistEntry.xSolverContainer.get());
+ pObj = CreateTable(pObj, aProcessData.pTableRowProperties.get(), aProcessData.rPersistEntry.xSolverContainer.get(), aProcessData.aBackgroundColoredObjects);
pRet->NbcInsertObject( pObj );
@@ -7506,7 +7506,7 @@ static void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >
}
}
-SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, const sal_uInt32* pTableArry, SvxMSDffSolverContainer* pSolverContainer )
+SdrObject* SdrPowerPointImport::CreateTable(SdrObject* pGroup, const sal_uInt32* pTableArry, SvxMSDffSolverContainer* pSolverContainer, std::vector<SdrObject*>& rBackgroundColoredObjects)
{
SdrObject* pRet = pGroup;
@@ -7659,7 +7659,9 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, const sal_uInt32
while( aIter.IsMore() )
{
SdrObject* pPartObj = aIter.Next();
- removeShapeId( pPartObj );
+ removeShapeId(pPartObj);
+ // ofz#41510 make sure rBackgroundColoredObjects doesn't contain deleted objects
+ std::replace(rBackgroundColoredObjects.begin(), rBackgroundColoredObjects.end(), pPartObj, pRet);
}
SdrObject::Free( pGroup );
diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx
index 628288088ecc..9d5ef0a33e5e 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -640,7 +640,8 @@ public:
SdrObject* CreateTable(
SdrObject* pGroupObject,
const sal_uInt32* pTableArry,
- SvxMSDffSolverContainer*
+ SvxMSDffSolverContainer* pSolverContainer,
+ std::vector<SdrObject*>& rBackgroundColoredObjects
);
virtual bool ReadFormControl( tools::SvRef<SotStorage>& rSrc1, css::uno::Reference< css::form::XFormComponent > & rFormComp ) const = 0;
};