filter/source/config/cache/filtercache.cxx                  |    3 -
 filter/source/flash/swfexporter.cxx                         |    9 +--
 filter/source/flash/swffilter.cxx                           |    2 
 filter/source/graphicfilter/icgm/actimpr.cxx                |    4 -
 filter/source/msfilter/eschesdo.cxx                         |    6 +-
 filter/source/msfilter/msocximex.cxx                        |    4 -
 filter/source/msfilter/mstoolbar.cxx                        |    2 
 filter/source/storagefilterdetect/filterdetect.cxx          |    2 
 filter/source/svg/svgexport.cxx                             |    6 +-
 filter/source/svg/svgfilter.cxx                             |    6 +-
 filter/source/xsltfilter/OleHandler.cxx                     |    2 
 filter/source/xsltfilter/XSLTFilter.cxx                     |   23 +++------
 forms/source/component/ComboBox.cxx                         |    9 +--
 forms/source/component/FormComponent.cxx                    |    4 -
 forms/source/component/RadioButton.cxx                      |    6 --
 forms/source/helper/commandimageprovider.cxx                |    2 
 forms/source/helper/controlfeatureinterception.cxx          |    5 --
 forms/source/runtime/formoperations.cxx                     |   28 ++++--------
 forms/source/xforms/binding.cxx                             |    8 +--
 forms/source/xforms/model.cxx                               |    2 
 forms/source/xforms/model_ui.cxx                            |    8 +--
 forms/source/xforms/submission.cxx                          |    2 
 forms/source/xforms/submission/serialization_app_xml.cxx    |    2 
 forms/source/xforms/submission/serialization_urlencoded.cxx |    2 
 fpicker/source/office/RemoteFilesDialog.cxx                 |   15 ++----
 fpicker/source/office/commonpicker.cxx                      |   14 ++----
 26 files changed, 72 insertions(+), 104 deletions(-)

New commits:
commit 6595240f39c34fa9ae5cd1bb319f6287206e4b92
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jul 19 15:32:58 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jul 19 18:29:34 2019 +0200

    loplugin:referencecasting in forms..fpicker
    
    Change-Id: I0aa040b6d3264d2efde5797f79994d3d65ceaddf
    Reviewed-on: https://gerrit.libreoffice.org/75957
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/forms/source/component/ComboBox.cxx 
b/forms/source/component/ComboBox.cxx
index 06f5f4234c0d..03d46288a6bf 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -474,10 +474,9 @@ void OComboBoxModel::loadData( bool _bForce )
         return;
 
     // Get Connection
-    Reference<XRowSet> xForm(m_xCursor, UNO_QUERY);
-    if (!xForm.is())
+    if (!m_xCursor.is())
         return;
-    Reference<XConnection> xConnection = getConnection(xForm);
+    Reference<XConnection> xConnection = getConnection(m_xCursor);
     if (!xConnection.is())
         return;
 
@@ -518,7 +517,7 @@ void OComboBoxModel::loadData( bool _bForce )
                 else
                 {
                     // otherwise look for the alias
-                    Reference<XPropertySet> xFormProp(xForm,UNO_QUERY);
+                    Reference<XPropertySet> xFormProp(m_xCursor,UNO_QUERY);
                     Reference< XColumnsSupplier > xSupplyFields;
                     xFormProp->getPropertyValue("SingleSelectQueryComposer") 
>>= xSupplyFields;
 
@@ -627,7 +626,7 @@ void OComboBoxModel::loadData( bool _bForce )
                 if ( !xDataField.is() )
                     return;
 
-                ::dbtools::FormattedColumnValue aValueFormatter( getContext(), 
xForm, xDataField );
+                ::dbtools::FormattedColumnValue aValueFormatter( getContext(), 
m_xCursor, xDataField );
 
                 // Fill Lists
                 sal_Int16 i = 0;
diff --git a/forms/source/component/FormComponent.cxx 
b/forms/source/component/FormComponent.cxx
index 6d46f3a9825e..eb4cbf3f9598 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -259,7 +259,7 @@ void OControl::impl_resetStateGuard_nothrow()
     try
     {
         xWindow.set( getPeer(), UNO_QUERY );
-        xModel.set( getModel(), UNO_QUERY );
+        xModel = getModel();
     }
     catch( const Exception& )
     {
@@ -1920,7 +1920,7 @@ void OBoundControlModel::connectToField(const 
Reference<XRowSet>& rForm)
             DBG_ASSERT(xColumnsSupplier.is(), 
"OBoundControlModel::connectToField : the row set should support the 
css::sdb::ResultSet service !");
             if (xColumnsSupplier.is())
             {
-                Reference<XNameAccess> 
xColumns(xColumnsSupplier->getColumns(), UNO_QUERY);
+                Reference<XNameAccess> xColumns = 
xColumnsSupplier->getColumns();
                 if (xColumns.is() && xColumns->hasByName(m_aControlSource))
                 {
                     OSL_VERIFY( xColumns->getByName(m_aControlSource) >>= 
xFieldCandidate );
diff --git a/forms/source/component/RadioButton.cxx 
b/forms/source/component/RadioButton.cxx
index 0fac875bb2a1..5505ee92ea85 100644
--- a/forms/source/component/RadioButton.cxx
+++ b/forms/source/component/RadioButton.cxx
@@ -126,8 +126,7 @@ void ORadioButtonModel::SetSiblingPropsTo(const OUString& 
rPropName, const Any&
     Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
     if (xIndexAccess.is())
     {
-        Reference<XPropertySet> xMyProps(
-            static_cast<XWeak*>(this), css::uno::UNO_QUERY);
+        Reference<XPropertySet> xMyProps = this;
         OUString sCurrentGroup;
         sal_Int32 nNumSiblings = xIndexAccess->getCount();
         for (sal_Int32 i=0; i<nNumSiblings; ++i)
@@ -203,8 +202,7 @@ void ORadioButtonModel::setControlSource()
             getPropertyValue(PROPERTY_GROUP_NAME) >>= sGroupName;
         getPropertyValue(PROPERTY_NAME) >>= sName;
 
-        Reference<XPropertySet> xMyProps(
-            static_cast<XWeak*>(this), css::uno::UNO_QUERY);
+        Reference<XPropertySet> xMyProps = this;
         for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
         {
             Reference<XPropertySet> 
xSiblingProperties(xIndexAccess->getByIndex(i), UNO_QUERY);
diff --git a/forms/source/helper/commandimageprovider.cxx 
b/forms/source/helper/commandimageprovider.cxx
index 570d58abe94d..a40783149416 100644
--- a/forms/source/helper/commandimageprovider.cxx
+++ b/forms/source/helper/commandimageprovider.cxx
@@ -82,7 +82,7 @@ namespace frm
         try
         {
             Reference< XUIConfigurationManagerSupplier > xSuppUIConfig( 
_rxDocument, UNO_QUERY_THROW );
-            Reference< XUIConfigurationManager > xUIConfig( 
xSuppUIConfig->getUIConfigurationManager(), UNO_QUERY );
+            Reference< XUIConfigurationManager > xUIConfig = 
xSuppUIConfig->getUIConfigurationManager();
             m_xDocumentImageManager.set( xUIConfig->getImageManager(), 
UNO_QUERY_THROW );
         }
         catch( const Exception& )
diff --git a/forms/source/helper/controlfeatureinterception.cxx 
b/forms/source/helper/controlfeatureinterception.cxx
index 5e79a5c65995..16fa4154935d 100644
--- a/forms/source/helper/controlfeatureinterception.cxx
+++ b/forms/source/helper/controlfeatureinterception.cxx
@@ -48,9 +48,8 @@ namespace frm
         if ( m_xFirstDispatchInterceptor.is() )
         {
             // there is already an interceptor; the new one will become its 
master
-            Reference< XDispatchProvider > xFirstProvider( 
m_xFirstDispatchInterceptor, UNO_QUERY );
-            _rxInterceptor->setSlaveDispatchProvider( xFirstProvider );
-            m_xFirstDispatchInterceptor->setMasterDispatchProvider( 
xFirstProvider );
+            _rxInterceptor->setSlaveDispatchProvider( 
m_xFirstDispatchInterceptor );
+            m_xFirstDispatchInterceptor->setMasterDispatchProvider( 
m_xFirstDispatchInterceptor );
         }
 
         // we are the master of the chain's first interceptor
diff --git a/forms/source/runtime/formoperations.cxx 
b/forms/source/runtime/formoperations.cxx
index adb5cf877f79..eb4133ee5493 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -259,8 +259,7 @@ namespace frm
             case FormFeature::ReloadForm:
             {
                 // there must be an active connection
-                Reference< XRowSet > xCursorRowSet( m_xCursor, UNO_QUERY );
-                aState.Enabled = ::dbtools::getConnection( xCursorRowSet 
).is();
+                aState.Enabled = ::dbtools::getConnection( m_xCursor ).is();
 
                 // and an active command
                 OUString sActiveCommand;
@@ -480,14 +479,12 @@ namespace frm
         {
             bool shouldCommit(true);
             assert(xCntrl.is());
-            Reference< XIndexAccess > xSubForms(xCntrl, UNO_QUERY);
-            assert(xSubForms.is());
-            if(xSubForms.is())
+            if(xCntrl.is())
             {
-                const sal_Int32 cnt = xSubForms->getCount();
+                const sal_Int32 cnt = xCntrl->getCount();
                 for(int i=0; i < cnt; ++i)
                 {
-                    Reference< XFormController > 
xSubForm(xSubForms->getByIndex(i), UNO_QUERY);
+                    Reference< XFormController > 
xSubForm(xCntrl->getByIndex(i), UNO_QUERY);
                     assert(xSubForm.is());
                     if (xSubForm.is())
                     {
@@ -1091,9 +1088,8 @@ namespace frm
                 m_xCursorProperties->removePropertyChangeListener( 
PROPERTY_ISNEW, this );
             }
 
-            Reference< XModifyBroadcaster > xBroadcaster( m_xController, 
UNO_QUERY );
-            if ( xBroadcaster.is() )
-                xBroadcaster->removeModifyListener( this );
+            if ( m_xController.is() )
+                m_xController->removeModifyListener( this );
         }
         catch( const Exception& )
         {
@@ -1127,9 +1123,8 @@ namespace frm
 
         impl_initFromForm_throw();
 
-        Reference< XModifyBroadcaster > xBroadcaster( m_xController, UNO_QUERY 
);
-        if ( xBroadcaster.is() )
-            xBroadcaster->addModifyListener( this );
+        if ( m_xController.is() )
+            m_xController->addModifyListener( this );
     }
 
 
@@ -1691,13 +1686,12 @@ namespace frm
             css::uno::Reference<css::awt::XWindow> xDialogParent;
 
             //tdf#122152 extract parent for dialog
-            css::uno::Reference<css::awt::XTabController> 
xTabController(m_xController, css::uno::UNO_QUERY);
-            if (xTabController.is())
+            if (m_xController.is())
             {
-                css::uno::Reference<css::awt::XControl> 
xContainerControl(xTabController->getContainer(), css::uno::UNO_QUERY);
+                css::uno::Reference<css::awt::XControl> 
xContainerControl(m_xController->getContainer(), css::uno::UNO_QUERY);
                 if (xContainerControl.is())
                 {
-                    css::uno::Reference<css::awt::XWindowPeer> 
xContainerPeer(xContainerControl->getPeer(), css::uno::UNO_QUERY);
+                    css::uno::Reference<css::awt::XWindowPeer> xContainerPeer 
= xContainerControl->getPeer();
                     xDialogParent = 
css::uno::Reference<css::awt::XWindow>(xContainerPeer, css::uno::UNO_QUERY);
                 }
             }
diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx
index b36d2bf074df..d2c1be56aa7b 100644
--- a/forms/source/xforms/binding.cxx
+++ b/forms/source/xforms/binding.cxx
@@ -543,10 +543,8 @@ void Binding::bind( bool bForceRebind )
                           aContext.mxNamespaces ) )
         {
             aContext.mxContextNode->appendChild(
-                Reference<XNode>(
                     aContext.mxContextNode->getOwnerDocument()->createElement(
-                        maBindingExpression.getExpression() ),
-                    UNO_QUERY ) );
+                        maBindingExpression.getExpression() ) );
             maBindingExpression.evaluate( aContext );
             OSL_ENSURE( maBindingExpression.getNode().is(),
                         "we should bind to the newly inserted node!" );
@@ -751,8 +749,8 @@ css::uno::Reference<css::xsd::XDataType> 
Binding::getDataType()
     OSL_ENSURE( getModel().is(), "need model" );
     OSL_ENSURE( getModel()->getDataTypeRepository().is(), "need types" );
 
-    Reference<XDataTypeRepository> xRepository(
-        getModel()->getDataTypeRepository(), UNO_QUERY );
+    Reference<XDataTypeRepository> xRepository =
+        getModel()->getDataTypeRepository();
     OUString sTypeName = maMIP.getTypeName();
 
     return ( xRepository.is() && xRepository->hasByName( sTypeName ) )
diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx
index 2bddfea5db30..0b5b4cbd245f 100644
--- a/forms/source/xforms/model.cxx
+++ b/forms/source/xforms/model.cxx
@@ -113,7 +113,7 @@ EvaluationContext Model::getEvaluationContext()
     // the default context is the top-level element node. A default
     // node (instanceData' is inserted when there is no default node
     Reference<XDocument> xInstance = getDefaultInstance();
-    Reference<XNode> xElement( xInstance->getDocumentElement(), UNO_QUERY );
+    Reference<XNode> xElement = xInstance->getDocumentElement();
 
     // no element found? Then insert default element 'instanceData'
     if( ! xElement.is() )
diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx
index e37dfa3d490b..b2ffffa2ec0c 100644
--- a/forms/source/xforms/model_ui.cxx
+++ b/forms/source/xforms/model_ui.cxx
@@ -550,8 +550,7 @@ css::uno::Reference<css::xml::dom::XNode> 
Model::createElement( const css::uno::
         && isValidXMLName( sName ) )
     {
         // TODO: implement proper namespace handling
-        xNode.set( xParent->getOwnerDocument()->createElement( sName ),
-                   UNO_QUERY );
+        xNode = xParent->getOwnerDocument()->createElement( sName );
     }
     return xNode;
 }
@@ -575,8 +574,7 @@ css::uno::Reference<css::xml::dom::XNode> 
Model::createAttribute( const css::uno
         }
 
         // TODO: implement proper namespace handling
-        xNode.set( xParent->getOwnerDocument()->createAttribute( sUniqueName ),
-                   UNO_QUERY );
+        xNode = xParent->getOwnerDocument()->createAttribute( sUniqueName );
     }
     return xNode;
 }
@@ -603,7 +601,7 @@ css::uno::Reference<css::xml::dom::XNode> 
Model::renameNode( const css::uno::Ref
     if( xNode->getNodeType() == NodeType_ELEMENT_NODE )
     {
         Reference<XElement> xElem = xDoc->createElement( sName );
-        xNew.set( xElem, UNO_QUERY );
+        xNew = xElem;
 
         // iterate over all attributes and append them to the new element
         Reference<XElement> xOldElem( xNode, UNO_QUERY );
diff --git a/forms/source/xforms/submission.cxx 
b/forms/source/xforms/submission.cxx
index c4d786877674..f20b72f11973 100644
--- a/forms/source/xforms/submission.cxx
+++ b/forms/source/xforms/submission.cxx
@@ -558,7 +558,7 @@ Reference< XDocumentFragment > 
Submission::createSubmissionDocument(const Refere
         {
             aListItem = aList->item(i);
             if (aListItem->getNodeType()==NodeType_DOCUMENT_NODE)
-                aListItem.set( (Reference< XDocument >(aListItem, 
UNO_QUERY))->getDocumentElement(), UNO_QUERY);
+                aListItem = (Reference< XDocument >(aListItem, 
UNO_QUERY))->getDocumentElement();
             // copy relevant nodes from instance into fragment
             cloneNodes(*getModelImpl(), aFragment, aListItem, bRemoveWSNodes);
         }
diff --git a/forms/source/xforms/submission/serialization_app_xml.cxx 
b/forms/source/xforms/submission/serialization_app_xml.cxx
index c8ad9ef642e3..afe23e63c426 100644
--- a/forms/source/xforms/submission/serialization_app_xml.cxx
+++ b/forms/source/xforms/submission/serialization_app_xml.cxx
@@ -67,7 +67,7 @@ CSerializationAppXML::getInputStream()
 {
     // The pipes output is provided through it's
     // XOutputStream interface aspect
-    return Reference< css::io::XInputStream >(m_xBuffer, UNO_QUERY);
+    return m_xBuffer;
 }
 
 void
diff --git a/forms/source/xforms/submission/serialization_urlencoded.cxx 
b/forms/source/xforms/submission/serialization_urlencoded.cxx
index 43dafdc714c6..51d29ceed0c9 100644
--- a/forms/source/xforms/submission/serialization_urlencoded.cxx
+++ b/forms/source/xforms/submission/serialization_urlencoded.cxx
@@ -173,7 +173,7 @@ void CSerializationURLEncoded::serialize()
 
 Reference< XInputStream > CSerializationURLEncoded::getInputStream()
 {
-    return Reference< XInputStream >(m_aPipe, UNO_QUERY);
+    return m_aPipe;
 }
 
 
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx 
b/fpicker/source/office/RemoteFilesDialog.cxx
index c22ebcbf9b3f..d9145866d6d5 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -719,9 +719,8 @@ void RemoteFilesDialog::SavePassword( const OUString& rURL, 
const OUString& rUse
             && m_xMasterPasswd->authorizateWithMasterPassword( Reference< 
XInteractionHandler>() ) )
         )
         {
-            Reference< XInteractionHandler > xInteractionHandler(
-                InteractionHandler::createWithParent( m_xContext, nullptr ),
-                UNO_QUERY );
+            Reference< XInteractionHandler > xInteractionHandler =
+                InteractionHandler::createWithParent( m_xContext, nullptr );
 
             Sequence<OUString> aPasswd { rPassword };
 
@@ -866,9 +865,8 @@ IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, 
MenuButton *, pButton, void )
                     {
                         OUString sUrl( m_aServices[nPos]->GetUrl() );
 
-                        Reference< XInteractionHandler > xInteractionHandler(
-                            InteractionHandler::createWithParent( m_xContext, 
nullptr ),
-                            UNO_QUERY );
+                        Reference< XInteractionHandler > xInteractionHandler =
+                            InteractionHandler::createWithParent( m_xContext, 
nullptr );
 
                         UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, 
xInteractionHandler );
 
@@ -908,9 +906,8 @@ IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, 
MenuButton *, pButton, void )
                 {
                     OUString sUrl( m_aServices[nPos]->GetUrl() );
 
-                    Reference< XInteractionHandler > xInteractionHandler(
-                        InteractionHandler::createWithParent( m_xContext, 
nullptr ),
-                        UNO_QUERY );
+                    Reference< XInteractionHandler > xInteractionHandler =
+                        InteractionHandler::createWithParent( m_xContext, 
nullptr );
 
                     UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, 
xInteractionHandler );
 
diff --git a/fpicker/source/office/commonpicker.cxx 
b/fpicker/source/office/commonpicker.cxx
index 34fe024ee07a..e87d58fb739d 100644
--- a/fpicker/source/office/commonpicker.cxx
+++ b/fpicker/source/office/commonpicker.cxx
@@ -218,22 +218,20 @@ namespace svt
                 m_xWindow = VCLUnoHelper::GetInterface( m_pDlg );
 
                 // add as event listener to the window
-                Reference< XComponent > xWindowComp( m_xWindow, UNO_QUERY );
-                OSL_ENSURE( xWindowComp.is(), 
"OCommonPicker::createFileDialog: invalid window component!" );
-                if ( xWindowComp.is() )
+                OSL_ENSURE( m_xWindow.is(), "OCommonPicker::createFileDialog: 
invalid window component!" );
+                if ( m_xWindow.is() )
                 {
-                    m_xWindowListenerAdapter = new OWeakEventListenerAdapter( 
this, xWindowComp );
+                    m_xWindowListenerAdapter = new OWeakEventListenerAdapter( 
this, m_xWindow );
                         // the adapter will add itself as listener, and 
forward notifications
                 }
 
                 // _and_ add as event listener to the parent - in case the 
parent is destroyed
                 // before we are disposed, our disposal would access dead VCL 
windows then ....
                 m_xDialogParent = VCLUnoHelper::GetInterface( 
m_pDlg->GetParent() );
-                xWindowComp.set(m_xDialogParent, css::uno::UNO_QUERY);
-                OSL_ENSURE( xWindowComp.is() || !m_pDlg->GetParent(), 
"OCommonPicker::createFileDialog: invalid window component (the parent this 
time)!" );
-                if ( xWindowComp.is() )
+                OSL_ENSURE( m_xDialogParent.is() || !m_pDlg->GetParent(), 
"OCommonPicker::createFileDialog: invalid window component (the parent this 
time)!" );
+                if ( m_xDialogParent.is() )
                 {
-                    m_xParentListenerAdapter = new OWeakEventListenerAdapter( 
this, xWindowComp );
+                    m_xParentListenerAdapter = new OWeakEventListenerAdapter( 
this, m_xDialogParent );
                         // the adapter will add itself as listener, and 
forward notifications
                 }
             }
commit c3741a89a99fcd58824d5137054b96b01bc32a11
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jul 19 15:32:24 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jul 19 18:29:21 2019 +0200

    loplugin:referencecasting in filter
    
    Change-Id: Ia437fa8f18052afa2b70dfedc1b4badcfd165d6a
    Reviewed-on: https://gerrit.libreoffice.org/75956
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/filter/source/config/cache/filtercache.cxx 
b/filter/source/config/cache/filtercache.cxx
index 083bd2de47d2..59ac271b8393 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -1518,7 +1518,6 @@ void FilterCache::impl_savePatchUINames(const 
css::uno::Reference< css::containe
                                         const CacheItem&                       
                    rItem)
 {
     css::uno::Reference< css::container::XNameContainer > xAdd  (xNode, 
css::uno::UNO_QUERY);
-    css::uno::Reference< css::container::XNameAccess >    xCheck(xNode, 
css::uno::UNO_QUERY);
 
     css::uno::Sequence< css::beans::PropertyValue > lUINames = 
rItem.getUnpackedValueOrDefault(PROPNAME_UINAMES, css::uno::Sequence< 
css::beans::PropertyValue >());
     sal_Int32                                       c        = 
lUINames.getLength();
@@ -1526,7 +1525,7 @@ void FilterCache::impl_savePatchUINames(const 
css::uno::Reference< css::containe
 
     for (sal_Int32 i=0; i<c; ++i)
     {
-        if (xCheck->hasByName(pUINames[i].Name))
+        if (xNode->hasByName(pUINames[i].Name))
             xNode->replaceByName(pUINames[i].Name, pUINames[i].Value);
         else
             xAdd->insertByName(pUINames[i].Name, pUINames[i].Value);
diff --git a/filter/source/flash/swfexporter.cxx 
b/filter/source/flash/swfexporter.cxx
index 344ea5214849..8f6615128bbd 100644
--- a/filter/source/flash/swfexporter.cxx
+++ b/filter/source/flash/swfexporter.cxx
@@ -121,7 +121,7 @@ bool FlashExporter::exportAll( const Reference< XComponent 
>& xDoc, Reference< X
     if(!xDrawPagesSupplier.is())
         return false;
 
-    Reference< XIndexAccess > xDrawPages( xDrawPagesSupplier->getDrawPages(), 
UNO_QUERY );
+    Reference< XIndexAccess > xDrawPages = xDrawPagesSupplier->getDrawPages();
     if(!xDrawPages.is())
         return false;
 
@@ -451,9 +451,7 @@ sal_uInt16 
FlashExporter::exportDrawPageBackground(sal_uInt16 nPage, Reference<
 
 sal_uInt16 FlashExporter::exportMasterPageObjects(sal_uInt16 nPage, Reference< 
XDrawPage > const & xMasterPage)
 {
-    Reference< XShapes > xShapes( xMasterPage, UNO_QUERY );
-
-    BitmapChecksum shapesum = ActionSummer(xShapes);
+    BitmapChecksum shapesum = ActionSummer(xMasterPage);
 
     ChecksumCache::iterator it = gObjectCache.find(shapesum);
 
@@ -481,8 +479,7 @@ sal_uInt16 
FlashExporter::exportMasterPageObjects(sal_uInt16 nPage, Reference< X
     shape infos to the current PageInfo */
 void FlashExporter::exportDrawPageContents( const Reference< XDrawPage >& 
xPage, bool bStream, bool bMaster )
 {
-    Reference< XShapes > xShapes( xPage, UNO_QUERY );
-    exportShapes(xShapes, bStream, bMaster);
+    exportShapes(xPage, bStream, bMaster);
 }
 
 
diff --git a/filter/source/flash/swffilter.cxx 
b/filter/source/flash/swffilter.cxx
index b6ae37da2efa..4b614c3eabce 100644
--- a/filter/source/flash/swffilter.cxx
+++ b/filter/source/flash/swffilter.cxx
@@ -308,7 +308,7 @@ void FlashExportFilter::ExportAsMultipleFiles(const 
Sequence< PropertyValue >& a
     if(!xDrawPagesSupplier.is())
         return;
 
-    Reference< XIndexAccess > xDrawPages( xDrawPagesSupplier->getDrawPages(), 
UNO_QUERY );
+    Reference< XIndexAccess > xDrawPages = xDrawPagesSupplier->getDrawPages();
     if(!xDrawPages.is())
         return;
 
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx 
b/filter/source/graphicfilter/icgm/actimpr.cxx
index 57a9a409fb5a..bdf99e8400de 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -95,7 +95,7 @@ bool CGMImpressOutAct::ImplInitPage()
     bool    bStatRet = false;
     if( maXDrawPage.is() )
     {
-        maXShapes = uno::Reference< drawing::XShapes >( maXDrawPage, 
uno::UNO_QUERY );
+        maXShapes = maXDrawPage;
         if ( maXShapes.is() )
         {
             bStatRet = true;
@@ -381,7 +381,7 @@ void CGMImpressOutAct::InsertPage()
 {
     if ( mnCurrentPage )    // one side is always existing, therefore the 
first side will be left out
     {
-        uno::Reference< drawing::XDrawPage > xPage( 
maXDrawPages->insertNewByIndex( 0xffff ), uno::UNO_QUERY );
+        uno::Reference< drawing::XDrawPage > xPage = 
maXDrawPages->insertNewByIndex( 0xffff );
         maXDrawPage = xPage;
         if ( !ImplInitPage() )
             mpCGM->mbStatus = false;
diff --git a/filter/source/msfilter/eschesdo.cxx 
b/filter/source/msfilter/eschesdo.cxx
index ff9ef46333c1..b145cbef20c8 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -171,7 +171,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( 
ImplEESdrObject& rObj,
         if( const SdrObject* pSdrObj = rObj.GetSdrObject() )
             if (!pSdrObj->GetName().isEmpty())
                 aShapeName = pSdrObj->GetName();
-        uno::Reference< drawing::XShape> xShape(rObj.GetShapeRef(), 
uno::UNO_QUERY);
+        uno::Reference< drawing::XShape> xShape = rObj.GetShapeRef();
         if (xShape.is())
         {
             uno::Reference<beans::XPropertySet> xPropertySet(xShape, 
uno::UNO_QUERY);
@@ -414,7 +414,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( 
ImplEESdrObject& rObj,
         }
         else if ( rObj.GetType() == "drawing.Control" )
         {
-            const Reference< XPropertySet > xPropSet(rObj.mXPropSet, 
UNO_QUERY);
+            const Reference< XPropertySet > xPropSet = rObj.mXPropSet;
             const Reference<XPropertySetInfo> xPropInfo = xPropSet.is() ? 
xPropSet->getPropertySetInfo() : Reference<XPropertySetInfo>();
             // This code is expected to be called only for DOCX format.
             if (xPropInfo.is() && xPropInfo->hasPropertyByName("AnchorType") 
&& bOOxmlExport)
@@ -868,7 +868,7 @@ bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage )
         if (xOldDrawPage.is())
             xOldDrawPage->dispose();
         mXDrawPage = pSvxDrawPage = new SvxFmDrawPage( 
const_cast<SdrPage*>(&rPage) );
-        mXShapes.set( mXDrawPage, UNO_QUERY );
+        mXShapes = mXDrawPage;
         if ( !mXShapes.is() )
             return false;
         ImplInitPageValues();
diff --git a/filter/source/msfilter/msocximex.cxx 
b/filter/source/msfilter/msocximex.cxx
index 09217fb8346d..75ba2678e4c8 100644
--- a/filter/source/msfilter/msocximex.cxx
+++ b/filter/source/msfilter/msocximex.cxx
@@ -74,9 +74,7 @@ const uno::Reference< drawing::XShapes >& 
SvxMSConvertOCXControls::GetShapes()
         GetDrawPage();
         if( xDrawPage.is() )
         {
-
-            xShapes.set(xDrawPage, uno::UNO_QUERY);
-            OSL_ENSURE( xShapes.is(), "UNO_QUERY failed for XShapes from 
XDrawPage" );
+            xShapes = xDrawPage;
         }
     }
     return xShapes;
diff --git a/filter/source/msfilter/mstoolbar.cxx 
b/filter/source/msfilter/mstoolbar.cxx
index ed49bff15a35..a17baaff276b 100644
--- a/filter/source/msfilter/mstoolbar.cxx
+++ b/filter/source/msfilter/mstoolbar.cxx
@@ -147,7 +147,7 @@ CustomToolBarImportHelper::createMenu( const OUString& 
rName, const uno::Referen
             aPopupMenu[3].Value <<= sal_Int32( 0 );
 
             xPopup->insertByIndex( xPopup->getCount(), uno::makeAny( 
aPopupMenu ) );
-            xCfgManager->insertSettings( sMenuBar, uno::Reference< 
container::XIndexAccess >( xPopup, uno::UNO_QUERY ) );
+            xCfgManager->insertSettings( sMenuBar, xPopup );
             uno::Reference< ui::XUIConfigurationPersistence > xPersistence( 
xCfgManager, uno::UNO_QUERY_THROW );
             xPersistence->store();
         }
diff --git a/filter/source/storagefilterdetect/filterdetect.cxx 
b/filter/source/storagefilterdetect/filterdetect.cxx
index fb40d64a06ab..78a7ef12322d 100644
--- a/filter/source/storagefilterdetect/filterdetect.cxx
+++ b/filter/source/storagefilterdetect/filterdetect.cxx
@@ -92,7 +92,7 @@ OUString SAL_CALL 
StorageFilterDetect::detect(uno::Sequence<beans::PropertyValue
         if ( !xInStream.is() )
             return OUString();
 
-        uno::Reference< embed::XStorage > xStorage( 
::comphelper::OStorageHelper::GetStorageFromInputStream( xInStream, mxCxt ), 
uno::UNO_QUERY );
+        uno::Reference< embed::XStorage > xStorage = 
::comphelper::OStorageHelper::GetStorageFromInputStream( xInStream, mxCxt );
         if ( !xStorage.is() )
             return OUString();
 
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 030fcb19d918..6dd61cceb439 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -553,7 +553,7 @@ bool SVGFilter::implExportImpressOrDraw( const Reference< 
XOutputStream >& rxOSt
     {
         if( !mSelectedPages.empty() && !mMasterPageTargets.empty() )
         {
-            Reference< XDocumentHandler > xDocHandler( 
implCreateExportDocumentHandler( rxOStm ), UNO_QUERY );
+            Reference< XDocumentHandler > xDocHandler = 
implCreateExportDocumentHandler( rxOStm );
 
             if( xDocHandler.is() )
             {
@@ -643,7 +643,7 @@ bool SVGFilter::implExportWriterOrCalc( const Reference< 
XOutputStream >& rxOStm
 
     if( rxOStm.is() )
     {
-        Reference< XDocumentHandler > xDocHandler( 
implCreateExportDocumentHandler( rxOStm ), UNO_QUERY );
+        Reference< XDocumentHandler > xDocHandler = 
implCreateExportDocumentHandler( rxOStm );
 
         if( xDocHandler.is() )
         {
@@ -1114,7 +1114,7 @@ void SVGFilter::implGenerateMetaData()
             {
                 const Reference< css::drawing::XDrawPage > & xDrawPage = 
mSelectedPages[i];
                 Reference< css::drawing::XMasterPageTarget > 
xMasterPageTarget( xDrawPage, UNO_QUERY );
-                Reference< css::drawing::XDrawPage > xMasterPage( 
xMasterPageTarget->getMasterPage(), UNO_QUERY );
+                Reference< css::drawing::XDrawPage > xMasterPage = 
xMasterPageTarget->getMasterPage();
                 OUString aSlideId(aId + "_" + OUString::number( i ));
 
                 mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", aSlideId 
);
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 9bb57068dfea..3e0e24e9af2c 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -186,7 +186,7 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< 
PropertyValue >& rDescripto
             }
 
             // get the DrawPages
-            uno::Reference< drawing::XDrawPages > xDrawPages( 
xDrawPagesSupplier->getDrawPages(), uno::UNO_QUERY );
+            uno::Reference< drawing::XDrawPages > xDrawPages = 
xDrawPagesSupplier->getDrawPages();
 
             if(!xDrawPages.is())
             {
@@ -469,8 +469,8 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< 
PropertyValue >& rDescripto
 
             if( xMasterPagesSupplier.is() && xDrawPagesSupplier.is() )
             {
-                uno::Reference< drawing::XDrawPages >   xMasterPages( 
xMasterPagesSupplier->getMasterPages(), uno::UNO_QUERY );
-                uno::Reference< drawing::XDrawPages >   xDrawPages( 
xDrawPagesSupplier->getDrawPages(), uno::UNO_QUERY );
+                uno::Reference< drawing::XDrawPages >   xMasterPages = 
xMasterPagesSupplier->getMasterPages();
+                uno::Reference< drawing::XDrawPages >   xDrawPages = 
xDrawPagesSupplier->getDrawPages();
                 if( xMasterPages.is() && xMasterPages->getCount() &&
                     xDrawPages.is() && xDrawPages->getCount() )
                 {
diff --git a/filter/source/xsltfilter/OleHandler.cxx 
b/filter/source/xsltfilter/OleHandler.cxx
index ffff107dc49e..e2fdcbf1caee 100644
--- a/filter/source/xsltfilter/OleHandler.cxx
+++ b/filter/source/xsltfilter/OleHandler.cxx
@@ -53,7 +53,7 @@ using namespace ::com::sun::star::embed;
 namespace XSLT
 {
     Reference<XStream> OleHandler::createTempFile() {
-        Reference<XStream> tempFile( TempFile::create(m_xContext), UNO_QUERY);
+        Reference<XStream> tempFile = TempFile::create(m_xContext);
         OSL_ASSERT(tempFile.is());
         return tempFile;
     }
diff --git a/filter/source/xsltfilter/XSLTFilter.cxx 
b/filter/source/xsltfilter/XSLTFilter.cxx
index a3b0940e1bc4..df74b8aa4814 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -334,19 +334,15 @@ namespace XSLT
                                 this));
 
                         // connect input to transformer
-                        css::uno::Reference<XActiveDataSink> tsink(m_tcontrol, 
UNO_QUERY);
-                        tsink->setInputStream(xInputStream);
+                        m_tcontrol->setInputStream(xInputStream);
 
                         // create pipe
-                        css::uno::Reference<XOutputStream> pipeout(
-                                        Pipe::create(m_xContext),
-                                        UNO_QUERY);
+                        css::uno::Reference<XOutputStream> pipeout =
+                                        Pipe::create(m_xContext);
                         css::uno::Reference<XInputStream> pipein(pipeout, 
UNO_QUERY);
 
                         //connect transformer to pipe
-                        css::uno::Reference<XActiveDataSource> 
tsource(m_tcontrol,
-                                UNO_QUERY);
-                        tsource->setOutputStream(pipeout);
+                        m_tcontrol->setOutputStream(pipeout);
 
                         // connect pipe to sax parser
                         InputSource aInput;
@@ -477,9 +473,8 @@ namespace XSLT
                 m_tcontrol->addListener(css::uno::Reference<XStreamListener> 
(this));
 
                 // create pipe
-                css::uno::Reference<XOutputStream> pipeout(
-                                Pipe::create(m_xContext),
-                                UNO_QUERY);
+                css::uno::Reference<XOutputStream> pipeout =
+                                Pipe::create(m_xContext);
                 css::uno::Reference<XInputStream> pipein(pipeout, UNO_QUERY);
 
                 // connect sax writer to pipe
@@ -488,12 +483,10 @@ namespace XSLT
                 xmlsource->setOutputStream(pipeout);
 
                 // connect pipe to transformer
-                css::uno::Reference<XActiveDataSink> tsink(m_tcontrol, 
UNO_QUERY);
-                tsink->setInputStream(pipein);
+                m_tcontrol->setInputStream(pipein);
 
                 // connect transformer to output
-                css::uno::Reference<XActiveDataSource> tsource(m_tcontrol, 
UNO_QUERY);
-                tsource->setOutputStream(m_rOutputStream);
+                m_tcontrol->setOutputStream(m_rOutputStream);
 
                 // we will start receiving events after returning 'true'.
                 // we will start the transformation as soon as we receive the 
startDocument
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to