diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-12 18:58:31 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-20 19:46:37 +0200 |
commit | c513264f19e07d5db247a9af7c661d43ea4005f8 (patch) | |
tree | 29d0b305e3173ada72f744d72e97b0b9c051ce99 | |
parent | b5f66b2d0912163b89d74937984b3ec20640215a (diff) |
Convert SV_DECL_PTRARR_DEL(BibStatusDispatchArr) to boost::ptr_vector
Change-Id: I3a09158ee1d864d3185b015d344391a60a926b65
-rw-r--r-- | extensions/source/bibliography/framectr.cxx | 28 | ||||
-rw-r--r-- | extensions/source/bibliography/framectr.hxx | 5 |
2 files changed, 15 insertions, 18 deletions
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index 31b6f7e285b6..554ef62076dd 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -111,8 +111,6 @@ static DispatchInfo SupportedCommandsArray[] = typedef ::boost::unordered_map< ::rtl::OUString, CacheDispatchInfo, rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > CmdToInfoCache; -SV_IMPL_PTRARR( BibStatusDispatchArr, BibStatusDispatchPtr ); - const CmdToInfoCache& GetCommandToInfoCache() { static sal_Bool bCacheInitialized = sal_False; @@ -280,7 +278,7 @@ void BibFrameController_Impl::dispose() throw (::com::sun::star::uno::RuntimeExc pImp->aLC.disposeAndClear(aObject); m_xDatMan = 0; pDatMan = 0; - aStatusListeners.DeleteAndDestroy( 0, aStatusListeners.Count() ); + aStatusListeners.clear(); } void BibFrameController_Impl::addEventListener( const uno::Reference< lang::XEventListener > & aListener ) throw (::com::sun::star::uno::RuntimeException) @@ -465,10 +463,10 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen } else if(aCommand.EqualsAscii("Bib/autoFilter")) { - sal_uInt16 nCount = aStatusListeners.Count(); + sal_uInt16 nCount = aStatusListeners.size(); for ( sal_uInt16 n=0; n<nCount; n++ ) { - BibStatusDispatch *pObj = aStatusListeners[n]; + BibStatusDispatch *pObj = &aStatusListeners[n]; if ( pObj->aURL.Path == C2U("Bib/removeFilter") ) { FeatureStateEvent aEvent; @@ -552,10 +550,10 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen OSL_FAIL( "BibFrameController_Impl::dispatch: caught an exception!" ); } - sal_uInt16 nCount = aStatusListeners.Count(); + sal_uInt16 nCount = aStatusListeners.size(); for ( sal_uInt16 n=0; n<nCount; n++ ) { - BibStatusDispatch *pObj = aStatusListeners[n]; + BibStatusDispatch *pObj = &aStatusListeners[n]; if ( pObj->aURL.Path == C2U("Bib/removeFilter") && pDatMan->getParser().is()) { FeatureStateEvent aEvent; @@ -701,7 +699,7 @@ void BibFrameController_Impl::addStatusListener( { BibConfig* pConfig = BibModul::GetConfig(); // create a new Reference and insert into listener array - aStatusListeners.Insert( new BibStatusDispatch( aURL, aListener ), aStatusListeners.Count() ); + aStatusListeners.push_back( new BibStatusDispatch( aURL, aListener ) ); // den ersten Status synchron zusenden FeatureStateEvent aEvent; @@ -835,15 +833,15 @@ void BibFrameController_Impl::removeStatusListener( // for checking equality always "cast" to XInterface if ( !bDisposing ) { - sal_uInt16 nCount = aStatusListeners.Count(); + sal_uInt16 nCount = aStatusListeners.size(); for ( sal_uInt16 n=0; n<nCount; n++ ) { - BibStatusDispatch *pObj = aStatusListeners[n]; + BibStatusDispatch *pObj = &aStatusListeners[n]; sal_Bool bFlag=pObj->xListener.is(); if (!bFlag || (pObj->xListener == aObject && ( aURL.Complete.isEmpty() || pObj->aURL.Path == aURL.Path ))) { - aStatusListeners.DeleteAndDestroy( n ); + aStatusListeners.erase( aStatusListeners.begin() + n ); break; } } @@ -855,14 +853,14 @@ void BibFrameController_Impl::RemoveFilter() rtl::OUString aQuery; pDatMan->startQueryWith(aQuery); - sal_uInt16 nCount = aStatusListeners.Count(); + sal_uInt16 nCount = aStatusListeners.size(); sal_Bool bRemoveFilter=sal_False; sal_Bool bQueryText=sal_False; for ( sal_uInt16 n=0; n<nCount; n++ ) { - BibStatusDispatch *pObj = aStatusListeners[n]; + BibStatusDispatch *pObj = &aStatusListeners[n]; if ( pObj->aURL.Path == C2U("Bib/removeFilter") ) { FeatureStateEvent aEvent; @@ -916,13 +914,13 @@ void BibFrameController_Impl::ChangeDataSource(const uno::Sequence< beans::Prope } - sal_uInt16 nCount = aStatusListeners.Count(); + sal_uInt16 nCount = aStatusListeners.size(); sal_Bool bMenuFilter=sal_False; sal_Bool bQueryText=sal_False; for ( sal_uInt16 n=0; n<nCount; n++ ) { - BibStatusDispatch *pObj = aStatusListeners[n]; + BibStatusDispatch *pObj = &aStatusListeners[n]; if(COMPARE_EQUAL == pObj->aURL.Path.compareToAscii("Bib/MenuFilter")) { FeatureStateEvent aEvent; diff --git a/extensions/source/bibliography/framectr.hxx b/extensions/source/bibliography/framectr.hxx index 4dd6aefb4703..e7fa82650fb8 100644 --- a/extensions/source/bibliography/framectr.hxx +++ b/extensions/source/bibliography/framectr.hxx @@ -36,7 +36,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/frame/XDispatchInformationProvider.hpp> #include <cppuhelper/implbase5.hxx> -#include <svl/svarray.hxx> +#include <boost/ptr_container/ptr_vector.hpp> #include "bibmod.hxx" class BibDataManager; @@ -57,8 +57,7 @@ public: {} }; -typedef BibStatusDispatch* BibStatusDispatchPtr; -SV_DECL_PTRARR_DEL( BibStatusDispatchArr, BibStatusDispatchPtr, 4 ) +typedef boost::ptr_vector<BibStatusDispatch> BibStatusDispatchArr; class BibFrameController_Impl : public cppu::WeakImplHelper5 < ::com::sun::star::lang::XServiceInfo, |