summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-26 09:58:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-26 13:17:51 +0200
commit62946de9671d718d4033cd2662107020e65368b3 (patch)
treee1ae778d14330c11e8cc507a3876924995f2a19e
parentd86889978d7caa4ac82eb4ede226c7f2561c8607 (diff)
fix leak in SvxLineTabDialog
Change-Id: I4cbf0990fcc8db63f1160f1997d425c5681c47c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116150 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--cui/source/inc/cuitabline.hxx3
-rw-r--r--cui/source/tabpages/tpline.cxx11
2 files changed, 7 insertions, 7 deletions
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index 1368425c87ff..db74b0f65970 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -19,6 +19,7 @@
#pragma once
+#include <memory>
#include <vector>
#include <editeng/brushitem.hxx>
#include <sfx2/tabdlg.hxx>
@@ -97,7 +98,7 @@ private:
Graphic m_aAutoSymbolGraphic;
tools::Long m_nSymbolType;
/// attributes for the shown symbols; only necessary if not equal to line properties
- SfxItemSet* m_pSymbolAttr;
+ std::unique_ptr<SfxItemSet> m_xSymbolAttr;
std::vector<OUString> m_aGrfNames;
std::vector< std::unique_ptr<SvxBmpItemInfo> >
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index ceab29aed666..e8b382fe9876 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -85,7 +85,6 @@ SvxLineTabPage::SvxLineTabPage(weld::Container* pPage, weld::DialogController* p
, m_pSymbolList(nullptr)
, m_bNewSize(false)
, m_nSymbolType(SVX_SYMBOLTYPE_UNKNOWN) // unknown respectively unchanged
- , m_pSymbolAttr(nullptr)
, m_bLastWidthModified(false)
, m_aSymbolLastSize(Size(0,0))
, m_bSymbols(false)
@@ -840,9 +839,9 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
// directly clone to target SdrModel
pObj = pObj->CloneSdrObject(*pModel);
- if(m_pSymbolAttr)
+ if(m_xSymbolAttr)
{
- pObj->SetMergedItemSet(*m_pSymbolAttr);
+ pObj->SetMergedItemSet(*m_xSymbolAttr);
}
else
{
@@ -1480,9 +1479,9 @@ IMPL_LINK_NOARG(SvxLineTabPage, MenuCreateHdl_Impl, weld::Toggleable&, void)
m_aGrfNames.emplace_back("");
pPage->NbcInsertObject(pObj);
- if(m_pSymbolAttr)
+ if(m_xSymbolAttr)
{
- pObj->SetMergedItemSet(*m_pSymbolAttr);
+ pObj->SetMergedItemSet(*m_xSymbolAttr);
}
else
{
@@ -1692,7 +1691,7 @@ void SvxLineTabPage::PageCreated(const SfxAllItemSet& aSet)
ShowSymbolControls(true);
m_pSymbolList = static_cast<SdrObjList*>(pSdrObjListItem->GetValue());
if (pSymbolAttrItem)
- m_pSymbolAttr = new SfxItemSet(pSymbolAttrItem->GetItemSet());
+ m_xSymbolAttr.reset(new SfxItemSet(pSymbolAttrItem->GetItemSet()));
if(pGraphicItem)
m_aAutoSymbolGraphic = pGraphicItem->GetGraphic();
}