[Libreoffice-commits] core.git: sd/source

Tobias Lippert drtl at fastmail.fm
Mon Mar 10 09:53:00 PDT 2014


 sd/source/filter/ppt/pptin.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 0b291d42e7fc3c787af0e88ee7c5499c333b14b2
Author: Tobias Lippert <drtl at fastmail.fm>
Date:   Tue Mar 4 22:20:54 2014 +0100

    Use SfxStyleSheetIterator to iterate over SfxStyles in sd/pptin.cxx
    
    Change-Id: I99534efdd52644882f2e2960bdafce58bf632804
    Reviewed-on: https://gerrit.libreoffice.org/8483
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index b6f1c66..e80fc82 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -91,6 +91,8 @@
 #include <comphelper/string.hxx>
 #include <oox/ole/olehelper.hxx>
 
+#include <boost/make_shared.hpp>
+
 using namespace ::com::sun::star;
 
 SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SvStorage& rStorage, SfxMedium& rMedium )
@@ -137,13 +139,12 @@ SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SvSto
     {
         // iterate over all styles
         SdStyleSheetPool* pStyleSheetPool = pDocument->GetSdStyleSheetPool();
+        SfxStyleSheetIteratorPtr aIter =
+                boost::make_shared<SfxStyleSheetIterator>(pStyleSheetPool, SFX_STYLE_FAMILY_ALL);
 
-        sal_uInt32 nStyles = pStyleSheetPool ? pStyleSheetPool->GetStyles().size() : 0;
-        for (sal_uInt32 nStyle = 0; nStyle < nStyles; nStyle++)
+        for (SfxStyleSheetBase *pSheet = aIter->First(); pSheet; pSheet = aIter->Next())
         {
-            SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>( pStyleSheetPool->GetStyles()[nStyle].get() );
             SfxItemSet& rSet = pSheet->GetItemSet();
-
             // if autokerning is set in style, override it, ppt has no autokerning
             if( rSet.GetItemState( EE_CHAR_PAIRKERNING, false ) == SFX_ITEM_SET )
                 rSet.ClearItem( EE_CHAR_PAIRKERNING );


More information about the Libreoffice-commits mailing list