summaryrefslogtreecommitdiff
path: root/editeng/source/misc/unolingu.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-11 12:53:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-13 13:08:52 +0000
commitcd8fdb46fd9a215532688585f3466d36b1daa1ac (patch)
tree8e25067a0e72ce5afe9c490f9eef567821f594c7 /editeng/source/misc/unolingu.cxx
parente6d7d737522124350a17a3cfdee055f03200a274 (diff)
new loplugin: useuniqueptr: editeng
Change-Id: I6df65eab882780d996ee996b5fef8020186b6d98 Reviewed-on: https://gerrit.libreoffice.org/32958 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/misc/unolingu.cxx')
-rw-r--r--editeng/source/misc/unolingu.cxx17
1 files changed, 5 insertions, 12 deletions
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx
index e8af80883467..c0a446b4b8fb 100644
--- a/editeng/source/misc/unolingu.cxx
+++ b/editeng/source/misc/unolingu.cxx
@@ -75,16 +75,15 @@ static uno::Reference< XLinguServiceManager2 > GetLngSvcMgr_Impl()
class ThesDummy_Impl :
public cppu::WeakImplHelper< XThesaurus >
{
- uno::Reference< XThesaurus > xThes; // the real one...
- Sequence< lang::Locale > *pLocaleSeq;
+ uno::Reference< XThesaurus > xThes; // the real one...
+ std::unique_ptr<Sequence< lang::Locale >> pLocaleSeq;
void GetCfgLocales();
void GetThes_Impl();
public:
- ThesDummy_Impl() : pLocaleSeq(nullptr) {}
- virtual ~ThesDummy_Impl() override;
+ ThesDummy_Impl() {}
// XSupportedLocales
virtual css::uno::Sequence< css::lang::Locale > SAL_CALL
@@ -105,12 +104,6 @@ public:
};
-ThesDummy_Impl::~ThesDummy_Impl()
-{
- delete pLocaleSeq;
-}
-
-
void ThesDummy_Impl::GetCfgLocales()
{
if (!pLocaleSeq)
@@ -120,7 +113,7 @@ void ThesDummy_Impl::GetCfgLocales()
Sequence < OUString > aNodeNames( aCfg.GetNodeNames( aNode ) );
const OUString *pNodeNames = aNodeNames.getConstArray();
sal_Int32 nLen = aNodeNames.getLength();
- pLocaleSeq = new Sequence< lang::Locale >( nLen );
+ pLocaleSeq.reset( new Sequence< lang::Locale >( nLen ) );
lang::Locale *pLocale = pLocaleSeq->getArray();
for (sal_Int32 i = 0; i < nLen; ++i)
{
@@ -140,7 +133,7 @@ void ThesDummy_Impl::GetThes_Impl()
if (xThes.is())
{
// no longer needed...
- delete pLocaleSeq; pLocaleSeq = nullptr;
+ pLocaleSeq.reset();
}
}
}