Kaydet (Commit) 7042d52b authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SvxLinguTabPage

Change-Id: I98e683bd23e854507c37e4d88a42a4c249bf5c44
Reviewed-on: https://gerrit.libreoffice.org/56195
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c253fc8e
...@@ -129,7 +129,7 @@ private: ...@@ -129,7 +129,7 @@ private:
std::unique_ptr<SvLBoxButtonData> m_xCheckButtonData; std::unique_ptr<SvLBoxButtonData> m_xCheckButtonData;
SvxLinguData_Impl* pLinguData; std::unique_ptr<SvxLinguData_Impl> pLinguData;
SvxLinguTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet ); SvxLinguTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet );
SvTreeListEntry* CreateEntry(OUString& rTxt, sal_uInt16 nCol); SvTreeListEntry* CreateEntry(OUString& rTxt, sal_uInt16 nCol);
......
...@@ -1029,8 +1029,7 @@ SvxLinguTabPage::~SvxLinguTabPage() ...@@ -1029,8 +1029,7 @@ SvxLinguTabPage::~SvxLinguTabPage()
void SvxLinguTabPage::dispose() void SvxLinguTabPage::dispose()
{ {
delete pLinguData; pLinguData.reset();
pLinguData = nullptr;
m_pLinguModulesFT.clear(); m_pLinguModulesFT.clear();
m_pLinguModulesCLB.clear(); m_pLinguModulesCLB.clear();
m_pLinguModulesEditPB.clear(); m_pLinguModulesEditPB.clear();
...@@ -1060,7 +1059,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet ) ...@@ -1060,7 +1059,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
{ {
DBG_ASSERT( pLinguData, "pLinguData not yet initialized" ); DBG_ASSERT( pLinguData, "pLinguData not yet initialized" );
if (!pLinguData) if (!pLinguData)
pLinguData = new SvxLinguData_Impl; pLinguData.reset( new SvxLinguData_Impl );
// update spellchecker configuration entries // update spellchecker configuration entries
const LangImplNameTable *pTable = &pLinguData->GetSpellTable(); const LangImplNameTable *pTable = &pLinguData->GetSpellTable();
...@@ -1299,7 +1298,7 @@ void SvxLinguTabPage::Reset( const SfxItemSet* rSet ) ...@@ -1299,7 +1298,7 @@ void SvxLinguTabPage::Reset( const SfxItemSet* rSet )
if (m_pLinguModulesCLB->IsVisible()) if (m_pLinguModulesCLB->IsVisible())
{ {
if (!pLinguData) if (!pLinguData)
pLinguData = new SvxLinguData_Impl; pLinguData.reset( new SvxLinguData_Impl );
UpdateModulesBox_Impl(); UpdateModulesBox_Impl();
} }
...@@ -1459,7 +1458,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void ) ...@@ -1459,7 +1458,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void )
if (m_pLinguModulesEditPB == pBtn) if (m_pLinguModulesEditPB == pBtn)
{ {
if (!pLinguData) if (!pLinguData)
pLinguData = new SvxLinguData_Impl; pLinguData.reset( new SvxLinguData_Impl );
SvxLinguData_Impl aOldLinguData( *pLinguData ); SvxLinguData_Impl aOldLinguData( *pLinguData );
ScopedVclPtrInstance< SvxEditModulesDlg > aDlg( this, *pLinguData ); ScopedVclPtrInstance< SvxEditModulesDlg > aDlg( this, *pLinguData );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment