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

New commits:
commit 75547495982dd0a87390254e9d5e5fee5c9bc613
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Nov 30 09:28:10 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Nov 30 17:11:14 2021 +0100

    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.st...@allotropia.de>
    Tested-by: Jenkins

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

Reply via email to