summaryrefslogtreecommitdiff
path: root/lingucomponent
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-12 09:34:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-12 15:52:28 +0200
commit0088f365b1c1e3103b310ac3371bc5c918fe617e (patch)
tree60b6212265c46dd6a5681a71ac7b24cceebcca0a /lingucomponent
parentd65567230f283a6ed228755a3be85e95cde2d677 (diff)
loplugin:useuniqueptr in lingucomponent
Change-Id: I5d668718620114cb8b9d53375497a4d0b1759abb Reviewed-on: https://gerrit.libreoffice.org/39852 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.cxx6
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.hxx3
2 files changed, 4 insertions, 5 deletions
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index a3c9696fa142..97b5c48a1676 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -88,7 +88,6 @@ SpellChecker::~SpellChecker()
}
delete[] m_aDicts;
}
- delete[] m_aDEncs;
delete[] m_aDLocs;
delete[] m_aDNames;
if (m_pPropHelper)
@@ -200,7 +199,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
// add dictionary information
m_aDicts = new Hunspell* [m_nNumDict];
- m_aDEncs = new rtl_TextEncoding [m_nNumDict];
+ m_aDEncs.reset( new rtl_TextEncoding [m_nNumDict] );
m_aDLocs = new Locale [m_nNumDict];
m_aDNames = new OUString [m_nNumDict];
k = 0;
@@ -240,8 +239,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
m_nNumDict = 0;
delete[] m_aDicts;
m_aDicts = nullptr;
- delete[] m_aDEncs;
- m_aDEncs = nullptr;
+ m_aDEncs.reset();
delete[] m_aDLocs;
m_aDLocs = nullptr;
delete[] m_aDNames;
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.hxx b/lingucomponent/source/spellcheck/spell/sspellimp.hxx
index 63b13d19b11d..3a61900e8c15 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.hxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.hxx
@@ -34,6 +34,7 @@
#include <linguistic/lngprophelp.hxx>
#include <lingutil.hxx>
+#include <memory>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
@@ -55,7 +56,7 @@ class SpellChecker :
{
Sequence< Locale > m_aSuppLocales;
Hunspell ** m_aDicts;
- rtl_TextEncoding * m_aDEncs;
+ std::unique_ptr<rtl_TextEncoding[]> m_aDEncs;
Locale * m_aDLocs;
OUString * m_aDNames;
sal_Int32 m_nNumDict;