From c13133b613fda3255fab60c03012aff93a5f2f02 Mon Sep 17 00:00:00 2001 From: Noel Date: Wed, 10 Feb 2021 20:33:16 +0200 Subject: 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 --- linguistic/source/spelldta.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'linguistic/source') 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 #include +#include 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 pAlt = new SpellAlternatives; pAlt->SetWordLanguage( rWord, nLang ); pAlt->SetFailureType( nTypeP ); pAlt->SetAlternatives( rAlt ); - return Reference < XSpellAlternatives >(pAlt); + return pAlt; } -- cgit