diff options
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 7 | ||||
-rw-r--r-- | cui/source/inc/SpellDialog.hxx | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 4c72cf25acdf..439499f76f8d 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -182,6 +182,7 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, , bModified(false) , bFocusLocked(true) , rParent(*pChildWindow) + , pImpl( new SpellDialog_Impl ) { m_sTitleSpellingGrammar = GetText(); m_sTitleSpelling = get<FixedText>("alttitleft")->GetText(); @@ -224,7 +225,6 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, get(m_pToolbar, "toolbar"); m_pSentenceED->Init(m_pToolbar); xSpell = LinguMgr::GetSpellChecker(); - pImpl = new SpellDialog_Impl; const StyleSettings& rSettings = GetSettings().GetStyleSettings(); Color aCol = rSettings.GetHelpColor(); @@ -251,15 +251,14 @@ SpellDialog::~SpellDialog() void SpellDialog::dispose() { - if (pImpl) + if (pImpl.get()) { // save possibly modified user-dictionaries Reference< XSearchableDictionaryList > xDicList( SvxGetDictionaryList() ); if (xDicList.is()) SaveDictionaries( xDicList ); - delete pImpl; - pImpl = nullptr; + pImpl.reset(); } m_pLanguageFT.clear(); m_pLanguageLB.clear(); diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 595035d497d4..b166dd134a5f 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -175,7 +175,7 @@ private: svx::SpellDialogChildWindow& rParent; svx::SpellPortions m_aSavedSentence; - SpellDialog_Impl* pImpl; + std::unique_ptr<SpellDialog_Impl> pImpl; css::uno::Reference< css::linguistic2::XSpellChecker1 > xSpell; |