diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2011-06-08 15:43:44 -0430 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2011-06-10 18:46:33 +0200 |
commit | 418e1c560a9c6c68a1918e8a9b95ef276ce78ab1 (patch) | |
tree | 0ef56a2b5271405275d20ebcc7bcc3f74968cdf8 /sd/source/ui/unoidl/unomodel.cxx | |
parent | 6614d67510f067daef67cf6e8b704b409e1b4744 (diff) |
Replace List for std::vector<sd::FrameView*>.
Diffstat (limited to 'sd/source/ui/unoidl/unomodel.cxx')
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 60 |
1 files changed, 21 insertions, 39 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index a382a7aab057..40bf973a4dc7 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -618,9 +618,9 @@ uno::Reference < container::XIndexAccess > SAL_CALL SdXImpressDocument::getViewD if( !xRet.is() ) { - List* pFrameViewList = mpDoc->GetFrameViewList(); + const std::vector<sd::FrameView*> &rList = mpDoc->GetFrameViewList(); - if( pFrameViewList && pFrameViewList->Count() ) + if( !rList.empty() ) { xRet = uno::Reference < container::XIndexAccess >::query(::comphelper::getProcessServiceFactory()->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.IndexedPropertyValues")))); @@ -629,19 +629,13 @@ uno::Reference < container::XIndexAccess > SAL_CALL SdXImpressDocument::getViewD DBG_ASSERT( xCont.is(), "SdXImpressDocument::getViewData() failed for OLE object" ); if( xCont.is() ) { - sal_uInt32 i; - for( i = 0; i < pFrameViewList->Count(); i++ ) + for( sal_uInt32 i = 0, n = rList.size(); i < n; i++ ) { - ::sd::FrameView* pFrameView = - static_cast< ::sd::FrameView*>( - pFrameViewList->GetObject(i)); + ::sd::FrameView* pFrameView = rList[ i ]; - if(pFrameView) - { - uno::Sequence< beans::PropertyValue > aSeq; - pFrameView->WriteUserDataSequence( aSeq ); - xCont->insertByIndex( i, uno::makeAny( aSeq ) ); - } + uno::Sequence< beans::PropertyValue > aSeq; + pFrameView->WriteUserDataSequence( aSeq ); + xCont->insertByIndex( i, uno::makeAny( aSeq ) ); } } } @@ -662,36 +656,24 @@ void SAL_CALL SdXImpressDocument::setViewData( const uno::Reference < container: { const sal_Int32 nCount = xData->getCount(); - List* pFrameViewList = mpDoc->GetFrameViewList(); - - DBG_ASSERT( pFrameViewList, "No FrameViewList?" ); - if( pFrameViewList ) - { - ::sd::FrameView* pFrameView; + std::vector<sd::FrameView*>::iterator pIter; + std::vector<sd::FrameView*> &rViews = mpDoc->GetFrameViewList(); - sal_uInt32 i; - for ( i = 0; i < pFrameViewList->Count(); i++) - { - // Ggf. FrameViews loeschen - pFrameView = static_cast< ::sd::FrameView*>( - pFrameViewList->GetObject(i)); + for ( pIter = rViews.begin(); pIter != rViews.end(); ++pIter ) + delete *pIter; - if (pFrameView) - delete pFrameView; - } + rViews.clear(); - pFrameViewList->Clear(); - - uno::Sequence< beans::PropertyValue > aSeq; - sal_Int32 nIndex; - for( nIndex = 0; nIndex < nCount; nIndex++ ) + ::sd::FrameView* pFrameView; + uno::Sequence< beans::PropertyValue > aSeq; + for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) + { + if( xData->getByIndex( nIndex ) >>= aSeq ) { - if( xData->getByIndex( nIndex ) >>= aSeq ) - { - pFrameView = new ::sd::FrameView( mpDoc ); - pFrameView->ReadUserDataSequence( aSeq ); - pFrameViewList->Insert( pFrameView ); - } + pFrameView = new ::sd::FrameView( mpDoc ); + + pFrameView->ReadUserDataSequence( aSeq ); + rViews.push_back( pFrameView ); } } } |