include/sfx2/bindings.hxx | 28 +----------- sfx2/source/control/bindings.cxx | 87 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 25 deletions(-)
New commits: commit 5859c63f93761130b0c8e836938ed6f9aa52c664 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Fri Nov 21 23:50:43 2014 -0500 Same with SfxUnoControllerArr_Impl. Change-Id: I927621de8f4c486ef0f77ec6c8da336f36b38b3e diff --git a/include/sfx2/bindings.hxx b/include/sfx2/bindings.hxx index ad31b6a..ddae134 100644 --- a/include/sfx2/bindings.hxx +++ b/include/sfx2/bindings.hxx @@ -28,18 +28,13 @@ #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> -#include <vector> - // some other includes - #include <sfx2/viewfrm.hxx> - // forwards, typedefs, declarations - class SystemWindow; class SfxSlot; class SfxSlotServer; @@ -54,8 +49,7 @@ class SfxWorkWindow; class SfxUnoControllerItem; struct SfxFoundCache_Impl; class SfxFoundCacheArr_Impl; - -typedef std::vector<SfxUnoControllerItem*> SfxUnoControllerArr_Impl; +class SfxUnoControllerArr_Impl; enum class SfxCallMode : sal_uInt16 { diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index db5ff60..76fca49 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -127,6 +127,51 @@ public: } }; +class SfxUnoControllerArr_Impl +{ + typedef std::vector<SfxUnoControllerItem*> DataType; + DataType maData; + +public: + + typedef DataType::iterator iterator; + + iterator begin() + { + return maData.begin(); + } + + iterator end() + { + return maData.end(); + } + + void erase( iterator it ) + { + maData.erase(it); + } + + SfxUnoControllerItem* operator[] ( size_t i ) + { + return maData[i]; + } + + const SfxUnoControllerItem* operator[] ( size_t i ) const + { + return maData[i]; + } + + size_t size() const + { + return maData.size(); + } + + void push_back( SfxUnoControllerItem* p ) + { + maData.push_back(p); + } +}; + class SfxAsyncExec_Impl { ::com::sun::star::util::URL aCommand; commit 6e385ffadd4842f28a51a1a490ea910cbee6ff4a Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Fri Nov 21 23:44:48 2014 -0500 Forward declare SfxFoundCacheArr_Impl and SfxFoundCache_Impl in bindings.hxx. And remove #include <boost/ptr_container/ptr_vector.hpp> from here. Change-Id: I7624444b60ee19f0b5b19e7a7aab0210ddf90d7c diff --git a/include/sfx2/bindings.hxx b/include/sfx2/bindings.hxx index 2fbe66d..ad31b6a 100644 --- a/include/sfx2/bindings.hxx +++ b/include/sfx2/bindings.hxx @@ -29,7 +29,6 @@ #include <com/sun/star/uno/Reference.h> #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> #include <vector> -#include <boost/ptr_container/ptr_vector.hpp> // some other includes @@ -53,6 +52,8 @@ class SfxBindings_Impl; class Timer; class SfxWorkWindow; class SfxUnoControllerItem; +struct SfxFoundCache_Impl; +class SfxFoundCacheArr_Impl; typedef std::vector<SfxUnoControllerItem*> SfxUnoControllerArr_Impl; @@ -97,23 +98,6 @@ enum SfxPopupAction SFX_POPUP_SHOW }; -struct SfxFoundCache_Impl -{ - sal_uInt16 nSlotId; // the Slot-Id - sal_uInt16 nWhichId; // If available: Which-Id, else: nSlotId - const SfxSlot* pSlot; // Pointer to <Master-Slot> - SfxStateCache* pCache; // Pointer to StatusCache, if possible NULL - - SfxFoundCache_Impl(sal_uInt16 nS, sal_uInt16 nW, const SfxSlot *pS, SfxStateCache *pC ): - nSlotId(nS), - nWhichId(nW), - pSlot(pS), - pCache(pC) - {} -}; - -typedef boost::ptr_vector<SfxFoundCache_Impl> SfxFoundCacheArr_Impl; - class SFX2_DLLPUBLIC SfxBindings: public SfxBroadcaster /* [Description] diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 1b51608..db5ff60 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -66,6 +66,7 @@ #include <com/sun/star/frame/XModuleManager.hpp> #include <boost/scoped_array.hpp> #include <boost/scoped_ptr.hpp> +#include <boost/ptr_container/ptr_vector.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -83,7 +84,48 @@ typedef boost::unordered_map< sal_uInt16, bool > InvalidateSlotMap; typedef std::vector<SfxStateCache*> SfxStateCacheArr_Impl; +struct SfxFoundCache_Impl +{ + sal_uInt16 nSlotId; // the Slot-Id + sal_uInt16 nWhichId; // If available: Which-Id, else: nSlotId + const SfxSlot* pSlot; // Pointer to <Master-Slot> + SfxStateCache* pCache; // Pointer to StatusCache, if possible NULL + + SfxFoundCache_Impl(sal_uInt16 nS, sal_uInt16 nW, const SfxSlot *pS, SfxStateCache *pC ): + nSlotId(nS), + nWhichId(nW), + pSlot(pS), + pCache(pC) + {} +}; + +class SfxFoundCacheArr_Impl +{ + typedef boost::ptr_vector<SfxFoundCache_Impl> DataType; + DataType maData; + +public: + + SfxFoundCache_Impl& operator[] ( size_t i ) + { + return maData[i]; + } + const SfxFoundCache_Impl& operator[] ( size_t i ) const + { + return maData[i]; + } + + size_t size() const + { + return maData.size(); + } + + void push_back( SfxFoundCache_Impl* p ) + { + maData.push_back(p); + } +}; class SfxAsyncExec_Impl { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits