diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-10-02 10:18:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-10-02 15:38:19 +0200 |
commit | e1f87cb067a058f34caaf61d86c79958eebfd0e4 (patch) | |
tree | 18a251ff654e8797be765d42c25ed1bb6d91f167 /sc/source/ui | |
parent | ed01e23aeb08addc9ac7d74014483b5af57b15d9 (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 'sc/source/ui')
-rw-r--r-- | sc/source/ui/inc/solveroptions.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/solveroptions.cxx | 17 |
2 files changed, 9 insertions, 10 deletions
diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx index ac0102a63a92..f160ff5e9b6b 100644 --- a/sc/source/ui/inc/solveroptions.hxx +++ b/sc/source/ui/inc/solveroptions.hxx @@ -39,7 +39,7 @@ class ScSolverOptionsDialog : public ModalDialog VclPtr<SvxCheckListBox> m_pLbSettings; VclPtr<PushButton> m_pBtnEdit; - SvLBoxButtonData* mpCheckButtonData; + std::unique_ptr<SvLBoxButtonData> m_xCheckButtonData; css::uno::Sequence<OUString> maImplNames; css::uno::Sequence<OUString> maDescriptions; OUString maEngine; diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index ad3661c4dffc..b762761c51b4 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -115,7 +115,6 @@ ScSolverOptionsDialog::ScSolverOptionsDialog( vcl::Window* pParent, const uno::Sequence<beans::PropertyValue>& rProperties ) : ModalDialog(pParent, "SolverOptionsDialog", "modules/scalc/ui/solveroptionsdialog.ui") - , mpCheckButtonData(nullptr) , maImplNames(rImplNames) , maDescriptions(rDescriptions) , maEngine(rEngine) @@ -172,7 +171,7 @@ ScSolverOptionsDialog::~ScSolverOptionsDialog() void ScSolverOptionsDialog::dispose() { - delete mpCheckButtonData; + m_xCheckButtonData.reset(); m_pLbEngine.clear(); m_pLbSettings.clear(); m_pBtnEdit.clear(); @@ -252,8 +251,8 @@ void ScSolverOptionsDialog::FillListBox() m_pLbSettings->SetUpdateMode(false); m_pLbSettings->Clear(); - if (!mpCheckButtonData) - mpCheckButtonData = new SvLBoxButtonData(m_pLbSettings); + if (!m_xCheckButtonData) + m_xCheckButtonData.reset(new SvLBoxButtonData(m_pLbSettings)); SvTreeList* pModel = m_pLbSettings->GetModel(); SvTreeListEntry* pEntry = nullptr; @@ -268,13 +267,13 @@ void ScSolverOptionsDialog::FillListBox() { // check box entry pEntry = new SvTreeListEntry; - std::unique_ptr<SvLBoxButton> pButton(new SvLBoxButton( - SvLBoxButtonKind::EnabledCheckbox, mpCheckButtonData)); + std::unique_ptr<SvLBoxButton> xButton(new SvLBoxButton( + SvLBoxButtonKind::EnabledCheckbox, m_xCheckButtonData.get())); if ( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ) - pButton->SetStateChecked(); + xButton->SetStateChecked(); else - pButton->SetStateUnchecked(); - pEntry->AddItem(std::move(pButton)); + xButton->SetStateUnchecked(); + pEntry->AddItem(std::move(xButton)); pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(Image(), Image(), false)); pEntry->AddItem(o3tl::make_unique<SvLBoxString>(aVisName)); } |