[Libreoffice-commits] .: filter/inc filter/source

Joseph Powers jpowers at kemper.freedesktop.org
Tue Jun 14 05:32:31 PDT 2011


 filter/inc/filter/msfilter/svdfppt.hxx |   11 +++++------
 filter/source/msfilter/svdfppt.cxx     |   17 ++++++++---------
 2 files changed, 13 insertions(+), 15 deletions(-)

New commits:
commit 6d2071a9a81e79f4617ecfb71006179020ed2a1f
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Mon Jun 13 21:32:34 2011 -0700

    Replace List with std::vector< SdrObject* >

diff --git a/filter/inc/filter/msfilter/svdfppt.hxx b/filter/inc/filter/msfilter/svdfppt.hxx
index 3e1b5ef..d9f5243 100644
--- a/filter/inc/filter/msfilter/svdfppt.hxx
+++ b/filter/inc/filter/msfilter/svdfppt.hxx
@@ -506,17 +506,16 @@ struct MSFILTER_DLLPUBLIC HeaderFooterEntry
 
 struct ProcessData
 {
-    PptSlidePersistEntry&   rPersistEntry;
-    SdPage*                 pPage;
-    List*                   pBackgroundColoredObjects;
-    sal_uInt32*             pTableRowProperties;
+    PptSlidePersistEntry&       rPersistEntry;
+    SdPage*                     pPage;
+    ::std::vector< SdrObject* > aBackgroundColoredObjects;
+    sal_uInt32*                 pTableRowProperties;
 
     ProcessData( PptSlidePersistEntry& rP, SdPage* pP ) :
         rPersistEntry               ( rP ),
         pPage                       ( pP ),
-        pBackgroundColoredObjects   ( NULL ),
         pTableRowProperties         ( NULL ) {};
-    ~ProcessData() { delete pBackgroundColoredObjects; delete[] pTableRowProperties; };
+    ~ProcessData() { delete[] pTableRowProperties; };
 };
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 3c0ca19..b6d54ff 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1284,9 +1284,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
         {
             if ( (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid ) == mso_fillBackground )
             {
-                if ( !rData.pBackgroundColoredObjects )
-                    rData.pBackgroundColoredObjects = new List;
-                rData.pBackgroundColoredObjects->Insert( pRet, LIST_APPEND );
+                rData.aBackgroundColoredObjects.push_back( pRet );
             }
         }
     }
@@ -2916,12 +2914,10 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
                            the current background color */
                         if ( rSlidePersist.ePageKind == PPT_SLIDEPAGE )
                         {
-                            List* pList2 = aProcessData.pBackgroundColoredObjects;
-                            if ( pList2 )
+                            if ( !aProcessData.aBackgroundColoredObjects.empty() )
                             {
                                 if ( rSlidePersist.pBObj )
                                 {
-                                    void* pPtr;
                                     const SfxPoolItem* pPoolItem = NULL;
                                     const SfxItemSet& rObjectItemSet = rSlidePersist.pBObj->GetMergedItemSet();
 
@@ -2932,9 +2928,12 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
                                         aNewSet.Put(*pPoolItem);
                                         aNewSet.Put(XFillStyleItem( XFILL_SOLID ));
 
-                                        for ( pPtr = pList2->First(); pPtr; pPtr = pList2->Next() )
-                                        {
-                                            ((SdrObject*)pPtr)->SetMergedItemSet(aNewSet);
+                                        for (
+                                            size_t i = 0, n = aProcessData.aBackgroundColoredObjects.size();
+                                            i < n;
+                                            ++i
+                                        ) {
+                                            aProcessData.aBackgroundColoredObjects[ i ]->SetMergedItemSet(aNewSet);
                                         }
                                     }
                                 }


More information about the Libreoffice-commits mailing list