diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-02 10:36:43 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2013-05-22 10:44:29 +0000 |
commit | 6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 (patch) | |
tree | 2746468845d6f1159e3759ee2cf7a620fca15b6e /cui | |
parent | 697a007c61b9cabceb9767fad87cd5822b300452 (diff) |
Use the new type-checking Reference constructor to reduce code noise
Also create a Clang compiler plugin to detect such cases.
Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752
Reviewed-on: https://gerrit.libreoffice.org/4001
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/hangulhanjadlg.cxx | 7 | ||||
-rw-r--r-- | cui/source/options/optdict.cxx | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index edbd7c2782dc..ffa32ff7ace6 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -937,10 +937,9 @@ namespace svx m_aDictsLB.Clear(); Reference< XNameContainer > xNameCont = m_xConversionDictionaryList->getDictionaryContainer(); - Reference< XNameAccess > xNameAccess = Reference< XNameAccess >( xNameCont, UNO_QUERY ); - if( xNameAccess.is() ) + if( xNameCont.is() ) { - Sequence< OUString > aDictNames( xNameAccess->getElementNames() ); + Sequence< OUString > aDictNames( xNameCont->getElementNames() ); const OUString* pDic = aDictNames.getConstArray(); sal_Int32 nCount = aDictNames.getLength(); @@ -948,7 +947,7 @@ namespace svx sal_Int32 i; for( i = 0 ; i < nCount ; ++i ) { - Any aAny( xNameAccess->getByName( pDic[ i ] ) ); + Any aAny( xNameCont->getByName( pDic[ i ] ) ); Reference< XConversionDictionary > xDic; if( ( aAny >>= xDic ) && xDic.is() ) { diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index eab99e44fe66..8572341db884 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -613,8 +613,7 @@ IMPL_LINK(SvxEditDictionaryDialog, NewDelHdl, PushButton*, pBtn) // if remove has failed the following add should fail too // and thus a warning message should be triggered... - Reference<XDictionary> aXDictionary(xDic, UNO_QUERY); - nAddRes = linguistic::AddEntryToDic( aXDictionary, + nAddRes = linguistic::AddEntryToDic( xDic, aNewWord, bIsNegEntry, aRplcText, LanguageTag( xDic->getLocale() ).getLanguageType(), sal_False ); } |