/include/connectivity/

ue='distro/mimo/mimo-6-2'>distro/mimo/mimo-6-2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-11 10:23:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-15 10:03:52 +0200
commit9b9f60dd3adafe2364cb9f8122b430f729f0ad1c (patch)
treee33ee102318bcaaf1da61579e98b2936ef75a06a /linguistic
parent17838c9c4279ab3e7932d4f383a8b1696491e622 (diff)
loplugin:useuniqueptr in LngSvcMgr
Change-Id: I3c8046a70ffce402d52caf2e7b77fa9951103f99 Reviewed-on: https://gerrit.libreoffice.org/59011 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/lngsvcmgr.cxx51
-rw-r--r--linguistic/source/lngsvcmgr.hxx10
2 files changed, 24 insertions, 37 deletions
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 83668cc06dfa..d106bf586934 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -417,11 +417,6 @@ LngSvcMgr::LngSvcMgr()
{
bDisposing = false;
- pAvailSpellSvcs = nullptr;
- pAvailGrammarSvcs = nullptr;
- pAvailHyphSvcs = nullptr;
- pAvailThesSvcs = nullptr;
-
// request notify events when properties (i.e. something in the subtree) changes
uno::Sequence< OUString > aNames(4);
OUString *pNames = aNames.getArray();
@@ -464,10 +459,10 @@ void LngSvcMgr::modified(const lang::EventObject&)
//assume that if an extension has been added/removed that
//it might be a dictionary extension, so drop our cache
- clearSvcInfoArray(pAvailSpellSvcs);
- clearSvcInfoArray(pAvailGrammarSvcs);
- clearSvcInfoArray(pAvailHyphSvcs);
- clearSvcInfoArray(pAvailThesSvcs);
+ pAvailSpellSvcs.reset();
+ pAvailGrammarSvcs.reset();
+ pAvailHyphSvcs.reset();
+ pAvailThesSvcs.reset();
}
{
@@ -521,12 +516,6 @@ void LngSvcMgr::disposing(const lang::EventObject&)
stopListening();
}
-void LngSvcMgr::clearSvcInfoArray(SvcInfoArray* &rpInfo)
-{
- delete rpInfo;
- rpInfo = nullptr;
-}
-
LngSvcMgr::~LngSvcMgr()
{
stopListening();
@@ -535,10 +524,10 @@ LngSvcMgr::~LngSvcMgr()
// will be freed in the destructor of the respective Reference's
// xSpellDsp, xGrammarDsp, xHyphDsp, xThesDsp
- clearSvcInfoArray(pAvailSpellSvcs);
- clearSvcInfoArray(pAvailGrammarSvcs);
- clearSvcInfoArray(pAvailHyphSvcs);
- clearSvcInfoArray(pAvailThesSvcs);
+ pAvailSpellSvcs.reset();
+ pAvailGrammarSvcs.reset();
+ pAvailHyphSvcs.reset();
+ pAvailThesSvcs.reset();
}
namespace
@@ -801,7 +790,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &