From 389da66dfc96d06c407bff156c4ea21e940c5e06 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 11 May 2017 15:40:42 +0200 Subject: remove unused uno::Reference vars found by temporarily marking Reference as SAL_WARN_UNUSED. Change-Id: I18809b62654467f890016adcc92576980ced393b Reviewed-on: https://gerrit.libreoffice.org/37511 Tested-by: Jenkins Reviewed-by: Noel Grandin --- linguistic/source/convdic.cxx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 6ce6d04ce0c4..e92ed0275f8d 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -142,10 +142,7 @@ bool IsConvDic( const OUString &rFileURL, LanguageType &nLang, sal_Int16 &nConvT // first argument being 0 should stop the file from being parsed // up to the end (reading all entries) when the required // data (language, conversion type) is found. - ConvDicXMLImport *pImport = new ConvDicXMLImport( nullptr ); - - //!! keep a first reference to ensure the lifetime of the object !! - uno::Reference< XInterface > xRef( static_cast(pImport), UNO_QUERY ); + rtl::Reference pImport = new ConvDicXMLImport( nullptr ); ReadThroughDic( rFileURL, *pImport ); // will implicitly add the entries bRes = !LinguIsUnspecified( pImport->GetLanguage()) && @@ -220,9 +217,7 @@ void ConvDic::Load() //!! prevent function from being called recursively via HasEntry, AddEntry bNeedEntries = false; - ConvDicXMLImport *pImport = new ConvDicXMLImport( this ); - //!! keep a first reference to ensure the lifetime of the object !! - uno::Reference< XInterface > xRef( static_cast(pImport), UNO_QUERY ); + rtl::Reference pImport = new ConvDicXMLImport( this ); ReadThroughDic( aMainURL, *pImport ); // will implicitly add the entries bIsModified = false; } @@ -263,10 +258,7 @@ void ConvDic::Save() // prepare arguments (prepend doc handler to given arguments) uno::Reference< xml::sax::XDocumentHandler > xDocHandler( xSaxWriter, UNO_QUERY ); - ConvDicXMLExport *pExport = new ConvDicXMLExport( *this, aMainURL, xDocHandler ); - //!! keep a first(!) reference until everything is done to - //!! ensure the proper lifetime of the object - uno::Reference< document::XFilter > aRef( static_cast(pExport) ); + rtl::Reference pExport = new ConvDicXMLExport( *this, aMainURL, xDocHandler ); bool bRet = pExport->Export(); // write entries to file DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" ); if (bRet) -- cgit