tdf#48083 Handle mso_fillBackground directly when processing the shape

And remove the no longer needed special handling
in SdrPowerPointImport::ImportPage

Follow-up to a43f1ac6c964181cbaa4c889409688197cbf7a2b

Change-Id: I0382d5cf93f9e3dfba2b7822032e3eb3cf668a8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156638
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index bc28e62..e8164dac 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1471,7 +1471,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
                }
            }
        }
        else if (eXFill == drawing::FillStyle_BITMAP && bUseSlideBackground)
        else if (eXFill == drawing::FillStyle_NONE && bUseSlideBackground)
        {
            rSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
            XFillUseSlideBackgroundItem aFillBgItem(true);
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index a4442cf..0ef068f 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1295,13 +1295,6 @@ rtl::Reference<SdrObject> SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData
                    maFidcls[ nSec ].dgid = rPersistEntry.nDrawingDgId; // insert the correct drawing id;
            }
        }
        if ( GetPropertyValue( DFF_Prop_fNoFillHitTest, 0 ) & 0x10 )
        {
            if (GetPropertyValue(DFF_Prop_fillType, mso_fillSolid) == mso_fillBackground)
            {
                rData.aBackgroundColoredObjects.push_back( pRet );
            }
        }
    }
    return pRet;
}
@@ -2903,7 +2896,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
                                                if ( pObj )
                                                {
                                                    if ( aProcessData.pTableRowProperties )
                                                        pObj = CreateTable(pObj.get(), aProcessData.pTableRowProperties.get(), aProcessData.rPersistEntry.xSolverContainer.get(), aProcessData.aBackgroundColoredObjects);
                                                        pObj = CreateTable(pObj.get(), aProcessData.pTableRowProperties.get(), aProcessData.rPersistEntry.xSolverContainer.get());

                                                    pRet->NbcInsertObject( pObj.get() );

@@ -2925,23 +2918,6 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
                                break;
                        }

                        // Handle shapes where the fill matches the background
                        // fill (mso_fillBackground).
                        if (rSlidePersist.ePageKind == PPT_SLIDEPAGE)
                        {
                            if (!aProcessData.aBackgroundColoredObjects.empty())
                            {
                                for (auto const & pObject : aProcessData.aBackgroundColoredObjects)
                                {
                                    SfxItemSet aNewSet(*pObject->GetMergedItemSet().GetPool());
                                    aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_NONE));
                                    XFillUseSlideBackgroundItem aFillBgItem(true);
                                    aNewSet.Put(aFillBgItem);
                                    pObject->SetMergedItemSet(aNewSet);
                                }
                            }
                        }

                        if ( rSlidePersist.pBObj )
                        {
                            // #i99386# transfer the attributes from the temporary BackgroundObject
@@ -7500,8 +7476,7 @@ static void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >

rtl::Reference<SdrObject> SdrPowerPointImport::CreateTable(
        SdrObject* pGroup, const sal_uInt32* pTableArry,
        SvxMSDffSolverContainer* pSolverContainer,
        std::vector<rtl::Reference<SdrObject>>& rBackgroundColoredObjects)
        SvxMSDffSolverContainer* pSolverContainer)
{
    rtl::Reference<SdrObject> pRet = pGroup;

@@ -7655,8 +7630,6 @@ rtl::Reference<SdrObject> SdrPowerPointImport::CreateTable(
        {
            SdrObject* pPartObj = aIter.Next();
            removeShapeId(pPartObj);
            // ofz#41510 make sure rBackgroundColoredObjects doesn't contain deleted objects
            std::replace(rBackgroundColoredObjects.begin(), rBackgroundColoredObjects.end(), pPartObj, pRet.get());
        }
    }
    catch( const Exception& )
diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx
index ae5f600..76173bf 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -652,8 +652,7 @@ public:
    rtl::Reference<SdrObject> CreateTable(
                                SdrObject* pGroupObject,
                                const sal_uInt32* pTableArry,
                                SvxMSDffSolverContainer* pSolverContainer,
                                std::vector<rtl::Reference<SdrObject>>& rBackgroundColoredObjects
                                SvxMSDffSolverContainer* pSolverContainer
                            );
    virtual bool ReadFormControl( tools::SvRef<SotStorage>& rSrc1, css::uno::Reference< css::form::XFormComponent > & rFormComp ) const = 0;
};