[Libreoffice-commits] core.git: cui/source sc/source
Caolán McNamara
caolanm at redhat.com
Mon Oct 2 13:38:44 UTC 2017
cui/source/inc/autocdlg.hxx | 30 +++++++++++++++---------------
cui/source/inc/optlingu.hxx | 4 ++--
cui/source/options/fontsubs.cxx | 12 +++++-------
cui/source/options/fontsubs.hxx | 2 +-
cui/source/options/optfltr.cxx | 14 ++++++--------
cui/source/options/optfltr.hxx | 2 +-
cui/source/options/optlingu.cxx | 16 +++++++---------
cui/source/tabpages/autocdlg.cxx | 28 ++++++++++++----------------
sc/source/ui/inc/solveroptions.hxx | 2 +-
sc/source/ui/miscdlgs/solveroptions.cxx | 17 ++++++++---------
10 files changed, 58 insertions(+), 69 deletions(-)
New commits:
commit e1f87cb067a058f34caaf61d86c79958eebfd0e4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 2 10:18:22 2017 +0100
consistently apply std::unique_ptr to SvLBoxButtonData
Change-Id: I307c9095aa562348ce1b9338203995d9d62eebb4
Reviewed-on: https://gerrit.libreoffice.org/43037
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index 372e0b99aa8c..14915f691c2f 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/cui/source/inc/autocdlg.hxx
@@ -158,25 +158,25 @@ class OfaSwAutoFmtOptionsPage : public SfxTabPage
vcl::Font aByInputBulletFont;
sal_uInt16 nPercent;
- SvLBoxButtonData* pCheckButtonData;
+ std::unique_ptr<SvLBoxButtonData> m_xCheckButtonData;
- DECL_LINK(SelectHdl, SvTreeListBox*, void);
- DECL_LINK(EditHdl, Button*, void);
- DECL_LINK(DoubleClickEditHdl, SvTreeListBox*, bool);
- SvTreeListEntry* CreateEntry(OUString& rTxt, sal_uInt16 nCol);
+ DECL_LINK(SelectHdl, SvTreeListBox*, void);
+ DECL_LINK(EditHdl, Button*, void);
+ DECL_LINK(DoubleClickEditHdl, SvTreeListBox*, bool);
+ SvTreeListEntry* CreateEntry(OUString& rTxt, sal_uInt16 nCol);
- OfaSwAutoFmtOptionsPage( vcl::Window* pParent,
- const SfxItemSet& rSet );
- virtual ~OfaSwAutoFmtOptionsPage() override;
- virtual void dispose() override;
+ OfaSwAutoFmtOptionsPage( vcl::Window* pParent,
+ const SfxItemSet& rSet );
+ virtual ~OfaSwAutoFmtOptionsPage() override;
+ virtual void dispose() override;
public:
- static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet);
- virtual bool FillItemSet( SfxItemSet* rSet ) override;
- virtual void Reset( const SfxItemSet* rSet ) override;
- virtual void ActivatePage( const SfxItemSet& ) override;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet);
+ virtual bool FillItemSet( SfxItemSet* rSet ) override;
+ virtual void Reset( const SfxItemSet* rSet ) override;
+ virtual void ActivatePage( const SfxItemSet& ) override;
};
// class AutoCorrEdit ----------------------------------------------------
@@ -365,7 +365,7 @@ private:
OUString sNonBrkSpace;
OUString sOrdinal;
- SvLBoxButtonData* pCheckButtonData;
+ std::unique_ptr<SvLBoxButtonData> m_xCheckButtonData;
VclPtr<CheckBox> m_pSingleTypoCB;
VclPtr<PushButton> m_pSglStartQuotePB;
diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index 66017664c93b..477006de3bc8 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -70,7 +70,7 @@ class SvxEditModulesDlg : public ModalDialog
SvxLinguData_Impl* pDefaultLinguData;
SvxLinguData_Impl& rLinguData;
- std::unique_ptr<SvLBoxButtonData> pCheckButtonData;
+ std::unique_ptr<SvLBoxButtonData> m_xCheckButtonData;
SvTreeListEntry* CreateEntry(OUString& rTxt, sal_uInt16 nCol);
@@ -127,7 +127,7 @@ private:
css::uno::Reference<
css::linguistic2::XDictionary > > aDics;
- std::unique_ptr<SvLBoxButtonData> pCheckButtonData;
+ std::unique_ptr<SvLBoxButtonData> m_xCheckButtonData;
SvxLinguData_Impl* pLinguData;
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();
diff --git a/cui/source/options/fontsubs.hxx b/cui/source/options/fontsubs.hxx
index 22ba5caa861b..e016bf880188 100644
--- a/cui/source/options/fontsubs.hxx
+++ b/cui/source/options/fontsubs.hxx
@@ -79,7 +79,7 @@ class SvxFontSubstTabPage : public SfxTabPage
Color aTextColor;
- SvLBoxButtonData* pCheckButtonData;
+ std::unique_ptr<SvLBoxButtonData> m_xCheckButtonData;
DECL_LINK(SelectEditHdl, Edit&, void);
DECL_LINK(SelectComboBoxHdl, ComboBox&, void);
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index cd39dcac4e54..067cb331cebd 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -149,8 +149,7 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet
sChgToFromWriter(CuiResId(RID_SVXSTR_CHG_WRITER)),
sChgToFromCalc(CuiResId(RID_SVXSTR_CHG_CALC)),
sChgToFromImpress(CuiResId(RID_SVXSTR_CHG_IMPRESS)),
- sChgToFromSmartArt(CuiResId(RID_SVXSTR_CHG_SMARTART)),
- pCheckButtonData(nullptr)
+ sChgToFromSmartArt(CuiResId(RID_SVXSTR_CHG_SMARTART))
{
get(m_pCheckLBContainer, "checklbcontainer");
@@ -181,8 +180,7 @@ OfaMSFilterTabPage2::~OfaMSFilterTabPage2()
void OfaMSFilterTabPage2::dispose()
{
- delete pCheckButtonData;
- pCheckButtonData = nullptr;
+ m_xCheckButtonData.reset();
m_pCheckLB.disposeAndClear();
m_pCheckLBContainer.clear();
aHighlightingRB.clear();
@@ -334,18 +332,18 @@ void OfaMSFilterTabPage2::InsertEntry( const OUString& _rTxt, sal_IntPtr _nType,
{
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));
pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(
SvLBoxButtonKind::EnabledCheckbox,
- pCheckButtonData));
+ m_xCheckButtonData.get()));
pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(
saveEnabled ? SvLBoxButtonKind::EnabledCheckbox
: SvLBoxButtonKind::DisabledCheckbox,
- pCheckButtonData));
+ m_xCheckButtonData.get()));
pEntry->AddItem(o3tl::make_unique<SvLBoxString>(_rTxt));
pEntry->SetUserData( reinterpret_cast<void*>(_nType) );
diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx
index 4e28a04ad883..4ef6cf3a63c0 100644
--- a/cui/source/options/optfltr.hxx
+++ b/cui/source/options/optfltr.hxx
@@ -82,7 +82,7 @@ class OfaMSFilterTabPage2 : public SfxTabPage
sChgToFromCalc,
sChgToFromImpress,
sChgToFromSmartArt;
- SvLBoxButtonData* pCheckButtonData;
+ std::unique_ptr<SvLBoxButtonData> m_xCheckButtonData;
VclPtr<RadioButton> aHighlightingRB;
VclPtr<RadioButton> aShadingRB;
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index efde456a95b6..6a7ddc081831 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1715,11 +1715,11 @@ SvTreeListEntry* SvxLinguTabPage::CreateEntry( OUString& rTxt, sal_uInt16 nCol )
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
- if( !pCheckButtonData )
- pCheckButtonData.reset(new SvLBoxButtonData(m_pLinguOptionsCLB));
+ if (!m_xCheckButtonData)
+ m_xCheckButtonData.reset(new SvLBoxButtonData(m_pLinguOptionsCLB));
if (CBCOL_FIRST == nCol)
- pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, pCheckButtonData.get()));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, m_xCheckButtonData.get()));
if (CBCOL_SECOND == nCol)
pEntry->AddItem(o3tl::make_unique<SvLBoxString>("")); // empty column
pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(Image(), Image(), false));
@@ -1766,8 +1766,6 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD
get(m_pLanguageLB, "language");
m_pLanguageLB->SetStyle(m_pLanguageLB->GetStyle() | WB_SORT);
- pCheckButtonData = nullptr;
-
pDefaultLinguData = new SvxLinguData_Impl( rLinguData );
m_pModulesCLB->SetStyle( m_pModulesCLB->GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL );
@@ -1837,14 +1835,14 @@ void SvxEditModulesDlg::dispose()
SvTreeListEntry* SvxEditModulesDlg::CreateEntry( OUString& rTxt, sal_uInt16 nCol )
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
- if( !pCheckButtonData )
+ if (!m_xCheckButtonData )
{
- pCheckButtonData.reset(new SvLBoxButtonData(m_pModulesCLB));
- pCheckButtonData->SetLink( LINK( this, SvxEditModulesDlg, BoxCheckButtonHdl_Impl2 ) );
+ m_xCheckButtonData.reset(new SvLBoxButtonData(m_pModulesCLB));
+ m_xCheckButtonData->SetLink( LINK( this, SvxEditModulesDlg, BoxCheckButtonHdl_Impl2 ) );
}
if (CBCOL_FIRST == nCol)
- pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, pCheckButtonData.get()));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, m_xCheckButtonData.get()));
if (CBCOL_SECOND == nCol)
pEntry->AddItem(o3tl::make_unique<SvLBoxString>("")); // empty column
pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(Image(), Image(), false));
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 8477210c98a3..65edb0fc84f2 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -432,7 +432,6 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( vcl::Window* pParent,
, sDelSpaceAtSttEnd(CuiResId(RID_SVXSTR_DEL_SPACES_AT_STT_END))
, sDelSpaceBetweenLines(CuiResId(RID_SVXSTR_DEL_SPACES_BETWEEN_LINES))
, nPercent(50)
- , pCheckButtonData(nullptr)
{
get(m_pEditPB, "edit");
@@ -468,10 +467,10 @@ SvTreeListEntry* OfaSwAutoFmtOptionsPage::CreateEntry(OUString& rTxt, sal_uInt16
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
- if ( !pCheckButtonData )
+ if (!m_xCheckButtonData)
{
- pCheckButtonData = new SvLBoxButtonData( m_pCheckLB );
- m_pCheckLB->SetCheckButtonData( pCheckButtonData );
+ m_xCheckButtonData.reset(new SvLBoxButtonData(m_pCheckLB));
+ m_pCheckLB->SetCheckButtonData(m_xCheckButtonData.get());
}
pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(Image(), Image(), false));
@@ -479,12 +478,12 @@ SvTreeListEntry* OfaSwAutoFmtOptionsPage::CreateEntry(OUString& rTxt, sal_uInt16
if (nCol == CBCOL_SECOND)
pEntry->AddItem(o3tl::make_unique<SvLBoxString>(""));
else
- pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, pCheckButtonData));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, m_xCheckButtonData.get()));
if (nCol == CBCOL_FIRST)
pEntry->AddItem(o3tl::make_unique<SvLBoxString>(""));
else
- 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<OfaImpBrwString>(rTxt));
return pEntry;
@@ -502,8 +501,7 @@ void OfaSwAutoFmtOptionsPage::dispose()
delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( REPLACE_BULLETS ));
delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( APPLY_NUMBERING ));
delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( MERGE_SINGLE_LINE_PARA ));
- delete pCheckButtonData;
- pCheckButtonData = nullptr;
+ m_xCheckButtonData.reset();
}
m_pCheckLB.disposeAndClear();
m_pEditPB.clear();
@@ -1787,10 +1785,10 @@ SvTreeListEntry* OfaQuoteTabPage::CreateEntry(OUString& rTxt, sal_uInt16 nCol)
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
- if ( !pCheckButtonData )
+ if (!m_xCheckButtonData)
{
- pCheckButtonData = new SvLBoxButtonData(m_pSwCheckLB);
- m_pSwCheckLB->SetCheckButtonData(pCheckButtonData);
+ m_xCheckButtonData.reset(new SvLBoxButtonData(m_pSwCheckLB));
+ m_pSwCheckLB->SetCheckButtonData(m_xCheckButtonData.get());
}
pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(Image(), Image(), false));
@@ -1798,12 +1796,12 @@ SvTreeListEntry* OfaQuoteTabPage::CreateEntry(OUString& rTxt, sal_uInt16 nCol)
if (nCol == CBCOL_SECOND)
pEntry->AddItem(o3tl::make_unique<SvLBoxString>(""));
else
- pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, pCheckButtonData));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, m_xCheckButtonData.get()));
if (nCol == CBCOL_FIRST)
pEntry->AddItem(o3tl::make_unique<SvLBoxString>(""));
else
- 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<OfaImpBrwString>(rTxt));
@@ -1814,7 +1812,6 @@ OfaQuoteTabPage::OfaQuoteTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent, "ApplyLocalizedPage", "cui/ui/applylocalizedpage.ui", &rSet)
, sNonBrkSpace(CuiResId(RID_SVXSTR_NON_BREAK_SPACE))
, sOrdinal(CuiResId(RID_SVXSTR_ORDINAL))
- , pCheckButtonData(nullptr)
, cSglStartQuote(0)
, cSglEndQuote(0)
, cStartQuote(0)
@@ -1886,8 +1883,7 @@ OfaQuoteTabPage::~OfaQuoteTabPage()
void OfaQuoteTabPage::dispose()
{
- delete pCheckButtonData;
- pCheckButtonData = nullptr;
+ m_xCheckButtonData.reset();
m_pSwCheckLB.disposeAndClear();
m_pCheckLB.disposeAndClear();
m_pSingleTypoCB.clear();
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));
}
More information about the Libreoffice-commits
mailing list