loplugin:referencecasting in editeng

Change-Id: I584266ba58e55e6435e76180227c0a5756aa0c23
Reviewed-on: https://gerrit.libreoffice.org/75950
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2019-07-19 14:04:30 +02:00
parent 9987bb6ee0
commit 0a4e138d3a
6 changed files with 16 additions and 22 deletions

View File

@@ -975,7 +975,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
sal_uInt16 nDicCount = static_cast<sal_uInt16>(aDics.getLength());
for (sal_uInt16 i = 0; i < nDicCount; i++)
{
uno::Reference< linguistic2::XDictionary > xDicTmp( pDic[i], uno::UNO_QUERY );
uno::Reference< linguistic2::XDictionary > xDicTmp = pDic[i];
if (!xDicTmp.is() || LinguMgr::GetIgnoreAllList() == xDicTmp)
continue;

View File

@@ -1438,7 +1438,7 @@ OUString ImpEditView::SpellIgnoreWord()
if ( !aWord.isEmpty() )
{
Reference< XDictionary > xDic( LinguMgr::GetIgnoreAllList(), UNO_QUERY );
Reference< XDictionary > xDic = LinguMgr::GetIgnoreAllList();
if (xDic.is())
xDic->add( aWord, false, OUString() );
EditDoc& rDoc = pEditEngine->GetEditDoc();
@@ -2325,8 +2325,7 @@ void ImpEditView::RemoveDragAndDropListeners()
if ( mxDnDListener.is() )
{
uno::Reference< lang::XEventListener> xEL( mxDnDListener, uno::UNO_QUERY );
xEL->disposing( lang::EventObject() ); // #95154# Empty Source means it's the Client
mxDnDListener->disposing( lang::EventObject() ); // #95154# Empty Source means it's the Client
mxDnDListener.clear();
}

View File

@@ -749,12 +749,11 @@ namespace editeng
// exactly which characters are really changed in order to keep as much
// from attributation for the text as possible.
Sequence< sal_Int32 > aOffsets;
Reference< XExtendedTextConversion > xExtConverter( m_xConverter, UNO_QUERY );
if (m_eConvType == HHC::eConvSimplifiedTraditional && xExtConverter.is())
if (m_eConvType == HHC::eConvSimplifiedTraditional && m_xConverter.is())
{
try
{
xExtConverter->getConversionWithOffset(
m_xConverter->getConversionWithOffset(
m_sCurrentPortion,
m_nCurrentStartIndex,
m_nCurrentEndIndex - m_nCurrentStartIndex,

View File

@@ -401,7 +401,7 @@ Reference< XDictionary > SvxSpellWrapper::GetAllRightDic()
sal_Int32 i = 0;
while (!xDic.is() && i < nCount)
{
Reference< XDictionary > xTmp( pDic[i], UNO_QUERY );
Reference< XDictionary > xTmp = pDic[i];
if (xTmp.is())
{
if ( xTmp->isActive() &&
@@ -457,8 +457,8 @@ bool SvxSpellWrapper::FindSpellError()
else
{
// look up in ChangeAllList for misspelled word
Reference< XDictionary > xChangeAllList(
LinguMgr::GetChangeAllList(), UNO_QUERY );
Reference< XDictionary > xChangeAllList =
LinguMgr::GetChangeAllList();
Reference< XDictionaryEntry > xEntry;
if (xChangeAllList.is())
xEntry = xChangeAllList->getEntry( xAlt->getWord() );

View File

@@ -2444,8 +2444,7 @@ bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
uno::Reference < io::XOutputStream> xOut = new utl::OOutputStreamWrapper( *refList );
xWriter->setOutputStream(xOut);
uno::Reference<xml::sax::XDocumentHandler> xHandler(xWriter, uno::UNO_QUERY);
rtl::Reference< SvXMLAutoCorrectExport > xExp( new SvXMLAutoCorrectExport( xContext, pAutocorr_List.get(), pXMLImplAutocorr_ListStr, xHandler ) );
rtl::Reference< SvXMLAutoCorrectExport > xExp( new SvXMLAutoCorrectExport( xContext, pAutocorr_List.get(), pXMLImplAutocorr_ListStr, xWriter ) );
xExp->exportDoc( XML_BLOCK_LIST );

View File

@@ -600,9 +600,8 @@ uno::Reference< XDictionary > LinguMgr::GetIgnoreAll()
if (xTmpDicList.is())
{
std::locale loc(Translate::Create("svt"));
xIgnoreAll.set( xTmpDicList->getDictionaryByName(
Translate::get(STR_DESCRIPTION_IGNOREALLLIST, loc) ),
UNO_QUERY );
xIgnoreAll = xTmpDicList->getDictionaryByName(
Translate::get(STR_DESCRIPTION_IGNOREALLLIST, loc) );
}
return xIgnoreAll;
}
@@ -615,14 +614,13 @@ uno::Reference< XDictionary > LinguMgr::GetChangeAll()
if (!pExitLstnr)
pExitLstnr = new LinguMgrExitLstnr;
uno::Reference< XSearchableDictionaryList > _xDicList( GetDictionaryList() , UNO_QUERY );
uno::Reference< XSearchableDictionaryList > _xDicList = GetDictionaryList();
if (_xDicList.is())
{
xChangeAll.set( _xDicList->createDictionary(
xChangeAll = _xDicList->createDictionary(
"ChangeAllList",
LanguageTag::convertToLocale( LANGUAGE_NONE ),
DictionaryType_NEGATIVE, OUString() ),
UNO_QUERY );
DictionaryType_NEGATIVE, OUString() );
}
return xChangeAll;
}
@@ -640,8 +638,7 @@ uno::Reference< XDictionary > LinguMgr::GetStandard()
return nullptr;
const OUString aDicName( "standard.dic" );
uno::Reference< XDictionary > xDic( xTmpDicList->getDictionaryByName( aDicName ),
UNO_QUERY );
uno::Reference< XDictionary > xDic = xTmpDicList->getDictionaryByName( aDicName );
if (!xDic.is())
{
// try to create standard dictionary
@@ -663,7 +660,7 @@ uno::Reference< XDictionary > LinguMgr::GetStandard()
xTmpDicList->addDictionary( xTmp );
xTmp->setActive( true );
}
xDic.set( xTmp, UNO_QUERY );
xDic = xTmp;
}
#if OSL_DEBUG_LEVEL > 1
uno::Reference< XStorable > xStor( xDic, UNO_QUERY );