[Libreoffice-commits] core.git: cui/source
Xisco Fauli
anistenis at gmail.com
Thu May 26 07:31:17 UTC 2016
cui/source/dialogs/SpellDialog.cxx | 7 +++----
cui/source/inc/SpellDialog.hxx | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
New commits:
commit a59fc8cbd013ace88f0a462bf807e178a95cffd8
Author: Xisco Fauli <anistenis at gmail.com>
Date: Mon May 23 01:59:45 2016 +0200
tdf#89329: use unique_ptr for pImpl in SpellDialog
Change-Id: Ic4231e2c20ec89c59b0bedd32cac6363b830442c
Reviewed-on: https://gerrit.libreoffice.org/25329
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 4c72cf2..439499f 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 595035d..b166dd1 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;
More information about the Libreoffice-commits
mailing list