diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-20 18:27:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-21 08:50:50 +0200 |
commit | f9b5657c4cff29f4a0cd65d2789e091f1297a152 (patch) | |
tree | 67834601764bf4ee737d599415722490f1f97966 | |
parent | f292f808a1ced65db45141772dbd6e45c5d151ea (diff) |
loplugin:referencecasting in writerfilter..xmlhelp
Change-Id: I84954e35f285d968e3a83591c476b3c814c2a13f
Reviewed-on: https://gerrit.libreoffice.org/76033
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 13 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/ModelEventListener.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/OLEHandler.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdispatchflag.cxx | 3 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 8 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 6 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 2 |
8 files changed, 16 insertions, 22 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 62eab11b16cc..f566f6d4aa4a 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -416,7 +416,7 @@ void DomainMapper_Impl::RemoveLastParagraph( ) xCursor->gotoEnd(false); } else - xCursor.set(m_aTextAppendStack.top().xCursor, uno::UNO_QUERY); + xCursor = m_aTextAppendStack.top().xCursor; uno::Reference<container::XEnumerationAccess> xEnumerationAccess(xCursor, uno::UNO_QUERY); // Keep the character properties of the last but one paragraph, even if // it's empty. This works for headers/footers, and maybe in other cases @@ -1498,8 +1498,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con else xCur->gotoEnd( false ); xCur->goLeft( 1 , true ); - uno::Reference< text::XTextRange > xParaEnd( xCur, uno::UNO_QUERY ); - CheckParaMarkerRedline( xParaEnd ); + CheckParaMarkerRedline( xCur ); } // tdf#118521 set paragraph top or bottom margin based on the paragraph style @@ -5200,7 +5199,7 @@ void DomainMapper_Impl::PopFieldContext() { xToInsert.set(pContext->GetTC(), uno::UNO_QUERY); if( !xToInsert.is() && !m_bStartTOC && !m_bStartIndex && !m_bStartBibliography ) - xToInsert.set( pContext->GetTextField(), uno::UNO_QUERY); + xToInsert = pContext->GetTextField(); if( xToInsert.is() && !m_bStartTOC && !m_bStartIndex && !m_bStartBibliography) { PropertyMap aMap; @@ -5230,8 +5229,7 @@ void DomainMapper_Impl::PopFieldContext() } else { - uno::Reference<text::XTextRange> xTxtRange(xCrsr, uno::UNO_QUERY); - pFormControlHelper->insertControl(xTxtRange); + pFormControlHelper->insertControl(xCrsr); } } else if (!pContext->GetHyperlinkURL().isEmpty() && xCrsr.is()) @@ -5911,9 +5909,8 @@ void DomainMapper_Impl::ApplySettingsTable() } uno::Reference<container::XIndexContainer> xBox = document::IndexedPropertyValues::create(m_xComponentContext); xBox->insertByIndex(sal_Int32(0), uno::makeAny(comphelper::containerToSequence(aViewProps))); - uno::Reference<container::XIndexAccess> xIndexAccess(xBox, uno::UNO_QUERY); uno::Reference<document::XViewDataSupplier> xViewDataSupplier(m_xTextDocument, uno::UNO_QUERY); - xViewDataSupplier->setViewData(xIndexAccess); + xViewDataSupplier->setViewData(xBox); } uno::Reference< beans::XPropertySet > xSettings(m_xTextFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 185c143af47b..40317732273b 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -225,7 +225,7 @@ struct TextAppendContext : xTextAppend(xAppend) { xCursor.set(xCur, css::uno::UNO_QUERY); - xInsertPosition.set(xCursor, css::uno::UNO_QUERY); + xInsertPosition = xCursor; } }; diff --git a/writerfilter/source/dmapper/ModelEventListener.cxx b/writerfilter/source/dmapper/ModelEventListener.cxx index bc2286d69dea..3b3c36c9597e 100644 --- a/writerfilter/source/dmapper/ModelEventListener.cxx +++ b/writerfilter/source/dmapper/ModelEventListener.cxx @@ -61,7 +61,7 @@ void ModelEventListener::notifyEvent( const document::EventObject& rEvent ) // If we have PAGEREF fields, update fields as well. uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(rEvent.Source, uno::UNO_QUERY); - uno::Reference<container::XEnumeration> xEnumeration(xTextFieldsSupplier->getTextFields()->createEnumeration(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xEnumeration = xTextFieldsSupplier->getTextFields()->createEnumeration(); sal_Int32 nIndex = 0; while(xEnumeration->hasMoreElements()) { diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index c59e041b28a4..123475515522 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -211,7 +211,7 @@ void OLEHandler::importStream(const uno::Reference<uno::XComponentContext>& xCom // Set target document. uno::Reference<document::XImporter> xImporter(xInterface, uno::UNO_QUERY); uno::Reference<document::XEmbeddedObjectSupplier> xSupplier(xOLE, uno::UNO_QUERY); - uno::Reference<lang::XComponent> xEmbeddedObject(xSupplier->getEmbeddedObject(), uno::UNO_QUERY); + uno::Reference<lang::XComponent> xEmbeddedObject = xSupplier->getEmbeddedObject(); if (!xEmbeddedObject.is()) return; xImporter->setTargetDocument( xEmbeddedObject ); diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx b/writerfilter/source/rtftok/rtfdispatchflag.cxx index ce0eeec9d5d2..32de52c40b32 100644 --- a/writerfilter/source/rtftok/rtfdispatchflag.cxx +++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx @@ -1015,8 +1015,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) m_aStates.top().getDrawingObject().setPropertySet(xPropertySet); if (xDrawSupplier.is()) { - uno::Reference<drawing::XShapes> xShapes(xDrawSupplier->getDrawPage(), - uno::UNO_QUERY); + uno::Reference<drawing::XShapes> xShapes = xDrawSupplier->getDrawPage(); if (xShapes.is() && nKeyword != RTF_DPTXBX) { // set default VertOrient before inserting diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index b829c8aa9fd2..a022b6c67de3 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -320,8 +320,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier( m_xDstDoc, uno::UNO_QUERY); if (xDocumentPropertiesSupplier.is()) - m_xDocumentProperties.set(xDocumentPropertiesSupplier->getDocumentProperties(), - uno::UNO_QUERY); + m_xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties(); m_pGraphicHelper.reset(new oox::GraphicHelper(m_xContext, xFrame, oox::StorageRef())); @@ -958,7 +957,7 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS uno::Reference<drawing::XDrawPageSupplier> const xDrawSupplier(m_xDstDoc, uno::UNO_QUERY); if (xDrawSupplier.is()) { - uno::Reference<drawing::XShapes> xShapes(xDrawSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference<drawing::XShapes> xShapes = xDrawSupplier->getDrawPage(); if (xShapes.is()) xShapes->add(xShape); } @@ -3119,8 +3118,7 @@ RTFError RTFDocumentImpl::popState() uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier( m_xDstDoc, uno::UNO_QUERY); if (xDocumentPropertiesSupplier.is()) - m_xDocumentProperties.set(xDocumentPropertiesSupplier->getDocumentProperties(), - uno::UNO_QUERY); + m_xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties(); if (m_xDocumentProperties.is()) { diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 04aba4c5991e..20f8b51fd861 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -109,7 +109,7 @@ OUString Databases::expandURL( const OUString& aURL, const Reference< uno::XComp Reference< uri::XUriReference > uriRef; for (;;) { - uriRef.set( xFac->parse( aRetURL ), UNO_QUERY ); + uriRef = xFac->parse( aRetURL ); if ( uriRef.is() ) { Reference < uri::XVndSunStarExpandUrl > sxUri( uriRef, UNO_QUERY ); @@ -140,7 +140,7 @@ Databases::Databases( bool showBasic, vendVersion( "%VENDORVERSION" ), vendShort( "%VENDORSHORT" ) { - m_xSMgr.set( m_xContext->getServiceManager(), UNO_QUERY ); + m_xSMgr = m_xContext->getServiceManager(); m_vAdd[0] = 12; m_vAdd[1] = 15; @@ -1600,7 +1600,7 @@ Reference< XHierarchicalNameAccess > JarFileIterator::implGetJarFromPackage aArg.Value <<= OUString(ZIP_STORAGE_FORMAT_STRING); aArguments[ 1 ] <<= aArg; - Reference< XMultiComponentFactory >xSMgr( m_xContext->getServiceManager(), UNO_QUERY ); + Reference< XMultiComponentFactory >xSMgr = m_xContext->getServiceManager(); Reference< XInterface > xIfc = xSMgr->createInstanceWithArgumentsAndContext( "com.sun.star.packages.comp.ZipPackage", diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 72f28fef63c8..9dac255a8320 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -1113,7 +1113,7 @@ OUString TreeFileIterator::expandURL( const OUString& aURL ) Reference< uri::XUriReference > uriRef; for (;;) { - uriRef.set( xFac->parse( aRetURL ), UNO_QUERY ); + uriRef = xFac->parse( aRetURL ); if ( uriRef.is() ) { Reference < uri::XVndSunStarExpandUrl > sxUri( uriRef, UNO_QUERY ); |