summaryrefslogtreecommitdiff
path: root/svx/source/sidebar/insert
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/sidebar/insert')
-rw-r--r--svx/source/sidebar/insert/InsertPropertyPanel.cxx15
-rw-r--r--svx/source/sidebar/insert/InsertPropertyPanel.hxx5
2 files changed, 13 insertions, 7 deletions
diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.cxx b/svx/source/sidebar/insert/InsertPropertyPanel.cxx
index cbf133f32eca..590759bd7568 100644
--- a/svx/source/sidebar/insert/InsertPropertyPanel.cxx
+++ b/svx/source/sidebar/insert/InsertPropertyPanel.cxx
@@ -72,16 +72,21 @@ InsertPropertyPanel::InsertPropertyPanel (
pTopWindow->AddChildEventListener(LINK(this, InsertPropertyPanel, WindowEventListener));
}
-
-
-
InsertPropertyPanel::~InsertPropertyPanel()
{
+ disposeOnce();
+}
+
+void InsertPropertyPanel::dispose()
+{
// Remove window child listener.
vcl::Window* pTopWindow = this;
while (pTopWindow->GetParent() != NULL)
pTopWindow = pTopWindow->GetParent();
pTopWindow->RemoveChildEventListener(LINK(this, InsertPropertyPanel, WindowEventListener));
+ mpStandardShapesToolBox.clear();
+ mpCustomShapesToolBox.clear();
+ PanelLayout::dispose();
}
@@ -118,13 +123,13 @@ IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent)
if (nId == 0)
return 1;
- SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox);
+ SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox.get());
if (pSidebarToolBox == NULL)
return 1;
sal_uInt16 nItemId (pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path));
if (nItemId == 0)
{
- pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox);
+ pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox.get());
if (pSidebarToolBox == NULL)
return 1;
nItemId = pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path);
diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.hxx b/svx/source/sidebar/insert/InsertPropertyPanel.hxx
index bef58fd1919c..2539695313bf 100644
--- a/svx/source/sidebar/insert/InsertPropertyPanel.hxx
+++ b/svx/source/sidebar/insert/InsertPropertyPanel.hxx
@@ -42,10 +42,11 @@ public:
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
virtual ~InsertPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
private:
- ToolBox* mpStandardShapesToolBox;
- ToolBox* mpCustomShapesToolBox;
+ VclPtr<ToolBox> mpStandardShapesToolBox;
+ VclPtr<ToolBox> mpCustomShapesToolBox;
const css::uno::Reference<css::frame::XFrame> mxFrame;
DECL_LINK(WindowEventListener, VclSimpleEvent*);