diff options
-rw-r--r-- | include/sfx2/viewsh.hxx | 7 | ||||
-rw-r--r-- | sfx2/source/view/viewimp.hxx | 6 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 44 |
3 files changed, 30 insertions, 27 deletions
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 77353f6a62cd..2894122b07c6 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -58,6 +58,7 @@ class SfxFrameItem; class Dialog; class Menu; class NotifyEvent; +class SfxInPlaceClient; #define SFX_PRINTER_PRINTER 1 // without JOB SETUP => Temporary #define SFX_PRINTER_JOBSETUP 2 @@ -120,9 +121,6 @@ public: \ #define SFX_VIEW_REGISTRATION(DocClass) \ DocClass::Factory().RegisterViewFactory( *Factory() ) -class SfxInPlaceClient; -class SfxInPlaceClientList; - class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener { #ifdef INCLUDED_SFX2_VIEWSH_HXX @@ -132,7 +130,6 @@ friend class SfxPrinterController; #endif struct SfxViewShell_Impl* pImp; - SfxInPlaceClientList* pIPClientList; SfxViewFrame* pFrame; SfxShell* pSubShell; vcl::Window* pWindow; @@ -167,8 +164,6 @@ private: /// SfxInterface initializer. static void InitInterface_Impl(); - SAL_DLLPRIVATE SfxInPlaceClientList* GetIPClientList_Impl( bool bCreate = true ) const; - public: SfxViewShell( SfxViewFrame *pFrame, sal_uInt16 nFlags = 0 ); diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx index 7ce2473e8655..c07fbc67f782 100644 --- a/sfx2/source/view/viewimp.hxx +++ b/sfx2/source/view/viewimp.hxx @@ -38,6 +38,7 @@ typedef SfxShell* SfxShellPtr_Impl; typedef std::vector<SfxShellPtr_Impl> SfxShellArr_Impl; class SfxClipboardChangeListener; +class SfxInPlaceClientList; struct SfxViewShell_Impl { @@ -62,7 +63,12 @@ struct SfxViewShell_Impl ::rtl::Reference< SfxClipboardChangeListener > xClipboardListener; ::boost::shared_ptr< vcl::PrinterController > m_pPrinterController; + mutable SfxInPlaceClientList* mpIPClientList; + SfxViewShell_Impl(sal_uInt16 const nFlags); + ~SfxViewShell_Impl(); + + SfxInPlaceClientList* GetIPClientList_Impl( bool bCreate = true ) const; }; #endif diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 1cd95a9c32ab..deed34f7a843 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -310,8 +310,21 @@ SfxViewShell_Impl::SfxViewShell_Impl(sal_uInt16 const nFlags) , m_bGotFrameOwnership(false) , m_nFamily(0xFFFF) // undefined, default set by TemplateDialog , m_pController(0) +, mpIPClientList(NULL) {} +SfxViewShell_Impl::~SfxViewShell_Impl() +{ + DELETEZ(mpIPClientList); +} + +SfxInPlaceClientList* SfxViewShell_Impl::GetIPClientList_Impl( bool bCreate ) const +{ + if (!mpIPClientList && bCreate) + mpIPClientList = new SfxInPlaceClientList; + return mpIPClientList; +} + SFX_IMPL_SUPERCLASS_INTERFACE(SfxViewShell,SfxShell) void SfxViewShell::InitInterface_Impl() @@ -431,12 +444,12 @@ OUString impl_searchFormatTypeForApp(const css::uno::Reference< css::frame::XFra void SfxViewShell::NewIPClient_Impl( SfxInPlaceClient *pIPClient ) { - GetIPClientList_Impl(true)->push_back(pIPClient); + pImp->GetIPClientList_Impl(true)->push_back(pIPClient); } void SfxViewShell::IPClientGone_Impl( SfxInPlaceClient *pIPClient ) { - SfxInPlaceClientList* pClientList = GetIPClientList_Impl(true); + SfxInPlaceClientList* pClientList = pImp->GetIPClientList_Impl(true); for( SfxInPlaceClientList::iterator it = pClientList->begin(); it != pClientList->end(); ++it ) { @@ -775,7 +788,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) VisAreaChanged(aVisArea); // the plugins might need change in their state - SfxInPlaceClientList *pClients = pView->GetIPClientList_Impl(false); + SfxInPlaceClientList *pClients = pView->pImp->GetIPClientList_Impl(false); if ( pClients ) { for ( size_t n = 0; n < pClients->size(); n++) @@ -955,7 +968,7 @@ SfxInPlaceClient* SfxViewShell::FindIPClient vcl::Window* pObjParentWin ) const { - SfxInPlaceClientList *pClients = GetIPClientList_Impl(false); + SfxInPlaceClientList *pClients = pImp->GetIPClientList_Impl(false); if ( !pClients ) return 0; @@ -983,7 +996,7 @@ SfxInPlaceClient* SfxViewShell::GetIPClient() const SfxInPlaceClient* SfxViewShell::GetUIActiveIPClient_Impl() const { // this method is needed as long as SFX still manages the border space for ChildWindows (see SfxFrame::Resize) - SfxInPlaceClientList *pClients = GetIPClientList_Impl(false); + SfxInPlaceClientList *pClients = pImp->GetIPClientList_Impl(false); if ( !pClients ) return 0; @@ -999,7 +1012,7 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveIPClient_Impl() const SfxInPlaceClient* SfxViewShell::GetUIActiveClient() const { - SfxInPlaceClientList *pClients = GetIPClientList_Impl(false); + SfxInPlaceClientList *pClients = pImp->GetIPClientList_Impl(false); if ( !pClients ) return 0; @@ -1256,7 +1269,6 @@ SfxViewShell::SfxViewShell : SfxShell(this) , pImp( new SfxViewShell_Impl(nFlags) ) -, pIPClientList( 0 ) , pFrame(pViewFrame) , pSubShell(0) , pWindow(0) @@ -1302,7 +1314,6 @@ SfxViewShell::~SfxViewShell() } DELETEZ( pImp ); - DELETEZ( pIPClientList ); } void SfxViewShell::Initialize() @@ -1714,7 +1725,7 @@ void SfxViewShell::GotFocus() const void SfxViewShell::ResetAllClients_Impl( SfxInPlaceClient *pIP ) { - SfxInPlaceClientList *pClients = GetIPClientList_Impl(false); + SfxInPlaceClientList *pClients = pImp->GetIPClientList_Impl(false); if ( !pClients ) return; @@ -1730,7 +1741,7 @@ void SfxViewShell::ResetAllClients_Impl( SfxInPlaceClient *pIP ) void SfxViewShell::DisconnectAllClients() { - SfxInPlaceClientList *pClients = GetIPClientList_Impl(false); + SfxInPlaceClientList *pClients = pImp->GetIPClientList_Impl(false); if ( !pClients ) return; @@ -1749,7 +1760,7 @@ void SfxViewShell::QueryObjAreaPixel( Rectangle& ) const void SfxViewShell::VisAreaChanged(const Rectangle& /*rVisArea*/) { - SfxInPlaceClientList *pClients = GetIPClientList_Impl(false); + SfxInPlaceClientList *pClients = pImp->GetIPClientList_Impl(false); if ( !pClients ) return; @@ -1811,7 +1822,7 @@ void SfxViewShell::DiscardClients_Impl() */ { - SfxInPlaceClientList *pClients = GetIPClientList_Impl(false); + SfxInPlaceClientList *pClients = pImp->GetIPClientList_Impl(false); if ( !pClients ) return; @@ -1904,15 +1915,6 @@ void SfxViewShell::JumpToMark( const OUString& rMark ) &aMarkItem, 0L ); } - - -SfxInPlaceClientList* SfxViewShell::GetIPClientList_Impl( bool bCreate ) const -{ - if ( !pIPClientList && bCreate ) - ( (SfxViewShell*) this )->pIPClientList = new SfxInPlaceClientList; - return pIPClientList; -} - void SfxViewShell::SetController( SfxBaseController* pController ) { pImp->m_pController = pController; |