summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-20 15:48:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-21 08:27:25 +0200
commit7042d52b0789c8311f8f007862aa80dba54e72f1 (patch)
tree5f0bc69d8788f31eb281c0e2fa3edb5b960d6cc9 /cui
parentloplugin:useuniqueptr in SvxBackgroundTabPage (diff)
downloadcore-7042d52b0789c8311f8f007862aa80dba54e72f1.tar.gz
core-7042d52b0789c8311f8f007862aa80dba54e72f1.zip
loplugin:useuniqueptr in SvxLinguTabPage
Change-Id: I98e683bd23e854507c37e4d88a42a4c249bf5c44 Reviewed-on: https://gerrit.libreoffice.org/56195 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/optlingu.hxx2
-rw-r--r--cui/source/options/optlingu.cxx9
2 files changed, 5 insertions, 6 deletions
diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index 04ca33441cde..25a8d47646d2 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -129,7 +129,7 @@ private:
std::unique_ptr<SvLBoxButtonData> m_xCheckButtonData;
- SvxLinguData_Impl* pLinguData;
+ std::unique_ptr<SvxLinguData_Impl> pLinguData;
SvxLinguTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet );
SvTreeListEntry* CreateEntry(OUString& rTxt, sal_uInt16 nCol);
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 6ee8ea97aa67..fc02af9c258a 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1029,8 +1029,7 @@ SvxLinguTabPage::~SvxLinguTabPage()
void SvxLinguTabPage::dispose()
{
- delete pLinguData;
- pLinguData = nullptr;
+ pLinguData.reset();
m_pLinguModulesFT.clear();
m_pLinguModulesCLB.clear();
m_pLinguModulesEditPB.clear();
@@ -1060,7 +1059,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
DBG_ASSERT( pLinguData, "pLinguData not yet initialized" );
if (!pLinguData)
- pLinguData = new SvxLinguData_Impl;
+ pLinguData.reset( new SvxLinguData_Impl );
// update spellchecker configuration entries
const LangImplNameTable *pTable = &pLinguData->GetSpellTable();
@@ -1299,7 +1298,7 @@ void SvxLinguTabPage::Reset( const SfxItemSet* rSet )
if (m_pLinguModulesCLB->IsVisible())
{
if (!pLinguData)
- pLinguData = new SvxLinguData_Impl;
+ pLinguData.reset( new SvxLinguData_Impl );
UpdateModulesBox_Impl();
}
@@ -1459,7 +1458,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void )
if (m_pLinguModulesEditPB == pBtn)
{
if (!pLinguData)
- pLinguData = new SvxLinguData_Impl;
+ pLinguData.reset( new SvxLinguData_Impl );
SvxLinguData_Impl aOldLinguData( *pLinguData );
ScopedVclPtrInstance< SvxEditModulesDlg > aDlg( this, *pLinguData );