diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 09:52:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 11:53:24 +0200 |
commit | 1003f9f14d83eac9c08a219fa7d8140550de02c7 (patch) | |
tree | 295e5ee4b46d5a72c14f0b4e2a0214ad78457cfc /dbaccess | |
parent | fbcd5f074ca3dc105f4fe45b6975c6de2bf60f35 (diff) |
loplugin:referencecasting in dbaccess
Change-Id: If44176f85f460afca92cfa77b3cc1f7107a41690
Reviewed-on: https://gerrit.libreoffice.org/75938
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
26 files changed, 46 insertions, 54 deletions
diff --git a/dbaccess/qa/extras/rowsetclones.cxx b/dbaccess/qa/extras/rowsetclones.cxx index 433bf328864b..aabb80acc0fa 100644 --- a/dbaccess/qa/extras/rowsetclones.cxx +++ b/dbaccess/qa/extras/rowsetclones.cxx @@ -82,7 +82,7 @@ void RowSetClones::test() rowSetProperties->setPropertyValue("ActiveConnection", Any(xConnection)); xRowSet->execute(); - uno::Reference< XResultSet > xResultSet(xRowSet, UNO_QUERY); + uno::Reference< XResultSet > xResultSet = xRowSet; CPPUNIT_ASSERT(xResultSet.is()); // always starts at BeforeFirst position CPPUNIT_ASSERT(xResultSet->isBeforeFirst()); diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 80771e48b76f..137f1e3b4104 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -291,7 +291,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet, const OUStrin Reference<XSingleSelectQueryComposer> xAnalyzer(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY); xAnalyzer->setElementaryQuery(xSourceComposer->getElementaryQuery()); Reference<XTablesSupplier> xTabSup(xAnalyzer,uno::UNO_QUERY); - Reference<XNameAccess> xSelectTables(xTabSup->getTables(),uno::UNO_QUERY); + Reference<XNameAccess> xSelectTables = xTabSup->getTables(); const Sequence< OUString> aSeq = xSelectTables->getElementNames(); if ( aSeq.getLength() > 1 ) // special handling for join { diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index 01336a5e3327..f0adf088281f 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -147,7 +147,7 @@ void lcl_createDefintionObject(const OUString& _rName else { // set as folder - _xTableDefinition.set( TableDefinition::createWithName( ::comphelper::getProcessComponentContext(), _rName ), UNO_QUERY); + _xTableDefinition = TableDefinition::createWithName( ::comphelper::getProcessComponentContext(), _rName ); _xTableDefinitions->insertByName(_rName,makeAny(_xTableDefinition)); } Reference<XColumnsSupplier> xColumnsSupplier(_xTableDefinition,UNO_QUERY); diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 24db02fc6be0..b0904f969b58 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -1598,9 +1598,8 @@ void ODatabaseDocument::WriteThroughComponent( const Reference< XOutputStream >& xSaxWriter->setOutputStream( xOutputStream ); // prepare arguments (prepend doc handler to given arguments) - Reference< XDocumentHandler > xDocHandler( xSaxWriter,UNO_QUERY); Sequence<Any> aArgs( 1 + _rArguments.getLength() ); - aArgs[0] <<= xDocHandler; + aArgs[0] <<= xSaxWriter; for ( sal_Int32 i = 0; i < _rArguments.getLength(); ++i ) aArgs[ i+1 ] = _rArguments[i]; diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 54e338bcbd00..5f1bfa87effa 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -210,7 +210,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments if ( bNew ) { sPersistentName = "Obj" + OUString::number(rDefinitions.size() + 1); - Reference<XNameAccess> xElements(getContainerStorage(),UNO_QUERY); + Reference<XNameAccess> xElements = getContainerStorage(); if ( xElements.is() ) sPersistentName = ::dbtools::createUniqueName(xElements,sPersistentName); diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 1d68932a42b1..9c89e4da2b8a 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -438,9 +438,7 @@ void ODocumentDefinition::closeObject() { try { - Reference< css::util::XCloseable> xCloseable(m_xEmbeddedObject,UNO_QUERY); - if ( xCloseable.is() ) - xCloseable->close(true); + m_xEmbeddedObject->close(true); } catch(const Exception&) { @@ -1181,9 +1179,8 @@ void ODocumentDefinition::onCommandInsert( const OUString& _sURL, const Referenc } try { - Reference< css::util::XCloseable> xCloseable(m_xEmbeddedObject,UNO_QUERY); - if ( xCloseable.is() ) - xCloseable->close(true); + if ( m_xEmbeddedObject.is() ) + m_xEmbeddedObject->close(true); } catch(const Exception&) { @@ -1753,10 +1750,9 @@ Reference< util::XCloseable > ODocumentDefinition::impl_getComponent_throw( cons if ( nState == EmbedStates::ACTIVE || nState == EmbedStates::RUNNING ) { - Reference<XComponentSupplier> xCompProv(m_xEmbeddedObject,UNO_QUERY); - if ( xCompProv.is() ) + if ( m_xEmbeddedObject.is() ) { - xComp = xCompProv->getComponent(); + xComp = m_xEmbeddedObject->getComponent(); OSL_ENSURE(xComp.is(),"No valid component"); } } diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx index 2519137a0dae..3d16ee6ebb79 100644 --- a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx +++ b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx @@ -150,7 +150,7 @@ namespace dbaccess try { - Reference< XNameAccess > xDocEvents( xEventsSupplier->getEvents().get(), UNO_SET_THROW ); + Reference< XNameAccess > xDocEvents( xEventsSupplier->getEvents(), UNO_SET_THROW ); if ( !xDocEvents->hasByName( Event.EventName ) ) { // this is worth an assertion: We are listener at the very same document which we just asked diff --git a/dbaccess/source/ext/macromigration/docinteraction.cxx b/dbaccess/source/ext/macromigration/docinteraction.cxx index 031c91e497f3..98875eb29bd9 100644 --- a/dbaccess/source/ext/macromigration/docinteraction.cxx +++ b/dbaccess/source/ext/macromigration/docinteraction.cxx @@ -49,7 +49,7 @@ namespace dbmm Reference< XInteractionHandler > xHandler; explicit InteractionHandler_Data( const Reference<XComponentContext>& _rContext ) - :xHandler( css::task::InteractionHandler::createWithParent(_rContext, nullptr), UNO_QUERY ) + :xHandler( css::task::InteractionHandler::createWithParent(_rContext, nullptr) ) { } }; diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx index 3d0b0d0c1f16..dfc32198ac36 100644 --- a/dbaccess/source/filter/xml/dbloader2.cxx +++ b/dbaccess/source/filter/xml/dbloader2.cxx @@ -325,7 +325,7 @@ namespace xWindow = xActiveFrame->getContainerWindow(); Reference<XFrame> xFrame = xActiveFrame; while ( xFrame.is() && !xFrame->isTop() ) - xFrame.set(xFrame->getCreator(),UNO_QUERY); + xFrame = xFrame->getCreator(); if ( xFrame.is() ) xWindow = xFrame->getContainerWindow(); diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index dde699a8cfc0..f9416733f635 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -1235,7 +1235,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa aCreationArgs.put( OUString(PROPERTY_GRAPHICAL_DESIGN), ID_NEW_VIEW_DESIGN == _nId ); const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY ); - const Reference< XComponent > xComponent( aDesigner.createNew( xDataSource, aCreationArgs ), UNO_QUERY ); + const Reference< XComponent > xComponent = aDesigner.createNew( xDataSource, aCreationArgs ); onDocumentOpened( OUString(), E_QUERY, E_OPEN_DESIGN, xComponent, nullptr ); } } @@ -1287,7 +1287,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa RelationDesigner aDesigner( getORB(), this, m_aCurrentFrame.getFrame() ); const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY ); - const Reference< XComponent > xComponent( aDesigner.createNew( xDataSource ), UNO_QUERY ); + const Reference< XComponent > xComponent = aDesigner.createNew( xDataSource ); onDocumentOpened( OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xComponent, nullptr ); } } @@ -1957,7 +1957,7 @@ Reference< XComponent > OApplicationController::newElement( ElementType _eType, } Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY ); - xComponent.set( pDesigner->createNew( xDataSource, i_rAdditionalArguments ), UNO_QUERY ); + xComponent = pDesigner->createNew( xDataSource, i_rAdditionalArguments ); } break; diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index a59198f19418..6a5f0065ff52 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -658,7 +658,7 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe } } - Reference< XNameContainer > xDestQueries(getQueryDefinitions(), UNO_QUERY); + Reference< XNameContainer > xDestQueries = getQueryDefinitions(); Reference< XSingleServiceFactory > xQueryFactory(xDestQueries, UNO_QUERY); if (!xQueryFactory.is()) { diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx index 011547a5d3ef..6c0b122e3172 100644 --- a/dbaccess/source/ui/app/AppView.cxx +++ b/dbaccess/source/ui/app/AppView.cxx @@ -487,13 +487,13 @@ void OApplicationView::showPreview( const OUString& _sDataSourceName, { Reference<XTablesSupplier> xSup(_xConnection,UNO_QUERY); if ( xSup.is() ) - xNameAccess.set(xSup->getTables(),UNO_QUERY); + xNameAccess = xSup->getTables(); } else { Reference<XQueriesSupplier> xSup(_xConnection,UNO_QUERY); if ( xSup.is() ) - xNameAccess.set(xSup->getQueries(),UNO_QUERY); + xNameAccess = xSup->getQueries(); } if ( xNameAccess.is() && xNameAccess->hasByName(_sName) ) m_xObject.set(xNameAccess->getByName(_sName),UNO_QUERY); diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index a387e04d0b8f..a0e3374f4cdb 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1972,7 +1972,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property break; // only one sort order - Reference< XPropertySet > xField(getBoundField(), UNO_QUERY); + Reference< XPropertySet > xField = getBoundField(); if (!xField.is()) break; @@ -1999,7 +1999,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property if (!isValidCursor()) break; - Reference< XPropertySet > xField(getBoundField(), UNO_QUERY); + Reference< XPropertySet > xField = getBoundField(); if (!xField.is()) break; @@ -2321,7 +2321,7 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext&, r } sFieldList = comphelper::string::stripEnd(sFieldList, ';'); - rContext.xCursor.set(getRowSet(),UNO_QUERY); + rContext.xCursor = getRowSet(); rContext.strUsedFields = sFieldList; // if the cursor is in a mode other than STANDARD -> reset diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index a20291fb5e01..b87d8c90666f 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -262,7 +262,7 @@ SbaGridControl* UnoDataBrowserView::getVclControl() const if ( pPeer ) { m_pVclControl = static_cast<SbaGridControl*>(pPeer->GetWindow().get()); - pTHIS->startComponentListening(Reference<XComponent>(VCLUnoHelper::GetInterface(m_pVclControl),UNO_QUERY)); + pTHIS->startComponentListening(VCLUnoHelper::GetInterface(m_pVclControl)); } } } @@ -291,7 +291,7 @@ void UnoDataBrowserView::GetFocus() void UnoDataBrowserView::_disposing( const css::lang::EventObject& /*_rSource*/ ) { - stopComponentListening(Reference<XComponent>(VCLUnoHelper::GetInterface(m_pVclControl),UNO_QUERY)); + stopComponentListening(VCLUnoHelper::GetInterface(m_pVclControl)); m_pVclControl = nullptr; } diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx index 78ab9779d967..114c7e0dfb03 100644 --- a/dbaccess/source/ui/browser/dataview.cxx +++ b/dbaccess/source/ui/browser/dataview.cxx @@ -147,7 +147,7 @@ namespace dbaui try { Reference< XController > xController( m_xController->getXController(), UNO_SET_THROW ); - Reference< XModel > xModel( xController->getModel(), UNO_QUERY ); + Reference< XModel > xModel = xController->getModel(); if ( xModel.is() ) { ::comphelper::NamedValueCollection aArgs( xModel->getArgs() ); diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index d4d5b03a0c6b..29ccb0e642b7 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -1058,7 +1058,7 @@ Reference< awt::XWindow> OGenericUnoController::getTopMostContainerWindow() cons while ( xFrame.is() && !xFrame->isTop() ) { - xFrame.set( xFrame->getCreator(), UNO_QUERY ); + xFrame = xFrame->getCreator(); } if ( xFrame.is() ) xWindow = xFrame->getContainerWindow(); diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 0a8eabdc1d53..059f9ac5542f 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -749,7 +749,7 @@ void SbaGridControl::SetColWidth(sal_uInt16 nColId) { // get the (UNO) column model sal_uInt16 nModelPos = GetModelColumnPos(nColId); - Reference< XIndexAccess > xCols(GetPeer()->getColumns(), UNO_QUERY); + Reference< XIndexAccess > xCols = GetPeer()->getColumns(); Reference< XPropertySet > xAffectedCol; if (xCols.is() && (nModelPos != sal_uInt16(-1))) xAffectedCol.set(xCols->getByIndex(nModelPos), css::uno::UNO_QUERY); @@ -828,7 +828,7 @@ void SbaGridControl::SetColAttrs(sal_uInt16 nColId) sal_uInt16 nModelPos = GetModelColumnPos(nColId); // get the (UNO) column model - Reference< XIndexAccess > xCols(GetPeer()->getColumns(), UNO_QUERY); + Reference< XIndexAccess > xCols = GetPeer()->getColumns(); Reference< XPropertySet > xAffectedCol; if (xCols.is() && (nModelPos != sal_uInt16(-1))) xAffectedCol.set(xCols->getByIndex(nModelPos), css::uno::UNO_QUERY); @@ -926,7 +926,7 @@ Reference< XPropertySet > SbaGridControl::getField(sal_uInt16 nModelPos) try { // first get the name of the column - Reference< XIndexAccess > xCols(GetPeer()->getColumns(), UNO_QUERY); + Reference< XIndexAccess > xCols = GetPeer()->getColumns(); if ( xCols.is() && xCols->getCount() > nModelPos ) { Reference< XPropertySet > xCol(xCols->getByIndex(nModelPos),UNO_QUERY); @@ -1089,7 +1089,7 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) { - Reference< XPropertySet > xDataSource(getDataSource(), UNO_QUERY); + Reference< XPropertySet > xDataSource = getDataSource(); OSL_ENSURE(xDataSource.is(), "SbaGridControl::DoColumnDrag : invalid data source !"); Reference< XPropertySet > xAffectedCol; @@ -1103,7 +1103,7 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) xActiveConnection = ::dbtools::getConnection(Reference< XRowSet >(getDataSource(),UNO_QUERY)); sal_uInt16 nModelPos = GetModelColumnPos(GetColumnIdFromViewPos(nColumnPos)); - Reference< XIndexContainer > xCols(GetPeer()->getColumns(), UNO_QUERY); + Reference< XIndexContainer > xCols = GetPeer()->getColumns(); xAffectedCol.set(xCols->getByIndex(nModelPos),UNO_QUERY); if (xAffectedCol.is()) { @@ -1130,7 +1130,7 @@ void SbaGridControl::CopySelectedRowsToClipboard() void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag ) { - Reference< XPropertySet > xForm( getDataSource(), UNO_QUERY ); + Reference< XPropertySet > xForm = getDataSource(); OSL_ENSURE( xForm.is(), "SbaGridControl::implTransferSelectedRows: invalid form!" ); // build the sequence of numbers of selected rows diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 9c7f5ce9b62e..7f13583dd497 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -581,10 +581,9 @@ void SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm Reference< XNameContainer > xColContainer(xGrid, UNO_QUERY); clearGridColumns( xColContainer ); - Reference< XChild > xGridAsChild(xGrid, UNO_QUERY); Reference< XLoadable > xFormAsLoadable; - if (xGridAsChild.is()) - xFormAsLoadable.set(xGridAsChild->getParent(), css::uno::UNO_QUERY); + if (xGrid.is()) + xFormAsLoadable.set(xGrid->getParent(), css::uno::UNO_QUERY); if (xFormAsLoadable.is() && xFormAsLoadable->isLoaded()) { // set the formats from the table @@ -818,7 +817,7 @@ void SbaTableQueryBrowser::transferChangedControlProperty(const OUString& _rProp if(m_pCurrentlyDisplayed) { DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); - Reference< XPropertySet > xObjectProps(pData->xObjectProperties, UNO_QUERY); + Reference< XPropertySet > xObjectProps = pData->xObjectProperties; OSL_ENSURE(xObjectProps.is(),"SbaTableQueryBrowser::transferChangedControlProperty: no table/query object!"); if (xObjectProps.is()) xObjectProps->setPropertyValue(_rProperty, _rNewValue); diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 5bb1bf5a6d2a..6154cb7a789d 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -540,8 +540,8 @@ namespace dbaui { ::ucbhelper::Content aCheckExistence; IS_PATH_EXIST eExists = PATH_NOT_EXIST; - Reference< css::task::XInteractionHandler > xInteractionHandler( - task::InteractionHandler::createWithParent(m_xORB, nullptr), UNO_QUERY ); + Reference< css::task::XInteractionHandler > xInteractionHandler = + task::InteractionHandler::createWithParent(m_xORB, nullptr); OFilePickerInteractionHandler* pHandler = new OFilePickerInteractionHandler(xInteractionHandler); xInteractionHandler = pHandler; diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 1f86ff57d645..26ffae2aff03 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -238,7 +238,7 @@ bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyVal if ( !xHandler.is() ) { // instantiate the default SDB interaction handler - xHandler.set( task::InteractionHandler::createWithParent(m_xContext, nullptr), UNO_QUERY ); + xHandler = task::InteractionHandler::createWithParent(m_xContext, nullptr); } OUString sName = pName ? pName->GetValue() : OUString(); diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 5c80f2acbef0..4cd6b43d889f 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -187,7 +187,7 @@ SQLExceptionInfo createConnection( const Reference< css::beans::XPropertySet>& } else { // instantiate the default SDB interaction handler - Reference< XInteractionHandler > xHandler( InteractionHandler::createWithParent(_rxContext, nullptr), UNO_QUERY); + Reference< XInteractionHandler > xHandler = InteractionHandler::createWithParent(_rxContext, nullptr); _rOUTConnection = xConnectionCompletion->connectWithCompletion(xHandler); } } diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index ececd0aa2f40..fc1b2ac38d82 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -607,7 +607,7 @@ OCopyTableWizard::OCopyTableWizard( vcl::Window* pParent, const OUString& _rDefa ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aTypeInfo, m_aTypeInfoIndex ); ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aDestTypeInfo, m_aDestTypeInfoIndex ); - m_xInteractionHandler.set( InteractionHandler::createWithParent(m_xContext, nullptr), UNO_QUERY ); + m_xInteractionHandler = InteractionHandler::createWithParent(m_xContext, nullptr); VclPtrInstance<OCopyTable> pPage1( this ); pPage1->disallowViews(); diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx index f1c8dd1c0032..a7cd4359dfd6 100644 --- a/dbaccess/source/ui/misc/datasourceconnector.cxx +++ b/dbaccess/source/ui/misc/datasourceconnector.cxx @@ -80,10 +80,8 @@ namespace dbaui return xConnection; // get the data source - Reference< XDataSource > xDatasource( - getDataSourceByName( _rDataSourceName, m_pErrorMessageParent, m_xContext, _pErrorInfo ), - UNO_QUERY - ); + Reference< XDataSource > xDatasource = + getDataSourceByName( _rDataSourceName, m_pErrorMessageParent, m_xContext, _pErrorInfo ); if ( xDatasource.is() ) xConnection = connect( xDatasource, _pErrorInfo ); @@ -129,7 +127,7 @@ namespace dbaui if ( !xHandler.is() ) { // instantiate the default SDB interaction handler - xHandler.set( InteractionHandler::createWithParent(m_xContext, VCLUnoHelper::GetInterface(m_pErrorMessageParent)), UNO_QUERY ); + xHandler = InteractionHandler::createWithParent(m_xContext, VCLUnoHelper::GetInterface(m_pErrorMessageParent)); } xConnection = xConnectionCompletion->connectWithCompletion(xHandler); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 3b4840492269..eaeabf30ee86 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1162,7 +1162,7 @@ void OQueryController::executeQuery() xDisp->dispatch(aWantToDispatch, aProps); // check the state of the beamer // be notified when the beamer frame is closed - Reference< XComponent > xComponent( getFrame()->findFrame( sFrameName, nSearchFlags ), UNO_QUERY ); + Reference< XComponent > xComponent = getFrame()->findFrame( sFrameName, nSearchFlags ); if (xComponent.is()) { OSL_ENSURE(Reference< XFrame >(xComponent, UNO_QUERY).get() == getContainer()->getPreviewFrame().get(), diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 6da6bd154816..8c0470154a78 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -721,7 +721,7 @@ void OTableController::appendPrimaryKey(Reference<XKeysSupplier> const & _rxSup, return; // the database doesn't support keys OSL_ENSURE(_rxSup.is(),"No XKeysSupplier!"); - Reference<XIndexAccess> xKeys(_rxSup->getKeys(),UNO_QUERY); + Reference<XIndexAccess> xKeys = _rxSup->getKeys(); Reference<XPropertySet> xProp; if (!xKeys.is()) return; diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index ee886b365b1b..d17ce9ce5e67 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1469,7 +1469,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) ); } if ( !m_xInteractionHandler.is() ) - m_xInteractionHandler.set( InteractionHandler::createWithParent(m_xContext, nullptr), UNO_QUERY ); + m_xInteractionHandler = InteractionHandler::createWithParent(m_xContext, nullptr); Reference< XInteractionHandler > xSourceDocHandler; Reference< XPropertySet > xSourceDescriptor( impl_ensureDataAccessDescriptor_throw( _rArguments, 0, m_xSourceConnection, xSourceDocHandler ) ); |