From 5ae4cc92bd6660ccf36ff6cc45f96fa267514f1b Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 6 Dec 2014 13:32:29 -0500 Subject: Forward-declare SfxInPlaceClientList and remove include. Change-Id: I4e611820a4dae4341f971a545578048b52d7e37c --- include/sfx2/viewsh.hxx | 10 ++++------ 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 #include #include -#include 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 +#include + 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 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 ) { -- cgit