diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-14 07:49:22 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-14 07:49:22 +0100 |
commit | 0baadcea83272588f5a4d1d3a003986afe211a23 (patch) | |
tree | b313ea5447daf300dcb52f593b4bbb334b1c72f0 /sw/source/uibase | |
parent | 26fced1cd40e8c4631df16451711af893460a1cf (diff) |
Re-work app side-bar code to manage objects correctly.
Change-Id: Ie0eb8fe41a9fd4f996f724c47d20d6edecba3672
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/sidebar/PagePropertyPanel.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PagePropertyPanel.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/SwPanelFactory.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/WrapPropertyPanel.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/WrapPropertyPanel.hxx | 2 |
5 files changed, 20 insertions, 16 deletions
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.cxx b/sw/source/uibase/sidebar/PagePropertyPanel.cxx index c04874d2193e..53fd3afaef70 100644 --- a/sw/source/uibase/sidebar/PagePropertyPanel.cxx +++ b/sw/source/uibase/sidebar/PagePropertyPanel.cxx @@ -83,7 +83,7 @@ namespace { namespace sw { namespace sidebar { -PagePropertyPanel* PagePropertyPanel::Create ( +VclPtr<vcl::Window> PagePropertyPanel::Create ( vcl::Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, SfxBindings* pBindings) @@ -95,10 +95,12 @@ PagePropertyPanel* PagePropertyPanel::Create ( if (pBindings == NULL) throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", NULL, 2); - return new PagePropertyPanel( - pParent, - rxFrame, - pBindings); + return VclPtr<vcl::Window>( + new PagePropertyPanel( + pParent, + rxFrame, + pBindings), + SAL_NO_ACQUIRE); } PagePropertyPanel::PagePropertyPanel( diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.hxx b/sw/source/uibase/sidebar/PagePropertyPanel.hxx index f9dd2c09190b..d97d27a6dc00 100644 --- a/sw/source/uibase/sidebar/PagePropertyPanel.hxx +++ b/sw/source/uibase/sidebar/PagePropertyPanel.hxx @@ -55,7 +55,7 @@ namespace sw { namespace sidebar { public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface { public: - static PagePropertyPanel* Create( + static VclPtr<vcl::Window> Create( vcl::Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, SfxBindings* pBindings ); diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx index cc7984077b0d..361978b8559c 100644 --- a/sw/source/uibase/sidebar/SwPanelFactory.cxx +++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx @@ -119,7 +119,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( if (rsResourceURL.endsWith("/PagePropertyPanel")) { - sw::sidebar::PagePropertyPanel* pPanel = sw::sidebar::PagePropertyPanel::Create( pParentWindow, xFrame, pBindings ); + VclPtr<vcl::Window> pPanel = sw::sidebar::PagePropertyPanel::Create( pParentWindow, xFrame, pBindings ); xElement = sfx2::sidebar::SidebarPanelBase::Create( rsResourceURL, xFrame, @@ -128,7 +128,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( } else if (rsResourceURL.endsWith("/WrapPropertyPanel")) { - sw::sidebar::WrapPropertyPanel* pPanel = sw::sidebar::WrapPropertyPanel::Create( pParentWindow, xFrame, pBindings ); + VclPtr<vcl::Window> pPanel = sw::sidebar::WrapPropertyPanel::Create( pParentWindow, xFrame, pBindings ); xElement = sfx2::sidebar::SidebarPanelBase::Create( rsResourceURL, xFrame, @@ -137,7 +137,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( } else if (rsResourceURL.endsWith("/NavigatorPanel")) { - vcl::Window* pPanel = new SwNavigationPI(pBindings, NULL, pParentWindow); + VclPtr<vcl::Window> pPanel( new SwNavigationPI(pBindings, NULL, pParentWindow), SAL_NO_ACQUIRE ); xElement = sfx2::sidebar::SidebarPanelBase::Create( rsResourceURL, xFrame, @@ -146,7 +146,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( } else if (rsResourceURL.endsWith("/ManageChangesPanel")) { - vcl::Window* pPanel = new SwRedlineAcceptPanel(pParentWindow, xFrame); + VclPtr<vcl::Window> pPanel( new SwRedlineAcceptPanel(pParentWindow, xFrame), SAL_NO_ACQUIRE ); xElement = sfx2::sidebar::SidebarPanelBase::Create( rsResourceURL, xFrame, diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx index 71c873f7a1d4..39f68c344c8b 100644 --- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx +++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx @@ -42,7 +42,7 @@ const char UNO_WRAPIDEAL[] = ".uno:WrapIdeal"; namespace sw { namespace sidebar { -WrapPropertyPanel* WrapPropertyPanel::Create ( +VclPtr<vcl::Window> WrapPropertyPanel::Create ( vcl::Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame, SfxBindings* pBindings) @@ -54,10 +54,12 @@ WrapPropertyPanel* WrapPropertyPanel::Create ( if (pBindings == NULL) throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to WrapPropertyPanel::Create", NULL, 2); - return new WrapPropertyPanel( - pParent, - rxFrame, - pBindings); + return VclPtr<vcl::Window>( + new WrapPropertyPanel( + pParent, + rxFrame, + pBindings), + SAL_NO_ACQUIRE); } WrapPropertyPanel::WrapPropertyPanel( diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx index c64b1331587b..4c0291bc7114 100644 --- a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx +++ b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx @@ -35,7 +35,7 @@ namespace sw { namespace sidebar { , public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface { public: - static WrapPropertyPanel* Create( + static VclPtr<vcl::Window> Create( vcl::Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, SfxBindings* pBindings ); |