diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 15:31:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 18:29:48 +0200 |
commit | 8c26800ff823525df46d2bdc42af52ab75285cda (patch) | |
tree | 988c4a27d3c7006181627f1a7b46f8510fb78d09 /extensions | |
parent | 6595240f39c34fa9ae5cd1bb319f6287206e4b92 (diff) |
loplugin:referencecasting in extensions
Change-Id: Ib03be019b2fedc67b3114c107162722eabce0218
Reviewed-on: https://gerrit.libreoffice.org/75955
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/abpilot/datasourcehandling.cxx | 4 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 2 | ||||
-rw-r--r-- | extensions/source/bibliography/general.cxx | 3 | ||||
-rw-r--r-- | extensions/source/dbpilots/commonpagesdbp.cxx | 4 | ||||
-rw-r--r-- | extensions/source/dbpilots/controlwizard.cxx | 2 | ||||
-rw-r--r-- | extensions/source/dbpilots/optiongrouplayouter.cxx | 2 | ||||
-rw-r--r-- | extensions/source/propctrlr/formlinkdialog.cxx | 28 | ||||
-rw-r--r-- | extensions/source/propctrlr/propcontroller.cxx | 10 | ||||
-rw-r--r-- | extensions/source/propctrlr/xsddatatypes.cxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/xsdvalidationhelper.cxx | 6 |
10 files changed, 29 insertions, 36 deletions
diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index 8371d97b61b0..fdcf218f4826 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -521,9 +521,7 @@ namespace abp Reference< XInteractionHandler > xInteractions; try { - xInteractions.set( - InteractionHandler::createWithParent(m_pImpl->xORB, nullptr), - UNO_QUERY); + xInteractions = InteractionHandler::createWithParent(m_pImpl->xORB, nullptr); } catch(const Exception&) { diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 0345049a9238..aaaff07f1b6e 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -901,7 +901,7 @@ void BibDataManager::setActiveDataSource(const OUString& rURL) aPropertySet->setPropertyValue("FetchSize", aVal); OUString aString("SELECT * FROM "); // quote the table name which may contain catalog.schema.table - Reference<XDatabaseMetaData> xMetaData(xConnection->getMetaData(),UNO_QUERY); + Reference<XDatabaseMetaData> xMetaData = xConnection->getMetaData(); aQuoteChar = xMetaData->getIdentifierQuoteString(); OUString sCatalog, sSchema, sName; diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index de447c4a59f0..11163a1227be 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -398,8 +398,7 @@ void BibGeneralPage::RemoveListeners() { if(aControl.is()) { - uno::Reference< awt::XWindow > xCtrWin(aControl, uno::UNO_QUERY ); - xCtrWin->removeFocusListener( mxBibGeneralPageFocusListener.get() ); + aControl->removeFocusListener( mxBibGeneralPageFocusListener.get() ); aControl = nullptr; } } diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 760999d6e3f0..92d441902de8 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -324,7 +324,7 @@ namespace dbp Reference< XTablesSupplier > xSupplTables(xConn, UNO_QUERY); if ( xSupplTables.is() ) { - Reference< XNameAccess > xTables(xSupplTables->getTables(), UNO_QUERY); + Reference< XNameAccess > xTables = xSupplTables->getTables(); if (xTables.is()) aTableNames = xTables->getElementNames(); } @@ -333,7 +333,7 @@ namespace dbp Reference< XQueriesSupplier > xSuppQueries( xConn, UNO_QUERY ); if ( xSuppQueries.is() ) { - Reference< XNameAccess > xQueries( xSuppQueries->getQueries(), UNO_QUERY ); + Reference< XNameAccess > xQueries = xSuppQueries->getQueries(); if ( xQueries.is() ) aQueryNames = xQueries->getElementNames(); } diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 1e8494f73f13..9852fe1d9bc2 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -281,7 +281,7 @@ namespace dbp void OControlWizard::implDetermineShape() { - Reference< XIndexAccess > xPageObjects(m_aContext.xDrawPage, UNO_QUERY); + Reference< XIndexAccess > xPageObjects = m_aContext.xDrawPage; DBG_ASSERT(xPageObjects.is(), "OControlWizard::implDetermineShape: invalid page!"); // for comparing the model diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx index b05fe7d377cb..9b72a92f6938 100644 --- a/extensions/source/dbpilots/optiongrouplayouter.cxx +++ b/extensions/source/dbpilots/optiongrouplayouter.cxx @@ -59,7 +59,7 @@ namespace dbp void OOptionGroupLayouter::doLayout(const OControlWizardContext& _rContext, const OOptionGroupSettings& _rSettings) { - Reference< XShapes > xPageShapes(_rContext.xDrawPage, UNO_QUERY); + Reference< XShapes > xPageShapes = _rContext.xDrawPage; if (!xPageShapes.is()) { OSL_FAIL("OOptionGroupLayouter::OOptionGroupLayouter: missing the XShapes interface for the page!"); diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx index 72d7de9fd4c4..4928562c793a 100644 --- a/extensions/source/propctrlr/formlinkdialog.cxx +++ b/extensions/source/propctrlr/formlinkdialog.cxx @@ -209,11 +209,10 @@ namespace pcr // and set as property values try { - Reference< XPropertySet > xDetailFormProps( m_xDetailForm, UNO_QUERY ); - if ( xDetailFormProps.is() ) + if ( m_xDetailForm.is() ) { - xDetailFormProps->setPropertyValue( PROPERTY_DETAILFIELDS, makeAny( Sequence< OUString >( aDetailFields.data(), aDetailFields.size() ) ) ); - xDetailFormProps->setPropertyValue( PROPERTY_MASTERFIELDS, makeAny( Sequence< OUString >( aMasterFields.data(), aMasterFields.size() ) ) ); + m_xDetailForm->setPropertyValue( PROPERTY_DETAILFIELDS, makeAny( Sequence< OUString >( aDetailFields.data(), aDetailFields.size() ) ) ); + m_xDetailForm->setPropertyValue( PROPERTY_MASTERFIELDS, makeAny( Sequence< OUString >( aMasterFields.data(), aMasterFields.size() ) ) ); } } catch( const Exception& ) @@ -303,11 +302,10 @@ namespace pcr Sequence< OUString > aDetailFields; Sequence< OUString > aMasterFields; - Reference< XPropertySet > xDetailFormProps( m_xDetailForm, UNO_QUERY ); - if ( xDetailFormProps.is() ) + if ( m_xDetailForm.is() ) { - xDetailFormProps->getPropertyValue( PROPERTY_DETAILFIELDS ) >>= aDetailFields; - xDetailFormProps->getPropertyValue( PROPERTY_MASTERFIELDS ) >>= aMasterFields; + m_xDetailForm->getPropertyValue( PROPERTY_DETAILFIELDS ) >>= aDetailFields; + m_xDetailForm->getPropertyValue( PROPERTY_MASTERFIELDS ) >>= aMasterFields; } std::vector< OUString > aDetailFields1; @@ -543,24 +541,22 @@ namespace pcr void FormLinkDialog::initializeSuggest() { - Reference< XPropertySet > xDetailFormProps( m_xDetailForm, UNO_QUERY ); - Reference< XPropertySet > xMasterFormProps( m_xMasterForm, UNO_QUERY ); - if ( !xDetailFormProps.is() || !xMasterFormProps.is() ) + if ( !m_xDetailForm.is() || !m_xMasterForm.is() ) return; try { // only show the button when both forms are based on the same data source OUString sMasterDS, sDetailDS; - xMasterFormProps->getPropertyValue( PROPERTY_DATASOURCE ) >>= sMasterDS; - xDetailFormProps->getPropertyValue( PROPERTY_DATASOURCE ) >>= sDetailDS; + m_xMasterForm->getPropertyValue( PROPERTY_DATASOURCE ) >>= sMasterDS; + m_xDetailForm->getPropertyValue( PROPERTY_DATASOURCE ) >>= sDetailDS; bool bEnable = ( sMasterDS == sDetailDS ); // only show the button when the connection supports relations if ( bEnable ) { Reference< XDatabaseMetaData > xMeta; - getConnectionMetaData( xDetailFormProps, xMeta ); + getConnectionMetaData( m_xDetailForm, xMeta ); OSL_ENSURE( xMeta.is(), "FormLinkDialog::initializeSuggest: unable to retrieve the meta data for the connection!" ); try { @@ -576,8 +572,8 @@ namespace pcr Reference< XPropertySet > xDetailTable, xMasterTable; if ( bEnable ) { - xDetailTable = getCanonicUnderlyingTable( xDetailFormProps ); - xMasterTable = getCanonicUnderlyingTable( xMasterFormProps ); + xDetailTable = getCanonicUnderlyingTable( m_xDetailForm ); + xMasterTable = getCanonicUnderlyingTable( m_xMasterForm ); bEnable = xDetailTable.is() && xMasterTable.is(); } diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index 238eaf937f3b..50cd32f0d12b 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -510,9 +510,8 @@ namespace pcr // don't delete explicitly (this is done by the frame we reside in) m_pView = nullptr; - Reference< XComponent > xViewAsComp( m_xView, UNO_QUERY ); - if ( xViewAsComp.is() ) - xViewAsComp->removeEventListener( static_cast< XPropertyChangeListener* >( this ) ); + if ( m_xView.is() ) + m_xView->removeEventListener( static_cast< XPropertyChangeListener* >( this ) ); m_xView.clear( ); m_aInspectedObjects.clear(); @@ -672,9 +671,8 @@ namespace pcr // and this disposal _deletes_ the view, so it would be deadly if we use our m_pView member // after that m_xView = VCLUnoHelper::GetInterface(m_pView); - Reference< XComponent > xViewAsComp(m_xView, UNO_QUERY); - if (xViewAsComp.is()) - xViewAsComp->addEventListener( static_cast< XPropertyChangeListener* >( this ) ); + if (m_xView.is()) + m_xView->addEventListener( static_cast< XPropertyChangeListener* >( this ) ); getPropertyBox().SetLineListener(this); getPropertyBox().SetControlObserver(this); diff --git a/extensions/source/propctrlr/xsddatatypes.cxx b/extensions/source/propctrlr/xsddatatypes.cxx index 9403117e685f..7a0fb3ac718a 100644 --- a/extensions/source/propctrlr/xsddatatypes.cxx +++ b/extensions/source/propctrlr/xsddatatypes.cxx @@ -168,8 +168,8 @@ namespace pcr try { - Reference< XPropertySet > xSource( _pSourceType->getUnoDataType(), UNO_QUERY ); - Reference< XPropertySet > xDest( getUnoDataType(), UNO_QUERY ); + Reference< XPropertySet > xSource = _pSourceType->getUnoDataType(); + Reference< XPropertySet > xDest = getUnoDataType(); lcl_copyProperties( xSource, xDest ); } catch( const Exception& ) diff --git a/extensions/source/propctrlr/xsdvalidationhelper.cxx b/extensions/source/propctrlr/xsdvalidationhelper.cxx index 52c6378d6e09..5f34cad5415b 100644 --- a/extensions/source/propctrlr/xsdvalidationhelper.cxx +++ b/extensions/source/propctrlr/xsdvalidationhelper.cxx @@ -250,13 +250,15 @@ namespace pcr OUString sOldDataTypeName; OSL_VERIFY( xBinding->getPropertyValue( PROPERTY_XSD_DATA_TYPE ) >>= sOldDataTypeName ); Reference< XPropertySet > xOldType; - try { xOldType.set(getDataType( sOldDataTypeName ), css::uno::UNO_QUERY); } catch( const Exception& ) { } + try { + xOldType = getDataType( sOldDataTypeName ); + } catch( const Exception& ) { } // set the new data type name xBinding->setPropertyValue( PROPERTY_XSD_DATA_TYPE, makeAny( _rName ) ); // retrieve the new data type object - Reference< XPropertySet > xNewType( getDataType( _rName ), UNO_QUERY ); + Reference< XPropertySet > xNewType = getDataType( _rName ); // fire any changes in the properties which result from this new type std::set< OUString > aFilter; aFilter.insert( PROPERTY_NAME ); |