summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-05-23 01:59:45 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-26 07:30:48 +0000
commita59fc8cbd013ace88f0a462bf807e178a95cffd8 (patch)
tree55d6be289f1eee68ee167447679cc29473350266 /cui
parent039c1043ca5d650a38a35c51988512e62a1591d2 (diff)
tdf#89329: use unique_ptr for pImpl in SpellDialog
Change-Id: Ic4231e2c20ec89c59b0bedd32cac6363b830442c Reviewed-on: https://gerrit.libreoffice.org/25329 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/SpellDialog.cxx7
-rw-r--r--cui/source/inc/SpellDialog.hxx2
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;