summaryrefslogtreecommitdiffstats
path: root/sfx2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-12-06 13:50:20 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-12-06 14:41:26 -0500
commitaafcbb3e1e70642983152f79843b2f0cd15eb79c (patch)
tree2156c68adfc95890ca76390e91f300d63f4a6732 /sfx2
parentForward-declare SfxInPlaceClientList and remove <vector> include. (diff)
downloadcore-aafcbb3e1e70642983152f79843b2f0cd15eb79c.tar.gz
core-aafcbb3e1e70642983152f79843b2f0cd15eb79c.zip
Move SfxInPlaceClientList to SfxViewShell_Impl.
Change-Id: I38c8dfa8198037268dabc0039f44e75e150b380b
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewimp.hxx6
-rw-r--r--sfx2/source/view/viewsh.cxx44
2 files changed, 29 insertions, 21 deletions
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;