summaryrefslogtreecommitdiff
path: root/cui/source/options/fontsubs.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-10-02 10:18:22 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-10-02 15:38:19 +0200
commite1f87cb067a058f34caaf61d86c79958eebfd0e4 (patch)
tree18a251ff654e8797be765d42c25ed1bb6d91f167 /cui/source/options/fontsubs.cxx
parented01e23aeb08addc9ac7d74014483b5af57b15d9 (diff)
consistently apply std::unique_ptr to SvLBoxButtonData
Change-Id: I307c9095aa562348ce1b9338203995d9d62eebb4 Reviewed-on: https://gerrit.libreoffice.org/43037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/options/fontsubs.cxx')
-rw-r--r--cui/source/options/fontsubs.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index 79c0e9f32f8f..b1ef2241f17b 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -40,7 +40,6 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( vcl::Window* pParent,
const SfxItemSet& rSet )
: SfxTabPage(pParent, "OptFontsPage", "cui/ui/optfontspage.ui", &rSet)
, pConfig(new SvtFontSubstConfig)
- , pCheckButtonData(nullptr)
{
get(m_pUseTableCB, "usetable");
get(m_pReplacements, "replacements");
@@ -119,13 +118,13 @@ SvTreeListEntry* SvxFontSubstTabPage::CreateEntry(OUString& rFont1, OUString& rF
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
- if( !pCheckButtonData )
- pCheckButtonData = new SvLBoxButtonData( m_pCheckLB );
+ if (!m_xCheckButtonData)
+ m_xCheckButtonData.reset(new SvLBoxButtonData(m_pCheckLB));
pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(Image(), Image(), false)); // otherwise boom!
- pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, pCheckButtonData));
- pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, pCheckButtonData));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, m_xCheckButtonData.get()));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, m_xCheckButtonData.get()));
pEntry->AddItem(o3tl::make_unique<SvLBoxString>(rFont1));
pEntry->AddItem(o3tl::make_unique<SvLBoxString>(rFont2));
@@ -140,8 +139,7 @@ SvxFontSubstTabPage::~SvxFontSubstTabPage()
void SvxFontSubstTabPage::dispose()
{
- delete pCheckButtonData;
- pCheckButtonData = nullptr;
+ m_xCheckButtonData.reset();
delete pConfig;
pConfig = nullptr;
m_pCheckLB.disposeAndClear();