filter/source/msfilter/svdfppt.cxx  |    8 +++++---
 include/filter/msfilter/svdfppt.hxx |    3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 2a323bbbfa8c64bd6f8c30922f11e16a4d85756c
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Nov 30 09:28:10 2021 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Nov 30 20:21:21 2021 +0100

    ofz#41510 make sure BackgroundColoredObjects doesn't contain dead objects
    
    Change-Id: I42a96a998736b9921c6416eb76b39029279c8bca
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126107
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

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;
 };

Reply via email to