summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx26
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx4
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx10
-rw-r--r--sd/source/ui/unoidl/unocpres.cxx16
4 files changed, 30 insertions, 26 deletions
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index 2a56b7e125dd..210c44667e0b 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -356,12 +356,11 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( Window* pWindow,
aEdtName.SetText( aOldName );
// ListBox mit CustomShow-Seiten fuellen
- for( pPage = (SdPage*) rpCustomShow->First();
- pPage != NULL;
- pPage = (SdPage*) rpCustomShow->Next() )
+ for( SdCustomShow::PageVec::iterator it = rpCustomShow->PagesVector().begin();
+ it != rpCustomShow->PagesVector().end(); ++it )
{
- SvLBoxEntry* pEntry = aLbCustomPages.InsertEntry( pPage->GetName() );
- pEntry->SetUserData( pPage );
+ SvLBoxEntry* pEntry = aLbCustomPages.InsertEntry( (*it)->GetName() );
+ pEntry->SetUserData( (SdPage*) (*it) );
}
}
else
@@ -473,22 +472,23 @@ void SdDefineCustomShowDlg::CheckCustomShow()
SvLBoxEntry* pEntry = NULL;
// Anzahl vergleichen
- if( rpCustomShow->Count() != aLbCustomPages.GetEntryCount() )
+ if( rpCustomShow->PagesVector().size() != aLbCustomPages.GetEntryCount() )
{
- rpCustomShow->Clear();
+ rpCustomShow->PagesVector().clear();
bDifferent = sal_True;
}
// Seiten-Pointer vergleichen
if( !bDifferent )
{
- for( pPage = (SdPage*) rpCustomShow->First(), pEntry = aLbCustomPages.First();
- pPage != NULL && pEntry != NULL && !bDifferent;
- pPage = (SdPage*) rpCustomShow->Next(), pEntry = aLbCustomPages.Next( pEntry ) )
+ SdCustomShow::PageVec::iterator it1 = rpCustomShow->PagesVector().begin();
+ pEntry = aLbCustomPages.First();
+ for( ; it1 != rpCustomShow->PagesVector().end() && pEntry != NULL && !bDifferent;
+ ++it1, pEntry = aLbCustomPages.Next( pEntry ) )
{
- if( pPage != pEntry->GetUserData() )
+ if( *it1 != pEntry->GetUserData() )
{
- rpCustomShow->Clear();
+ rpCustomShow->PagesVector().clear();
bDifferent = sal_True;
}
}
@@ -502,7 +502,7 @@ void SdDefineCustomShowDlg::CheckCustomShow()
pEntry = aLbCustomPages.Next( pEntry ) )
{
pPage = (SdPage*) pEntry->GetUserData();
- rpCustomShow->Insert( pPage, LIST_APPEND );
+ rpCustomShow->PagesVector().push_back( pPage );
}
bModified = sal_True;
}
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index ed79b244f9ef..713273955e1e 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1201,9 +1201,9 @@ bool SdPageObjsTLB::PageBelongsToCurrentShow (const SdPage* pPage) const
if (pCustomShow != NULL)
{
bBelongsToShow = false;
- sal_uLong nPageCount = pCustomShow->Count();
+ sal_uLong nPageCount = pCustomShow->PagesVector().size();
for (sal_uInt16 i=0; i<nPageCount && !bBelongsToShow; i++)
- if (pPage == static_cast<SdPage*>(pCustomShow->GetObject (i)))
+ if (pPage == pCustomShow->PagesVector()[i])
bBelongsToShow = true;
}
}
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 8df640718584..d61899415384 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -2485,7 +2485,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
// create animation slide controller
AnimationSlideController::Mode eMode =
- ( pCustomShow && pCustomShow->Count() ) ? AnimationSlideController::CUSTOM :
+ ( pCustomShow && pCustomShow->PagesVector().size() ) ? AnimationSlideController::CUSTOM :
(bAll ? AnimationSlideController::ALL : AnimationSlideController::FROM);
Reference< XDrawPagesSupplier > xDrawPages( mpDoc->getUnoModel(), UNO_QUERY_THROW );
@@ -2546,11 +2546,11 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
mpSlideController->insertSlideNumber( (sal_uInt16) nSlide );
}
- void* pCustomSlide;
- sal_Int32 nSlideIndex;
- for( pCustomSlide = pCustomShow->First(),nSlideIndex=0; pCustomSlide; pCustomSlide = pCustomShow->Next(), nSlideIndex++ )
+ sal_Int32 nSlideIndex = 0;
+ for( SdCustomShow::PageVec::iterator it = pCustomShow->PagesVector().begin();
+ it != pCustomShow->PagesVector().end(); ++it, nSlideIndex++ )
{
- const sal_uInt16 nSdSlide = ( ( (SdPage*) pCustomSlide )->GetPageNum() - 1 ) / 2;
+ const sal_uInt16 nSdSlide = ( ( (SdPage*) (*it) )->GetPageNum() - 1 ) / 2;
if( !( mpDoc->GetSdPage( nSdSlide, PK_STANDARD ) )->IsExcluded())
mpSlideController->insertSlideNumber( nSdSlide );
diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx
index 71f70fabf69f..e0aa857e2824 100644
--- a/sd/source/ui/unoidl/unocpres.cxx
+++ b/sd/source/ui/unoidl/unocpres.cxx
@@ -26,6 +26,8 @@
*
************************************************************************/
+#include <algorithm>
+
#include <com/sun/star/lang/DisposedException.hpp>
#include <osl/mutex.hxx>
#include <osl/mutex.hxx>
@@ -100,7 +102,7 @@ void SAL_CALL SdXCustomPresentation::insertByIndex( sal_Int32 Index, const uno::
if( bDisposing )
throw lang::DisposedException();
- if( Index < 0 || Index > (sal_Int32)( mpSdCustomShow ? mpSdCustomShow->Count() : 0 ) )
+ if( Index < 0 || Index > (sal_Int32)( mpSdCustomShow ? mpSdCustomShow->PagesVector().size() : 0 ) )
throw lang::IndexOutOfBoundsException();
uno::Reference< drawing::XDrawPage > xPage;
@@ -119,7 +121,8 @@ void SAL_CALL SdXCustomPresentation::insertByIndex( sal_Int32 Index, const uno::
if( NULL != mpModel && NULL == mpSdCustomShow && mpModel->GetDoc() )
mpSdCustomShow = new SdCustomShow( mpModel->GetDoc() );
- mpSdCustomShow->Insert(pPage->GetSdrPage(), Index);
+ mpSdCustomShow->PagesVector().insert(mpSdCustomShow->PagesVector().begin() + Index,
+ (SdPage*) pPage->GetSdrPage());
}
if( mpModel )
@@ -143,7 +146,8 @@ void SAL_CALL SdXCustomPresentation::removeByIndex( sal_Int32 Index )
{
SvxDrawPage* pPage = SvxDrawPage::getImplementation( xPage );
if(pPage)
- mpSdCustomShow->Remove(pPage->GetSdrPage());
+ ::std::remove(mpSdCustomShow->PagesVector().begin(), mpSdCustomShow->PagesVector().end(),
+ pPage->GetSdrPage());
}
}
@@ -185,7 +189,7 @@ sal_Int32 SAL_CALL SdXCustomPresentation::getCount()
if( bDisposing )
throw lang::DisposedException();
- return mpSdCustomShow?mpSdCustomShow->Count():0;
+ return mpSdCustomShow ? mpSdCustomShow->PagesVector().size() : 0;
}
uno::Any SAL_CALL SdXCustomPresentation::getByIndex( sal_Int32 Index )
@@ -196,13 +200,13 @@ uno::Any SAL_CALL SdXCustomPresentation::getByIndex( sal_Int32 Index )
if( bDisposing )
throw lang::DisposedException();
- if( Index < 0 || Index >= (sal_Int32)mpSdCustomShow->Count() )
+ if( Index < 0 || Index >= (sal_Int32)mpSdCustomShow->PagesVector().size() )
throw lang::IndexOutOfBoundsException();
uno::Any aAny;
if(mpSdCustomShow )
{
- SdrPage* pPage = (SdrPage*)mpSdCustomShow->GetObject(Index);
+ SdrPage* pPage = (SdrPage*)mpSdCustomShow->PagesVector()[Index];
if( pPage )
{