diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-08 12:29:34 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-08-08 13:54:06 +0300 |
commit | b10a5e4c3c3e0c95abd1f8b3d102c506b7e54c29 (patch) | |
tree | 0a6569fa2aed37898f8aa2fd3d438c3941a1855f /sd | |
parent | 720a130b29e24c5e3b8bfc97a046c1a41694ab8f (diff) |
STL'ify CustomShowList
Create SdCustomShowList class to replace usage of tools/list.hxx
Change-Id: I0e57e29c8ee9ac8d693fee0edb084ded5286c141
Diffstat (limited to 'sd')
-rw-r--r-- | sd/inc/drawdoc.hxx | 7 | ||||
-rw-r--r-- | sd/inc/sdabstdlg.hxx | 3 | ||||
-rw-r--r-- | sd/source/core/drawdoc.cxx | 5 | ||||
-rw-r--r-- | sd/source/core/drawdoc3.cxx | 7 | ||||
-rw-r--r-- | sd/source/core/drawdoc_animations.cxx | 5 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 13 | ||||
-rw-r--r-- | sd/source/ui/dlg/custsdlg.cxx | 23 | ||||
-rw-r--r-- | sd/source/ui/dlg/present.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/dlg/sddlgfact.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/sddlgfact.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/func/fusldlg.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/inc/custsdlg.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/inc/present.hxx | 5 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshow.cxx | 9 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unocpres.cxx | 29 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unocpres.hxx | 4 |
18 files changed, 75 insertions, 59 deletions
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx index 3e724439fac8..4f4b73fb5429 100644 --- a/sd/inc/drawdoc.hxx +++ b/sd/inc/drawdoc.hxx @@ -85,6 +85,8 @@ class SdTransferable; struct SpellCallbackInfo; struct StyleRequestData; class SdDrawDocument; +class SdCustomShow; +class SdCustomShowList; namespace sd { @@ -139,6 +141,7 @@ namespace sd }; } + // ------------------ // - SdDrawDocument - // ------------------ @@ -153,7 +156,7 @@ private: sd::ShapeList* mpOnlineSpellingList; SvxSearchItem* mpOnlineSearchItem; std::vector<sd::FrameView*> maFrameViewList; - List* mpCustomShowList; + SdCustomShowList* mpCustomShowList; ::sd::DrawDocShell* mpDocSh; SdTransferable * mpCreatingTransferable; sal_Bool mbHasOnlineSpellErrors; @@ -394,7 +397,7 @@ public: sal_uLong GetLinkCount(); std::vector<sd::FrameView*>& GetFrameViewList() { return maFrameViewList; } - SD_DLLPUBLIC List* GetCustomShowList(sal_Bool bCreate = sal_False); + SD_DLLPUBLIC SdCustomShowList* GetCustomShowList(sal_Bool bCreate = sal_False); void NbcSetChanged(sal_Bool bFlag = sal_True); diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx index 063a7354be57..11342a89cddd 100644 --- a/sd/inc/sdabstdlg.hxx +++ b/sd/inc/sdabstdlg.hxx @@ -71,6 +71,7 @@ class Window; class SdPage; class TabPage; class ViewShell; +class SdCustomShowList; class AbstractCopyDlg : public VclAbstractDialog //add for CopyDlg { @@ -201,7 +202,7 @@ public: 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, - const std::vector<String> &rPageNames, List* pCSList ) = 0; + const std::vector<String> &rPageNames, SdCustomShowList* pCSList ) = 0; virtual VclAbstractDialog* CreateRemoteDialog( ::Window* pWindow ) = 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; diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 7d4cc74c6925..6ddcda448750 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -82,6 +82,7 @@ #include "sdiocmpt.hxx" #include "sdresid.hxx" #include "cusshow.hxx" +#include "customshowlist.hxx" #include "../ui/inc/DrawDocShell.hxx" #include "../ui/inc/GraphicDocShell.hxx" #include "../ui/inc/sdxfer.hxx" @@ -414,10 +415,10 @@ SdDrawDocument::~SdDrawDocument() if (mpCustomShowList) { - for (sal_uLong j = 0; j < mpCustomShowList->Count(); j++) + for (sal_uLong j = 0; j < mpCustomShowList->size(); j++) { // Ggf. CustomShows loeschen - SdCustomShow* pCustomShow = (SdCustomShow*) mpCustomShowList->GetObject(j); + SdCustomShow* pCustomShow = (*mpCustomShowList)[j]; delete pCustomShow; } diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 1c7154f19282..27e9197c0cd6 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -58,6 +58,7 @@ #include "sdiocmpt.hxx" #include "strmname.h" #include "anminfo.hxx" +#include "customshowlist.hxx" #include "../ui/inc/unmovss.hxx" #include "../ui/inc/unchss.hxx" @@ -1190,15 +1191,15 @@ void SdDrawDocument::SetAllocDocSh(sal_Bool bAlloc) |* \************************************************************************/ -List* SdDrawDocument::GetCustomShowList(sal_Bool bCreate) +SdCustomShowList* SdDrawDocument::GetCustomShowList(sal_Bool bCreate) { if (!mpCustomShowList && bCreate) { // Liste erzeugen - mpCustomShowList = new List(); + mpCustomShowList = new SdCustomShowList; } - return(mpCustomShowList); + return mpCustomShowList; } /************************************************************************* diff --git a/sd/source/core/drawdoc_animations.cxx b/sd/source/core/drawdoc_animations.cxx index 375dd4d6296e..e0f166ef53c1 100644 --- a/sd/source/core/drawdoc_animations.cxx +++ b/sd/source/core/drawdoc_animations.cxx @@ -29,6 +29,7 @@ #include "drawdoc.hxx" #include "cusshow.hxx" +#include "customshowlist.hxx" using namespace ::com::sun::star::uno; using namespace ::com::sun::star::presentation; @@ -40,9 +41,9 @@ void SdDrawDocument::ReplacePageInCustomShows( const SdPage* pOldPage, const SdP { if ( mpCustomShowList ) { - for (sal_uLong i = 0; i < mpCustomShowList->Count(); i++) + for (sal_uLong i = 0; i < mpCustomShowList->size(); i++) { - SdCustomShow* pCustomShow = (SdCustomShow*) mpCustomShowList->GetObject(i); + SdCustomShow* pCustomShow = (*mpCustomShowList)[i]; pCustomShow->ReplacePage(pOldPage, pNewPage); } } diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index fa2c0a07e2c5..7415cae24bd2 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -77,6 +77,7 @@ #include "propread.hxx" #include <cusshow.hxx> #include <vcl/bmpacc.hxx> +#include "customshowlist.hxx" #include "../../ui/inc/DrawDocShell.hxx" #include "../../ui/inc/FrameView.hxx" @@ -1276,7 +1277,7 @@ sal_Bool ImplSdPPTImport::Import() sal_uInt32 nSCount = aContent.nRecLen >> 2; if ( pPageList && nSCount ) { - List* pList = mpDoc->GetCustomShowList( sal_True ); + SdCustomShowList* pList = mpDoc->GetCustomShowList( sal_True ); if ( pList ) { SdCustomShow* pSdCustomShow = new SdCustomShow( mpDoc ); @@ -1300,7 +1301,7 @@ sal_Bool ImplSdPPTImport::Import() } } if ( nFound ) - pList->Insert( pSdCustomShow, LIST_APPEND ); + pList->push_back( pSdCustomShow ); else delete pSdCustomShow; } @@ -1345,13 +1346,13 @@ sal_Bool ImplSdPPTImport::Import() // set the current custom show if ( aCustomShow.Len() ) { - void* pPtr; - List* pList = mpDoc->GetCustomShowList( sal_False ); + SdCustomShowList* pList = mpDoc->GetCustomShowList( sal_False ); if ( pList ) { - for ( pPtr = pList->First(); pPtr; pPtr = pList->Next() ) + SdCustomShow* pPtr = NULL; + for( pPtr = pList->First(); pPtr; pPtr = pList->Next() ) { - if ( ((SdCustomShow*)pPtr)->GetName() == aCustomShow ) + if ( pPtr->GetName() == aCustomShow ) break; } if ( !pPtr ) diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index 42daba82446e..e1436d43b2c6 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -41,6 +41,7 @@ #include "sdpage.hxx" #include "cusshow.hxx" #include "app.hxx" +#include "customshowlist.hxx" #include <vcl/msgbox.hxx> @@ -89,9 +90,9 @@ SdCustomShowDlg::SdCustomShowDlg( Window* pWindow, { long nPosToSelect = pCustomShowList->GetCurPos(); // ListBox mit CustomShows fuellen - for( pCustomShow = (SdCustomShow*) pCustomShowList->First(); + for( pCustomShow = pCustomShowList->First(); pCustomShow != NULL; - pCustomShow = (SdCustomShow*) pCustomShowList->Next() ) + pCustomShow = pCustomShowList->Next() ) { aLbCustomShows.InsertEntry( pCustomShow->GetName() ); } @@ -146,7 +147,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) if( !pCustomShowList ) pCustomShowList = rDoc.GetCustomShowList( sal_True ); - pCustomShowList->Insert( pCustomShow, LIST_APPEND ); + pCustomShowList->push_back( pCustomShow ); pCustomShowList->Last(); aLbCustomShows.InsertEntry( pCustomShow->GetName() ); aLbCustomShows.SelectEntry( pCustomShow->GetName() ); @@ -165,14 +166,14 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) if( nPos != LISTBOX_ENTRY_NOTFOUND ) { DBG_ASSERT( pCustomShowList, "pCustomShowList existiert nicht" ); - pCustomShow = (SdCustomShow*) pCustomShowList->GetObject( nPos ); + pCustomShow = (*pCustomShowList)[ nPos ]; SdDefineCustomShowDlg aDlg( this, rDoc, pCustomShow ); if( aDlg.Execute() == RET_OK ) { if( pCustomShow ) { - pCustomShowList->Replace( pCustomShow, nPos ); + (*pCustomShowList)[nPos] = pCustomShow; pCustomShowList->Seek( nPos ); aLbCustomShows.RemoveEntry( nPos ); aLbCustomShows.InsertEntry( pCustomShow->GetName(), nPos ); @@ -189,7 +190,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) sal_uInt16 nPos = aLbCustomShows.GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - delete (SdCustomShow*) pCustomShowList->Remove( nPos ); + delete *pCustomShowList->erase( pCustomShowList->begin() + nPos ); aLbCustomShows.RemoveEntry( nPos ); aLbCustomShows.SelectEntryPos( nPos == 0 ? nPos : nPos - 1 ); bModified = sal_True; @@ -201,7 +202,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) sal_uInt16 nPos = aLbCustomShows.GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - SdCustomShow* pShow = new SdCustomShow( *(SdCustomShow*) pCustomShowList->GetObject( nPos ) ); + SdCustomShow* pShow = new SdCustomShow( *(*pCustomShowList)[nPos] ); String aStr( pShow->GetName() ); String aStrCopy( SdResId( STR_COPY_CUSTOMSHOW ) ); @@ -250,7 +251,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) //pCustomShowList->Seek( nPosToSelect ); pShow->SetName( aStr ); - pCustomShowList->Insert( pShow, LIST_APPEND ); + pCustomShowList->push_back( pShow ); pCustomShowList->Last(); aLbCustomShows.InsertEntry( pShow->GetName() ); aLbCustomShows.SelectEntry( pShow->GetName() ); @@ -523,16 +524,16 @@ IMPL_LINK_NOARG(SdDefineCustomShowDlg, OKHdl) { // Name ueberpruefen... sal_Bool bDifferent = sal_True; - List* pCustomShowList = rDoc.GetCustomShowList(); + SdCustomShowList* pCustomShowList = rDoc.GetCustomShowList(); if( pCustomShowList ) { String aName( aEdtName.GetText() ); SdCustomShow* pCustomShow; long nPosToSelect = pCustomShowList->GetCurPos(); - for( pCustomShow = (SdCustomShow*) pCustomShowList->First(); + for( pCustomShow = pCustomShowList->First(); pCustomShow != NULL; - pCustomShow = (SdCustomShow*) pCustomShowList->Next() ) + pCustomShow = pCustomShowList->Next() ) { if( aName == pCustomShow->GetName() && aName != aOldName ) bDifferent = sal_False; diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index c84bd2c3f91a..54b008e5a5e2 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -42,6 +42,7 @@ #include "present.hrc" #include "sdresid.hxx" #include "cusshow.hxx" +#include "customshowlist.hxx" using ::rtl::OUString; using namespace ::com::sun::star::uno; @@ -54,7 +55,7 @@ using namespace ::com::sun::star::beans; \************************************************************************/ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow, const SfxItemSet& rInAttrs, - const std::vector<String> &rPageNames, List* pCSList ) : + const std::vector<String> &rPageNames, SdCustomShowList* pCSList ) : ModalDialog ( pWindow, SdResId( DLG_START_PRESENTATION ) ), aGrpRange ( this, SdResId( GRP_RANGE ) ), aRbtAll ( this, SdResId( RBT_ALL ) ), diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx index 87bf5339088d..e1a46666f3d0 100644 --- a/sd/source/ui/dlg/sddlgfact.cxx +++ b/sd/source/ui/dlg/sddlgfact.cxx @@ -485,7 +485,7 @@ SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg( : // add for SdStartPresentationDlg begin AbstractSdStartPresDlg * SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, - const std::vector<String> &rPageNames, List* pCSList ) + const std::vector<String> &rPageNames, SdCustomShowList* 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 df28929ead10..e4805414cd35 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -275,7 +275,7 @@ public: 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, - const std::vector<String> &rPageNames, List* pCSList ); + const std::vector<String> &rPageNames, SdCustomShowList* pCSList ); virtual VclAbstractDialog* CreateRemoteDialog( ::Window* pWindow ); // ad for RemoteDialog 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); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 4c3808769d50..534c178a51e9 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -50,6 +50,7 @@ #include "navigatr.hxx" #include "strings.hrc" #include "res_bmp.hrc" +#include "customshowlist.hxx" #include <com/sun/star/embed/XEmbedPersist.hpp> #include <svtools/embedtransfer.hxx> @@ -1175,12 +1176,11 @@ bool SdPageObjsTLB::PageBelongsToCurrentShow (const SdPage* pPage) const { // Get the current custom show. SdCustomShow* pCustomShow = NULL; - List* pShowList = const_cast<SdDrawDocument*>(mpDoc)->GetCustomShowList(); + SdCustomShowList* pShowList = const_cast<SdDrawDocument*>(mpDoc)->GetCustomShowList(); if (pShowList != NULL) { sal_uLong nCurrentShowIndex = pShowList->GetCurPos(); - void* pObject = pShowList->GetObject(nCurrentShowIndex); - pCustomShow = static_cast<SdCustomShow*>(pObject); + pCustomShow = (*pShowList)[nCurrentShowIndex]; } // Check whether the given page is part of that custom show. diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx index f11e5969db5e..2e50da64d861 100644 --- a/sd/source/ui/func/fusldlg.cxx +++ b/sd/source/ui/func/fusldlg.cxx @@ -103,7 +103,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& ) else if ( pPage->IsSelected() && !aFirstPage.Len() ) aFirstPage = aStr; } - List* pCustomShowList = mpDoc->GetCustomShowList(); // No Create + SdCustomShowList* pCustomShowList = mpDoc->GetCustomShowList(); // No Create sal_Bool bStartWithActualPage = SD_MOD()->GetSdOptions( mpDoc->GetDocumentType() )->IsStartWithActualPage(); if( !aFirstPage.Len() && pPage ) @@ -129,7 +129,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& ) aDlgSet.Put( SfxInt32Item( ATTR_PRESENT_DISPLAY, pOptions->GetDisplay() ) ); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - AbstractSdStartPresDlg* pDlg = pFact ? pFact->CreateSdStartPresentationDlg(mpWindow, aDlgSet, aPageNameList, pCustomShowList ) : 0; + AbstractSdStartPresDlg* pDlg = pFact ? pFact->CreateSdStartPresentationDlg(mpWindow, aDlgSet, aPageNameList, pCustomShowList) : 0; if( pDlg && (pDlg->Execute() == RET_OK) ) { rtl::OUString aPage; diff --git a/sd/source/ui/inc/custsdlg.hxx b/sd/source/ui/inc/custsdlg.hxx index cb077e06fd21..774497664932 100644 --- a/sd/source/ui/inc/custsdlg.hxx +++ b/sd/source/ui/inc/custsdlg.hxx @@ -39,6 +39,7 @@ class SdDrawDocument; class SdCustomShow; +class SdCustomShowList; //------------------------------------------------------------------------ @@ -56,7 +57,7 @@ private: OKButton aBtnOK; SdDrawDocument& rDoc; - List* pCustomShowList; + SdCustomShowList* pCustomShowList; SdCustomShow* pCustomShow; sal_Bool bModified; diff --git a/sd/source/ui/inc/present.hxx b/sd/source/ui/inc/present.hxx index 2a19777b6eef..451ff717d014 100644 --- a/sd/source/ui/inc/present.hxx +++ b/sd/source/ui/inc/present.hxx @@ -38,6 +38,7 @@ class SfxItemSet; class List; +class SdCustomShowList; /************************************************************************* |* Dialog zum Festlegen von Optionen und Starten der Praesentation @@ -77,7 +78,7 @@ private: CancelButton aBtnCancel; HelpButton aBtnHelp; - List* pCustomShowList; + SdCustomShowList* pCustomShowList; const SfxItemSet& rOutAttrs; sal_Int32 mnMonitors; @@ -95,7 +96,7 @@ public: SdStartPresentationDlg( Window* pWindow, const SfxItemSet& rInAttrs, const std::vector<String> &rPageNames, - List* pCSList ); + SdCustomShowList* pCSList ); void GetAttr( SfxItemSet& rOutAttrs ); }; diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index c2fa430a672c..bd64cad418d7 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -60,6 +60,7 @@ #include "ViewShell.hxx" #include "SlideShowRestarter.hxx" #include "DrawController.hxx" +#include "customshowlist.hxx" #include <boost/bind.hpp> using ::com::sun::star::presentation::XSlideShowController; @@ -385,11 +386,11 @@ void SAL_CALL SlideShow::setPropertyValue( const OUString& aPropertyName, const const String aShowName( aShow ); - List* pCustomShowList = mpDoc->GetCustomShowList(sal_False); + SdCustomShowList* pCustomShowList = mpDoc->GetCustomShowList(sal_False); if(pCustomShowList) { SdCustomShow* pCustomShow; - for( pCustomShow = (SdCustomShow*) pCustomShowList->First(); pCustomShow != NULL; pCustomShow = (SdCustomShow*) pCustomShowList->Next() ) + for( pCustomShow = pCustomShowList->First(); pCustomShow != NULL; pCustomShow = pCustomShowList->Next() ) { if( pCustomShow->GetName() == aShowName ) break; @@ -605,8 +606,8 @@ Any SAL_CALL SlideShow::getPropertyValue( const OUString& PropertyName ) throw(U return Any( rPresSettings.mbAnimationAllowed ); case ATTR_PRESENT_CUSTOMSHOW: { - List* pList = mpDoc->GetCustomShowList(sal_False); - SdCustomShow* pShow = (pList && rPresSettings.mbCustomShow)?(SdCustomShow*)pList->GetCurObject():NULL; + SdCustomShowList* pList = mpDoc->GetCustomShowList(sal_False); + SdCustomShow* pShow = (pList && rPresSettings.mbCustomShow) ? pList->GetCurObject() : NULL; OUString aShowName; if(pShow) diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index ed7f21564665..75aceb17c0e1 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -80,6 +80,8 @@ #include "avmedia/mediawindow.hxx" #include "svtools/colrdlg.hxx" #include "RemoteServer.hxx" +#include "customshowlist.hxx" + #include <boost/bind.hpp> using ::rtl::OUString; @@ -2469,7 +2471,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons SdCustomShow* pCustomShow; if( !bStartWithActualSlide && mpDoc->GetCustomShowList() && maPresSettings.mbCustomShow ) - pCustomShow = (SdCustomShow*) mpDoc->GetCustomShowList()->GetCurObject(); + pCustomShow = mpDoc->GetCustomShowList()->GetCurObject(); else pCustomShow = NULL; diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx index 4280f39ac4b1..288726424bfc 100644 --- a/sd/source/ui/unoidl/unocpres.cxx +++ b/sd/source/ui/unoidl/unocpres.cxx @@ -41,6 +41,7 @@ #include "unocpres.hxx" #include "cusshow.hxx" #include "unopage.hxx" +#include "customshowlist.hxx" using namespace ::rtl; using namespace ::com::sun::star; @@ -342,7 +343,7 @@ void SAL_CALL SdXCustomPresentationAccess::insertByName( const OUString& aName, SolarMutexGuard aGuard; // get the documents custom show list - List* pList = 0; + SdCustomShowList* pList = 0; if(mrModel.GetDoc()) pList = mrModel.GetDoc()->GetCustomShowList(sal_True); @@ -377,15 +378,15 @@ void SAL_CALL SdXCustomPresentationAccess::insertByName( const OUString& aName, pShow->SetName( aName); // check if this or another customshow with the same name already exists - for( SdCustomShow* pCompare = (SdCustomShow*)pList->First(); + for( SdCustomShow* pCompare = pList->First(); pCompare; - pCompare = (SdCustomShow*)pList->Next() ) + pCompare = pList->Next() ) { if( pCompare == pShow || pCompare->GetName() == pShow->GetName() ) throw container::ElementExistException(); } - pList->Insert(pShow); + pList->push_back(pShow); mrModel.SetModified(); } @@ -397,9 +398,9 @@ void SAL_CALL SdXCustomPresentationAccess::removeByName( const OUString& Name ) SdCustomShow* pShow = getSdCustomShow(Name); - List* pList = GetCustomShowList(); + SdCustomShowList* pList = GetCustomShowList(); if(pList && pShow) - delete (SdCustomShow*)pList->Remove( pShow ); + delete pList->Remove( pShow ); else throw container::NoSuchElementException(); @@ -441,8 +442,8 @@ uno::Sequence< OUString > SAL_CALL SdXCustomPresentationAccess::getElementNames( { SolarMutexGuard aGuard; - List* pList = GetCustomShowList(); - const sal_uInt32 nCount = pList?pList->Count():0; + SdCustomShowList* pList = GetCustomShowList(); + const sal_uInt32 nCount = pList ? pList->size() : 0; uno::Sequence< OUString > aSequence( nCount ); OUString* pStringList = aSequence.getArray(); @@ -450,7 +451,7 @@ uno::Sequence< OUString > SAL_CALL SdXCustomPresentationAccess::getElementNames( sal_uInt32 nIdx = 0; while( nIdx < nCount ) { - const SdCustomShow* pShow = (const SdCustomShow*)pList->GetObject(nIdx); + const SdCustomShow* pShow = (*pList)[nIdx]; pStringList[nIdx] = pShow->GetName(); nIdx++; } @@ -478,22 +479,22 @@ sal_Bool SAL_CALL SdXCustomPresentationAccess::hasElements() { SolarMutexGuard aGuard; - List* pList = GetCustomShowList(); - return pList && pList->Count() > 0; + SdCustomShowList* pList = GetCustomShowList(); + return pList && !pList->empty(); } SdCustomShow * SdXCustomPresentationAccess::getSdCustomShow( const OUString& Name ) const throw() { sal_uInt32 nIdx = 0; - List* pList = GetCustomShowList(); - const sal_uInt32 nCount = pList?pList->Count():0; + SdCustomShowList* pList = GetCustomShowList(); + const sal_uInt32 nCount = pList ? pList->size() : 0; const String aName( Name ); while( nIdx < nCount ) { - SdCustomShow* pShow = (SdCustomShow*)pList->GetObject(nIdx); + SdCustomShow* pShow = (*pList)[nIdx]; if( pShow->GetName() == aName ) return pShow; nIdx++; diff --git a/sd/source/ui/unoidl/unocpres.hxx b/sd/source/ui/unoidl/unocpres.hxx index 3bb5f7f08489..4f29b0c58cd6 100644 --- a/sd/source/ui/unoidl/unocpres.hxx +++ b/sd/source/ui/unoidl/unocpres.hxx @@ -113,7 +113,7 @@ private: SdXImpressDocument& mrModel; // intern - inline List* GetCustomShowList() const throw(); + inline SdCustomShowList* GetCustomShowList() const throw(); SdCustomShow * getSdCustomShow( const ::rtl::OUString& Name ) const throw(); public: @@ -146,7 +146,7 @@ public: virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); }; -inline List * SdXCustomPresentationAccess::GetCustomShowList() const throw() +inline SdCustomShowList* SdXCustomPresentationAccess::GetCustomShowList() const throw() { if(mrModel.GetDoc()) return mrModel.GetDoc()->GetCustomShowList(sal_False); |