diff options
author | Noel Grandin <noel@peralex.com> | 2012-01-31 14:16:38 +0000 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2012-01-31 14:17:33 +0000 |
commit | 5a71069339b3a3c118f3015d978799ef66db7564 (patch) | |
tree | 3244dc4c91e6e2a0cfd70f8edca2e57ab36a5faf /sd/source/ui/unoidl/unocpres.cxx | |
parent | d1a84bdb8065c46d98908bc5caec4a995d4d196f (diff) |
convert SdCustomeShow from tools/list to vector
Diffstat (limited to 'sd/source/ui/unoidl/unocpres.cxx')
-rw-r--r-- | sd/source/ui/unoidl/unocpres.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
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 ) { |