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

Caolán McNamara caolan at kemper.freedesktop.org
Thu Jun 23 03:14:26 PDT 2011


 sd/inc/sdabstdlg.hxx           |    3 ++-
 sd/source/ui/dlg/present.cxx   |   12 +++---------
 sd/source/ui/dlg/sddlgfact.cxx |    3 ++-
 sd/source/ui/dlg/sddlgfact.hxx |    3 ++-
 sd/source/ui/func/fusldlg.cxx  |   19 ++++++++-----------
 sd/source/ui/inc/present.hxx   |    2 +-
 6 files changed, 18 insertions(+), 24 deletions(-)

New commits:
commit 3d4d78968ed10bff585fd214b4f9dbb3ebe739b2
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sun Jun 12 17:50:47 2011 -0430

    Replace List with std::vector<String>.

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index d1cede9..bdcb832 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -200,7 +200,8 @@ public:
     virtual AbstractMorphDlg*			CreateMorphDlg( ::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2) = 0;
     virtual SfxAbstractTabDialog*		CreateSdOutlineBulletTabDlg ( ::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView = NULL ) = 0;
     virtual SfxAbstractTabDialog*		CreateSdParagraphTabDlg ( ::Window* pParent, const SfxItemSet* pAttr ) = 0;
-    virtual AbstractSdStartPresDlg*		CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, List& rPageNames, List* pCSList ) = 0;
+    virtual AbstractSdStartPresDlg*		CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs,
+                                                                     const std::vector<String> &rPageNames, List* pCSList ) = 0;
     virtual SfxAbstractTabDialog*		CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, ::Window* pParent, SdResId DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool ) = 0;
     virtual AbstractSdPresLayoutDlg*	CreateSdPresLayoutDlg( ::sd::DrawDocShell* pDocShell, ::sd::ViewShell* pViewShell, ::Window* pWindow, const SfxItemSet& rInAttrs) = 0;
     virtual SfxAbstractTabDialog*		CreateSdTabTemplateDlg( ::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) = 0;
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index f164dcf..30f609d 100644
--- a/sd/source/ui/dlg/present.cxx
+++ b/sd/source/ui/dlg/present.cxx
@@ -55,7 +55,7 @@ using namespace ::com::sun::star::beans;
 \************************************************************************/
 SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow,
                                   const SfxItemSet& rInAttrs,
-                                  List& rPageNames, List* pCSList ) :
+                                  const std::vector<String> &rPageNames, List* pCSList ) :
                 ModalDialog     ( pWindow, SdResId( DLG_START_PRESENTATION ) ),
                 aGrpRange               ( this, SdResId( GRP_RANGE ) ),
                 aRbtAll                 ( this, SdResId( RBT_ALL ) ),
@@ -119,14 +119,8 @@ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow,
     aTmfPause.SetAccessibleName(aRbtAuto.GetText());
 
     // Listbox mit Seitennamen fuellen
-    rPageNames.First();
-    for( sal_uInt16 i = 0;
-         i < rPageNames.Count();
-         i++ )
-    {
-        aLbDias.InsertEntry( *( String* ) rPageNames.GetCurObject() );
-        rPageNames.Next();
-    }
+    for (std::vector<String>::const_iterator pIter = rPageNames.begin(); pIter != rPageNames.end(); ++pIter)
+        aLbDias.InsertEntry(*pIter);
 
     if( pCustomShowList )
     {
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 90c60c9..6f36175 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -484,7 +484,8 @@ SfxAbstractTabDialog *  SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg( :
 // add for OutlineBulletDlg end 
 
 // add for SdStartPresentationDlg begin
-AbstractSdStartPresDlg *  SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, List& rPageNames, List* pCSList )
+AbstractSdStartPresDlg *  SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs,
+                                                                                     const std::vector<String> &rPageNames, List* pCSList )
 {
     return new AbstractSdStartPresDlg_Impl( new SdStartPresentationDlg( pWindow, rInAttrs, rPageNames, pCSList ) );
 }
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index d227e77..895ac84 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -273,7 +273,8 @@ public:
     virtual AbstractMorphDlg*			CreateMorphDlg( ::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2);
     virtual SfxAbstractTabDialog*		CreateSdOutlineBulletTabDlg ( ::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView = NULL );
     virtual SfxAbstractTabDialog*		CreateSdParagraphTabDlg ( ::Window* pParent, const SfxItemSet* pAttr );
-    virtual AbstractSdStartPresDlg*		CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, List& rPageNames, List* pCSList );
+    virtual AbstractSdStartPresDlg*		CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs,
+                                                                     const std::vector<String> &rPageNames, List* pCSList );
     virtual SfxAbstractTabDialog*		CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, ::Window* pParent, SdResId DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool );
     virtual AbstractSdPresLayoutDlg*	CreateSdPresLayoutDlg( ::sd::DrawDocShell* pDocShell, ::sd::ViewShell* pViewShell, ::Window* pWindow, const SfxItemSet& rInAttrs);
     virtual SfxAbstractTabDialog*		CreateSdTabTemplateDlg( ::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView );
diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx
index 409e99a..0c805db 100644
--- a/sd/source/ui/func/fusldlg.cxx
+++ b/sd/source/ui/func/fusldlg.cxx
@@ -81,7 +81,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
     PresentationSettings& rPresentationSettings = mpDoc->getPresentationSettings();
 
     SfxItemSet		aDlgSet( mpDoc->GetPool(), ATTR_PRESENT_START, ATTR_PRESENT_END );
-    List			aPageNameList;
+    std::vector<String> aPageNameList(mpDoc->GetSdPageCount( PK_STANDARD ));
     const String&	rPresPage = rPresentationSettings.maPresPage;
     String			aFirstPage;
     String			aStandardName( SdResId( STR_PAGE ) );
@@ -91,21 +91,21 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
     for( nPage = mpDoc->GetSdPageCount( PK_STANDARD ) - 1L; nPage >= 0L; nPage-- )
     {
         pPage = mpDoc->GetSdPage( (sal_uInt16) nPage, PK_STANDARD );
-        String* pStr = new String( pPage->GetName() );
+        String aStr( pPage->GetName() );
 
-        if ( !pStr->Len() )
+        if ( !aStr.Len() )
         {
-            *pStr = String( SdResId( STR_PAGE ) );
-            (*pStr).Append( UniString::CreateFromInt32( nPage + 1 ) );
+            aStr = String( SdResId( STR_PAGE ) );
+            aStr.Append( UniString::CreateFromInt32( nPage + 1 ) );
         }
 
-        aPageNameList.Insert( pStr, (sal_uLong) 0 );
+        aPageNameList[ nPage ] = aStr;
 
         // ist dies unsere (vorhandene) erste Seite?
-        if ( rPresPage == *pStr )
+        if ( rPresPage == aStr )
             aFirstPage = rPresPage;
         else if ( pPage->IsSelected() && !aFirstPage.Len() )
-            aFirstPage = *pStr;
+            aFirstPage = aStr;
     }
     List* pCustomShowList = mpDoc->GetCustomShowList(); // No Create
 
@@ -248,9 +248,6 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
             mpDoc->SetChanged( sal_True );
     }
     delete pDlg;
-    // Strings aus Liste loeschen
-    for( void* pStr = aPageNameList.First(); pStr; pStr = aPageNameList.Next() )
-        delete (String*) pStr;
 }
 
 } // end of namespace sd
diff --git a/sd/source/ui/inc/present.hxx b/sd/source/ui/inc/present.hxx
index 6069edc..11681ce 100644
--- a/sd/source/ui/inc/present.hxx
+++ b/sd/source/ui/inc/present.hxx
@@ -95,7 +95,7 @@ private:
 public:
                         SdStartPresentationDlg( Window* pWindow,
                                 const SfxItemSet& rInAttrs,
-                                List& rPageNames,
+                                const std::vector<String> &rPageNames,
                                 List* pCSList );
 
     void				GetAttr( SfxItemSet& rOutAttrs );


More information about the Libreoffice-commits mailing list