summaryrefslogtreecommitdiff
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 14:47:51 +0100
commit4b06bd166a14bcb8da12c923de57098bee179767 (patch)
treea51c99966d7eaa9ed21d38dbabd2088e5c850f98
parent20029f713f2cb07b27d7be9bb4df5c2cec4723da (diff)
ofz#41510 make sure BackgroundColoredObjects doesn't contain dead objects
Change-Id: I42a96a998736b9921c6416eb76b39029279c8bca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126099 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-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 360669ff90f2..93a9a9913335 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2912,7 +2912,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 );
@@ -7535,7 +7535,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;
@@ -7688,7 +7688,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 d319312b10b4..7ff89082d33c 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -652,7 +652,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;
};