summaryrefslogtreecommitdiff
path: root/linguistic/source
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-02-10 20:33:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-23 12:11:31 +0100
commitc13133b613fda3255fab60c03012aff93a5f2f02 (patch)
treeb07846fbcb4bac7c3a24f0570f60b1b6e759fd8f /linguistic/source
parentc181e510c5f5e74f1f6824b64637849aace9ae63 (diff)
loplugin:refcounting check for managing OWeakObject with raw pointer
Change-Id: I7471725f1e658940b5e6993361c327be6ccf0d31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111064 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic/source')
-rw-r--r--linguistic/source/spelldta.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx
index 7ae3d3d7f42d..b3f57e9b870f 100644
--- a/linguistic/source/spelldta.cxx
+++ b/linguistic/source/spelldta.cxx
@@ -28,6 +28,7 @@
#include <linguistic/misc.hxx>
#include <linguistic/spelldta.hxx>
+#include <rtl/ref.hxx>
using namespace osl;
@@ -255,11 +256,11 @@ void SpellAlternatives::SetAlternatives( const Sequence< OUString > &rAlt )
css::uno::Reference < css::linguistic2::XSpellAlternatives > SpellAlternatives::CreateSpellAlternatives(
const OUString &rWord, LanguageType nLang, sal_Int16 nTypeP, const css::uno::Sequence< OUString > &rAlt )
{
- SpellAlternatives* pAlt = new SpellAlternatives;
+ rtl::Reference<SpellAlternatives> pAlt = new SpellAlternatives;
pAlt->SetWordLanguage( rWord, nLang );
pAlt->SetFailureType( nTypeP );
pAlt->SetAlternatives( rAlt );
- return Reference < XSpellAlternatives >(pAlt);
+ return pAlt;
}