diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-06 13:32:29 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-06 14:41:26 -0500 |
commit | 5ae4cc92bd6660ccf36ff6cc45f96fa267514f1b (patch) | |
tree | 06430d84c813749bbdb72273b979d7311a9063d8 | |
parent | 9fb6174bb177ede8d393349a4e74d1dca953ad67 (diff) |
Forward-declare SfxInPlaceClientList and remove <vector> include.
Change-Id: I4e611820a4dae4341f971a545578048b52d7e37c
-rw-r--r-- | include/sfx2/viewsh.hxx | 10 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 24 |
2 files changed, 27 insertions, 7 deletions
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 20114cfac991..77353f6a62cd 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -35,7 +35,6 @@ #include <tools/gen.hxx> #include <tools/errcode.hxx> #include <vcl/jobset.hxx> -#include <vector> class SfxBaseController; class Size; @@ -122,8 +121,7 @@ public: \ DocClass::Factory().RegisterViewFactory( *Factory() ) class SfxInPlaceClient; -typedef ::std::vector< SfxInPlaceClient* > SfxInPlaceClientList; - +class SfxInPlaceClientList; class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener { @@ -169,6 +167,8 @@ private: /// SfxInterface initializer. static void InitInterface_Impl(); + SAL_DLLPRIVATE SfxInPlaceClientList* GetIPClientList_Impl( bool bCreate = true ) const; + public: SfxViewShell( SfxViewFrame *pFrame, sal_uInt16 nFlags = 0 ); @@ -284,10 +284,8 @@ public: SAL_DLLPRIVATE void RemoveContextMenuInterceptor_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::ui::XContextMenuInterceptor >& xInterceptor ); SAL_DLLPRIVATE bool GlobalKeyInput_Impl( const KeyEvent &rKeyEvent ); - SAL_DLLPRIVATE void NewIPClient_Impl( SfxInPlaceClient *pIPClient ) - { GetIPClientList_Impl(true)->push_back(pIPClient); } + SAL_DLLPRIVATE void NewIPClient_Impl( SfxInPlaceClient *pIPClient ); SAL_DLLPRIVATE void IPClientGone_Impl( SfxInPlaceClient *pIPClient ); - SAL_DLLPRIVATE SfxInPlaceClientList* GetIPClientList_Impl( bool bCreate = true ) const; SAL_DLLPRIVATE void ResetAllClients_Impl( SfxInPlaceClient *pIP ); SAL_DLLPRIVATE void DiscardClients_Impl(); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index be8f9fa3400c..1cd95a9c32ab 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -82,6 +82,8 @@ #include "openuriexternally.hxx" #include <shellimpl.hxx> +#include <vector> + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; @@ -277,6 +279,23 @@ static OUString RetrieveLabelFromCommand( return aLabel; } +class SfxInPlaceClientList +{ + typedef std::vector<SfxInPlaceClient*> DataType; + DataType maData; + +public: + typedef DataType::iterator iterator; + + SfxInPlaceClient* at( size_t i ) { return maData.at(i); } + + iterator begin() { return maData.begin(); } + iterator end() { return maData.end(); } + + void push_back( SfxInPlaceClient* p ) { maData.push_back(p); } + void erase( iterator it ) { maData.erase(it); } + size_t size() const { return maData.size(); } +}; SfxViewShell_Impl::SfxViewShell_Impl(sal_uInt16 const nFlags) : aInterceptorContainer( aMutex ) @@ -410,7 +429,10 @@ OUString impl_searchFormatTypeForApp(const css::uno::Reference< css::frame::XFra return OUString(); } - +void SfxViewShell::NewIPClient_Impl( SfxInPlaceClient *pIPClient ) +{ + GetIPClientList_Impl(true)->push_back(pIPClient); +} void SfxViewShell::IPClientGone_Impl( SfxInPlaceClient *pIPClient ) { |