diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-11 15:40:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-12 09:56:01 +0200 |
commit | 389da66dfc96d06c407bff156c4ea21e940c5e06 (patch) | |
tree | 2d1ebce6bdb2d952700ed5aaeb808289e9f72a7d /linguistic | |
parent | a651dbcfca9e198b5c2561076961504586bc6bea (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/convdic.cxx | 14 |
1 files changed, 3 insertions, 11 deletions
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<document::XFilter *>(pImport), UNO_QUERY ); + rtl::Reference<ConvDicXMLImport> 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<document::XFilter *>(pImport), UNO_QUERY ); + rtl::Reference<ConvDicXMLImport> 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<document::XFilter *>(pExport) ); + rtl::Reference<ConvDicXMLExport> 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) |