summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/inc/toolbox.h4
-rw-r--r--vcl/source/window/toolbox2.cxx4
2 files changed, 4 insertions, 4 deletions
diff --git a/vcl/inc/toolbox.h b/vcl/inc/toolbox.h
index 18f94aeb5f5e..f908cc5bdf52 100644
--- a/vcl/inc/toolbox.h
+++ b/vcl/inc/toolbox.h
@@ -111,13 +111,13 @@ struct ToolBoxLayoutData : public ControlLayoutData
struct ImplToolBoxPrivateData
{
- vcl::ToolBoxLayoutData* m_pLayoutData;
+ std::unique_ptr<vcl::ToolBoxLayoutData> m_pLayoutData;
ToolBox::ImplToolItems m_aItems;
ImplToolBoxPrivateData();
~ImplToolBoxPrivateData();
- void ImplClearLayoutData() { delete m_pLayoutData; m_pLayoutData = nullptr; }
+ void ImplClearLayoutData() { m_pLayoutData.reset(); }
// called when dropdown items are clicked
Link<ToolBox *, void> maDropdownClickHdl;
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 43142586d970..23d5971518d2 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -70,7 +70,7 @@ ImplToolBoxPrivateData::ImplToolBoxPrivateData() :
ImplToolBoxPrivateData::~ImplToolBoxPrivateData()
{
- delete m_pLayoutData;
+ m_pLayoutData.reset();
mpMenu.disposeAndClear();
}
@@ -1457,7 +1457,7 @@ void ToolBox::ImplUpdateInputEnable()
void ToolBox::ImplFillLayoutData()
{
- mpData->m_pLayoutData = new ToolBoxLayoutData;
+ mpData->m_pLayoutData.reset(new ToolBoxLayoutData);
ImplToolItems::size_type nCount = mpData->m_aItems.size();
for( ImplToolItems::size_type i = 0; i < nCount; i++ )