From cb4fa1d1e2e61b686442a9d26220c0f1a6e1d4e7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 30 Oct 2015 07:59:06 +0200 Subject: use uno::Reference::set method instead of assignment Change-Id: I080668f86f0ab8b3bba857ee21411f907ae285c4 --- comphelper/source/container/container.cxx | 2 +- .../source/container/embeddedobjectcontainer.cxx | 21 +++++++++------------ .../source/eventattachermgr/eventattachermgr.cxx | 2 +- comphelper/source/misc/dispatchcommand.cxx | 2 +- comphelper/source/misc/instancelocker.cxx | 6 +++--- comphelper/source/misc/logging.cxx | 2 +- comphelper/source/misc/mimeconfighelper.cxx | 9 ++++----- comphelper/source/streaming/seekableinput.cxx | 8 ++++---- comphelper/source/streaming/seqinputstreamserv.cxx | 4 ++-- comphelper/source/streaming/seqoutputstreamserv.cxx | 2 +- configmgr/qa/unit/test.cxx | 2 +- configmgr/source/components.cxx | 3 +-- configmgr/source/configurationregistry.cxx | 2 +- .../source/commontools/TPrivilegesResultSet.cxx | 2 +- connectivity/source/commontools/dbtools.cxx | 4 ++-- connectivity/source/commontools/dbtools2.cxx | 12 ++++++------ connectivity/source/commontools/predicateinput.cxx | 5 +---- connectivity/source/cpool/ZDriverWrapper.cxx | 2 +- .../source/drivers/firebird/StatementCommonBase.cxx | 2 +- connectivity/source/drivers/hsqldb/HDriver.cxx | 2 +- .../source/drivers/macab/MacabStatement.cxx | 2 +- connectivity/source/drivers/mork/MStatement.cxx | 2 +- connectivity/source/drivers/mysql/YDriver.cxx | 4 ++-- .../drivers/postgresql/pq_databasemetadata.cxx | 6 +++--- .../source/drivers/postgresql/pq_driver.cxx | 2 +- .../drivers/postgresql/pq_preparedstatement.cxx | 2 +- .../source/drivers/postgresql/pq_statement.cxx | 4 ++-- connectivity/workben/little/main.cxx | 2 +- cppuhelper/source/propertysetmixin.cxx | 2 +- cppuhelper/source/servicemanager.cxx | 6 ++---- cppuhelper/test/testpropshlp.cxx | 4 ++-- cpputools/source/unoexe/unoexe.cxx | 2 +- cui/source/customize/acccfg.cxx | 11 +++++------ cui/source/customize/cfg.cxx | 18 ++++++------------ cui/source/customize/cfgutil.cxx | 2 +- cui/source/customize/selector.cxx | 3 +-- cui/source/dialogs/insdlg.cxx | 4 ++-- cui/source/options/optaboutconfig.cxx | 2 +- cui/source/options/optasian.cxx | 3 +-- cui/source/options/optdict.cxx | 5 ++--- cui/source/options/optgdlg.cxx | 4 ++-- cui/source/options/optlingu.cxx | 14 ++++++-------- cui/source/options/optsave.cxx | 3 +-- cui/source/options/treeopt.cxx | 5 ++--- 44 files changed, 91 insertions(+), 115 deletions(-) diff --git a/comphelper/source/container/container.cxx b/comphelper/source/container/container.cxx index 9bd468e9d450..a8bd89639451 100644 --- a/comphelper/source/container/container.cxx +++ b/comphelper/source/container/container.cxx @@ -79,7 +79,7 @@ css::uno::Reference< css::uno::XInterface> IndexAccessIterator::Next() OSL_ENSURE(xChild.is(), "IndexAccessIterator::Next : a content has no appropriate interface !"); css::uno::Reference< css::uno::XInterface> xParent( xChild->getParent()); - xContainerAccess = css::uno::Reference< css::container::XIndexAccess>(xParent, css::uno::UNO_QUERY); + xContainerAccess.set(xParent, css::uno::UNO_QUERY); OSL_ENSURE(xContainerAccess.is(), "IndexAccessIterator::Next : a content has an invalid parent !"); // Remove the index that SearchLoop had within this parent from my stack diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index caa2d251b124..fa86241957ec 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -174,7 +174,7 @@ void EmbeddedObjectContainer::ReleaseImageSubStorage() try { pImpl->mxImageStorage->dispose(); - pImpl->mxImageStorage = uno::Reference< embed::XStorage >(); + pImpl->mxImageStorage.clear(); } catch (const uno::Exception&) { @@ -346,7 +346,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::Get_Impl( con uno::Sequence< beans::PropertyValue > aMediaDescr( 1 ); aMediaDescr[0].Name = "ReadOnly"; aMediaDescr[0].Value <<= bReadOnlyMode; - xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitFromEntry( + xObj.set( xFactory->createInstanceInitFromEntry( pImpl->mxStorage, rName, aMediaDescr, aObjDescr ), uno::UNO_QUERY ); @@ -379,7 +379,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbedde aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); ::std::copy( rArgs.begin(), rArgs.end(), aObjDescr.getArray() + 1 ); - xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew( + xObj.set( xFactory->createInstanceInitNew( rClassId, OUString(), pImpl->mxStorage, rNewName, aObjDescr ), uno::UNO_QUERY ); @@ -595,7 +595,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde uno::Sequence< beans::PropertyValue > aObjDescr( 1 ); aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); - xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitFromMediaDescriptor( + xObj.set( xFactory->createInstanceInitFromMediaDescriptor( pImpl->mxStorage, rNewName, aMedium, aObjDescr ), uno::UNO_QUERY ); uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY ); @@ -627,8 +627,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde uno::Sequence< beans::PropertyValue > aObjDescr( 1 ); aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); - xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceLink( - pImpl->mxStorage, rNewName, aMedium, aObjDescr ), uno::UNO_QUERY ); + xObj.set( xFactory->createInstanceLink( pImpl->mxStorage, rNewName, aMedium, aObjDescr ), uno::UNO_QUERY ); uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY ); @@ -716,8 +715,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb uno::Sequence< beans::PropertyValue > aObjDescr( 1 ); aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); - xResult = uno::Reference < embed::XEmbeddedObject >( - xCreator->createInstanceLink( + xResult.set(xCreator->createInstanceLink( pImpl->mxStorage, rName, aMediaDescr, @@ -740,8 +738,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb uno::Sequence< beans::PropertyValue > aObjDescr( 1 ); aObjDescr[0].Name = "Parent"; aObjDescr[0].Value <<= pImpl->m_xModel.get(); - xResult = uno::Reference < embed::XEmbeddedObject >( - xCreator->createInstanceInitNew( + xResult.set(xCreator->createInstanceInitNew( xObj->getClassID(), xObj->getClassName(), pImpl->mxStorage, @@ -791,7 +788,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb catch (const uno::Exception&) { } - xResult = uno::Reference< embed::XEmbeddedObject >(); + xResult.clear(); } } } @@ -996,7 +993,7 @@ bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < embed xPersist->storeAsEntry( pImpl->mxTempStorage, aTmpPersistName, aSeq, aSeq ); xPersist->saveCompleted( sal_True ); - pImpl->maTempObjectContainer[ aTmpPersistName ] = uno::Reference < embed::XEmbeddedObject >(); + pImpl->maTempObjectContainer[ aTmpPersistName ].clear(); */ if ( !pImpl->mpTempObjectContainer ) diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx index 6140d5c294e4..12101471bc97 100644 --- a/comphelper/source/eventattachermgr/eventattachermgr.cxx +++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx @@ -369,7 +369,7 @@ ImplEventAttacherManager::ImplEventAttacherManager( const Reference< XIntrospect "com.sun.star.script.EventAttacher", rContext) ); if ( xIFace.is() ) { - xAttacher = Reference< XEventAttacher2 >::query( xIFace ); + xAttacher.set( xIFace, UNO_QUERY ); } xConverter = Converter::create(rContext); } diff --git a/comphelper/source/misc/dispatchcommand.cxx b/comphelper/source/misc/dispatchcommand.cxx index 5de05542dbb4..160c08a930c7 100644 --- a/comphelper/source/misc/dispatchcommand.cxx +++ b/comphelper/source/misc/dispatchcommand.cxx @@ -38,7 +38,7 @@ bool dispatchCommand(const OUString& rCommand, const css::uno::Sequence xFrame(xDesktop->getActiveFrame()); if (!xFrame.is()) - xFrame = uno::Reference(xDesktop, uno::UNO_QUERY); + xFrame.set(xDesktop, uno::UNO_QUERY); uno::Reference xDispatchProvider(xFrame, uno::UNO_QUERY); if (!xDispatchProvider.is()) diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx index 204d1a9baca3..d43ecf606923 100644 --- a/comphelper/source/misc/instancelocker.cxx +++ b/comphelper/source/misc/instancelocker.cxx @@ -90,7 +90,7 @@ void SAL_CALL OInstanceLocker::dispose() m_pLockListener->Dispose(); m_pLockListener = NULL; } - m_xLockListener = uno::Reference< uno::XInterface >(); + m_xLockListener.clear(); } m_bDisposed = true; @@ -177,7 +177,7 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg xInstance, nModes, xApproval ); - m_xLockListener = uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( m_pLockListener ) ); + m_xLockListener.set( static_cast< OWeakObject* >( m_pLockListener ) ); m_pLockListener->Init(); } catch( uno::Exception& ) @@ -289,7 +289,7 @@ void OLockListener::Dispose() {} } - m_xInstance = uno::Reference< uno::XInterface >(); + m_xInstance.clear(); m_bDisposed = true; } diff --git a/comphelper/source/misc/logging.cxx b/comphelper/source/misc/logging.cxx index e6cef1d74454..0790567c212a 100644 --- a/comphelper/source/misc/logging.cxx +++ b/comphelper/source/misc/logging.cxx @@ -214,7 +214,7 @@ namespace comphelper Reference< XResourceBundleLoader > xLoader( css::resource::OfficeResourceLoader::get( _rContext ) ); - _rLoggerData.xBundle = Reference< XResourceBundle >( xLoader->loadBundle_Default( _rLoggerData.sBundleBaseName ), UNO_QUERY_THROW ); + _rLoggerData.xBundle.set( xLoader->loadBundle_Default( _rLoggerData.sBundleBaseName ), UNO_QUERY_THROW ); } catch( const Exception& e ) { diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx index d17d650a8e5c..6dc3e21d332e 100644 --- a/comphelper/source/misc/mimeconfighelper.cxx +++ b/comphelper/source/misc/mimeconfighelper.cxx @@ -132,11 +132,10 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetConfigurati aPathProp.Value <<= aPath; aArgs[0] <<= aPathProp; - xConfig = uno::Reference< container::XNameAccess >( - m_xConfigProvider->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationAccess", - aArgs ), - uno::UNO_QUERY ); + xConfig.set( m_xConfigProvider->createInstanceWithArguments( + "com.sun.star.configuration.ConfigurationAccess", + aArgs ), + uno::UNO_QUERY ); } catch( uno::Exception& ) {} diff --git a/comphelper/source/streaming/seekableinput.cxx b/comphelper/source/streaming/seekableinput.cxx index da3b3690516f..7a39696f0497 100644 --- a/comphelper/source/streaming/seekableinput.cxx +++ b/comphelper/source/streaming/seekableinput.cxx @@ -103,7 +103,7 @@ void OSeekableInputWrapper::PrepareCopy_Impl() if ( xTempSeek.is() ) { xTempSeek->seek( 0 ); - m_xCopyInput = uno::Reference< io::XInputStream >( xTempOut, uno::UNO_QUERY ); + m_xCopyInput.set( xTempOut, uno::UNO_QUERY ); if ( m_xCopyInput.is() ) m_xCopySeek = xTempSeek; } @@ -193,15 +193,15 @@ void SAL_CALL OSeekableInputWrapper::closeInput() throw io::NotConnectedException(); m_xOriginalStream->closeInput(); - m_xOriginalStream = uno::Reference< io::XInputStream >(); + m_xOriginalStream.clear(); if ( m_xCopyInput.is() ) { m_xCopyInput->closeInput(); - m_xCopyInput = uno::Reference< io::XInputStream >(); + m_xCopyInput.clear(); } - m_xCopySeek = uno::Reference< io::XSeekable >(); + m_xCopySeek.clear(); } diff --git a/comphelper/source/streaming/seqinputstreamserv.cxx b/comphelper/source/streaming/seqinputstreamserv.cxx index c795a48b15b3..306a5e68d283 100644 --- a/comphelper/source/streaming/seqinputstreamserv.cxx +++ b/comphelper/source/streaming/seqinputstreamserv.cxx @@ -167,8 +167,8 @@ void SAL_CALL SequenceInputStreamService::closeInput() throw ( uno::RuntimeExcep throw io::NotConnectedException(); m_xInputStream->closeInput(); - m_xInputStream = uno::Reference< io::XInputStream >(); - m_xSeekable = uno::Reference< io::XSeekable >(); + m_xInputStream.clear(); + m_xSeekable.clear(); } // css::io::XSeekable: diff --git a/comphelper/source/streaming/seqoutputstreamserv.cxx b/comphelper/source/streaming/seqoutputstreamserv.cxx index 33b8c9c2602d..65f2fa75b891 100644 --- a/comphelper/source/streaming/seqoutputstreamserv.cxx +++ b/comphelper/source/streaming/seqoutputstreamserv.cxx @@ -137,7 +137,7 @@ void SAL_CALL SequenceOutputStreamService::closeOutput() throw ( uno::RuntimeExc throw io::NotConnectedException(); m_xOutputStream->closeOutput(); - m_xOutputStream = uno::Reference< io::XOutputStream >(); + m_xOutputStream.clear(); } // css::io::XSequenceOutputStream: diff --git a/configmgr/qa/unit/test.cxx b/configmgr/qa/unit/test.cxx index 89dac95c113f..82c9b1e75ed9 100644 --- a/configmgr/qa/unit/test.cxx +++ b/configmgr/qa/unit/test.cxx @@ -151,7 +151,7 @@ RecursiveTest::RecursiveTest( void RecursiveTest::test() { - properties_ = css::uno::Reference< css::beans::XPropertySet >( + properties_.set( test_.createUpdateAccess( OUString("/org.openoffice.Office.UI.GenericCommands/UserInterface/Commands/" ".uno:WebHtml")), diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index c1aec0702788..40e1eb610ff2 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -438,8 +438,7 @@ css::beans::Optional< css::uno::Any > Components::getExternalValue( } css::uno::Reference< css::beans::XPropertySet > propset; if (service.is()) { - propset = css::uno::Reference< css::beans::XPropertySet >( - service, css::uno::UNO_QUERY_THROW); + propset.set( service, css::uno::UNO_QUERY_THROW); } j = externalServices_.insert( ExternalServices::value_type(name, propset)).first; diff --git a/configmgr/source/configurationregistry.cxx b/configmgr/source/configurationregistry.cxx index 4fadaf6a1f8b..2d0274628292 100644 --- a/configmgr/source/configurationregistry.cxx +++ b/configmgr/source/configurationregistry.cxx @@ -323,7 +323,7 @@ Service::Service( { assert(context.is()); try { - provider_ = css::uno::Reference< css::lang::XMultiServiceFactory >( + provider_.set( context->getServiceManager()->createInstanceWithContext( "com.sun.star.configuration.DefaultProvider", context), css::uno::UNO_QUERY_THROW); diff --git a/connectivity/source/commontools/TPrivilegesResultSet.cxx b/connectivity/source/commontools/TPrivilegesResultSet.cxx index d6eb7e4c4bf9..573a30e1a979 100644 --- a/connectivity/source/commontools/TPrivilegesResultSet.cxx +++ b/connectivity/source/commontools/TPrivilegesResultSet.cxx @@ -46,7 +46,7 @@ OResultSetPrivileges::OResultSetPrivileges( const Reference< XDatabaseMetaData>& try { m_xTables = _rxMeta->getTables(catalog,schemaPattern,tableNamePattern,sTableTypes); - m_xRow = Reference< XRow>(m_xTables,UNO_QUERY); + m_xRow.set(m_xTables,UNO_QUERY); sUserWorkingFor = _rxMeta->getUserName(); } diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index a5ef047bd7e6..3380879e2876 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -998,7 +998,7 @@ try // for formatted fields (either old or new) we have some special treatments Reference< XServiceInfo > xSI( xOldProps, UNO_QUERY ); bool bOldIsFormatted = xSI.is() && xSI->supportsService( sFormattedServiceName ); - xSI = Reference< XServiceInfo >( xNewProps, UNO_QUERY ); + xSI.set( xNewProps, UNO_QUERY ); bool bNewIsFormatted = xSI.is() && xSI->supportsService( sFormattedServiceName ); if (!bOldIsFormatted && !bNewIsFormatted) @@ -1701,7 +1701,7 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer, OSL_ENSURE(_rxHandler.is(),"dbtools::askForParameters XInteractionHandler is null!"); // we have to set this here again because getCurrentSettingsComposer can force a setpropertyvalue - Reference xParameters = Reference (_xComposer, UNO_QUERY); + Reference xParameters(_xComposer, UNO_QUERY); Reference xParamsAsIndicies = xParameters.is() ? xParameters->getParameters() : Reference(); sal_Int32 nParamCount = xParamsAsIndicies.is() ? xParamsAsIndicies->getCount() : 0; diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 7f5b6809dfb1..c59a5513e491 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -296,8 +296,8 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor, ::dbtools::throwFunctionSequenceException(_xConnection); bPKey = true; - xColumnSup = Reference(xColProp,UNO_QUERY); - xColumns = Reference(xColumnSup->getColumns(),UNO_QUERY); + xColumnSup.set(xColProp,UNO_QUERY); + xColumns.set(xColumnSup->getColumns(),UNO_QUERY); if(!xColumns.is() || !xColumns->getCount()) ::dbtools::throwFunctionSequenceException(_xConnection); @@ -306,8 +306,8 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor, } else if(nKeyType == KeyType::UNIQUE) { - xColumnSup = Reference(xColProp,UNO_QUERY); - xColumns = Reference(xColumnSup->getColumns(),UNO_QUERY); + xColumnSup.set(xColProp,UNO_QUERY); + xColumns.set(xColumnSup->getColumns(),UNO_QUERY); if(!xColumns.is() || !xColumns->getCount()) ::dbtools::throwFunctionSequenceException(_xConnection); @@ -318,8 +318,8 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor, { sal_Int32 nDeleteRule = getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DELETERULE))); - xColumnSup = Reference(xColProp,UNO_QUERY); - xColumns = Reference(xColumnSup->getColumns(),UNO_QUERY); + xColumnSup.set(xColProp,UNO_QUERY); + xColumns.set(xColumnSup->getColumns(),UNO_QUERY); if(!xColumns.is() || !xColumns->getCount()) ::dbtools::throwFunctionSequenceException(_xConnection); diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index 5a4fe74a7913..c8c719406181 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -106,10 +106,7 @@ namespace dbtools OSL_ENSURE( rxContext.is(), "OPredicateInputController::OPredicateInputController: need a service factory!" ); if ( rxContext.is() ) { - m_xFormatter = Reference< XNumberFormatter >( - NumberFormatter::create(rxContext), - UNO_QUERY_THROW - ); + m_xFormatter.set( NumberFormatter::create(rxContext), UNO_QUERY_THROW ); } Reference< XNumberFormatsSupplier > xNumberFormats = ::dbtools::getNumberFormats( m_xConnection, true ); diff --git a/connectivity/source/cpool/ZDriverWrapper.cxx b/connectivity/source/cpool/ZDriverWrapper.cxx index d4defb5d8db9..d780e3181e42 100644 --- a/connectivity/source/cpool/ZDriverWrapper.cxx +++ b/connectivity/source/cpool/ZDriverWrapper.cxx @@ -47,7 +47,7 @@ namespace connectivity _rxAggregateDriver = NULL; // a second "real" reference - m_xDriver = Reference< XDriver >(m_xDriverAggregate, UNO_QUERY); + m_xDriver.set(m_xDriverAggregate, UNO_QUERY); OSL_ENSURE(m_xDriver.is(), "ODriverWrapper::ODriverWrapper: invalid aggregate (no XDriver)!"); // set ourself as delegator diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx b/connectivity/source/drivers/firebird/StatementCommonBase.cxx index 13d11ac01c22..55b488906f46 100644 --- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx +++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx @@ -61,7 +61,7 @@ void OStatementCommonBase::disposeResultSet() uno::Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY); if (xComp.is()) xComp->dispose(); - m_xResultSet = uno::Reference< XResultSet>(); + m_xResultSet.clear(); } void OStatementCommonBase::freeStatementHandle() diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 6ca1953449e9..2e4c7560a28d 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -461,7 +461,7 @@ namespace connectivity { if ( i->second.second.first.get() == connection.get() ) { - xTab = Reference< XTablesSupplier >(i->second.second.second.get().get(),UNO_QUERY); + xTab.set(i->second.second.second.get().get(),UNO_QUERY); if ( !xTab.is() ) { xTab = new OHCatalog(connection); diff --git a/connectivity/source/drivers/macab/MacabStatement.cxx b/connectivity/source/drivers/macab/MacabStatement.cxx index a7ece0a27cf3..7d334018377f 100644 --- a/connectivity/source/drivers/macab/MacabStatement.cxx +++ b/connectivity/source/drivers/macab/MacabStatement.cxx @@ -460,7 +460,7 @@ OSL_TRACE("Mac OS Address book - SQL Request: %s", OUtoCStr(sql)); impl_throwError(STR_QUERY_TOO_COMPLEX); } - m_xResultSet = Reference(pResult); + m_xResultSet.set(pResult); return xRS; } diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx index bdb6edeb6ab4..0d6883faf07d 100644 --- a/connectivity/source/drivers/mork/MStatement.cxx +++ b/connectivity/source/drivers/mork/MStatement.cxx @@ -182,7 +182,7 @@ OCommonStatement::StatementType OCommonStatement::parseSql( const OUString& sql m_pTable = static_cast< OTable* > (xTabs.begin()->second.get()); m_xColNames = m_pTable->getColumns(); - xNames = Reference(m_xColNames,UNO_QUERY); + xNames.set(m_xColNames,UNO_QUERY); // set the binding of the resultrow m_aRow = new OValueVector(xNames->getCount()); (m_aRow->get())[0].setBound(true); diff --git a/connectivity/source/drivers/mysql/YDriver.cxx b/connectivity/source/drivers/mysql/YDriver.cxx index f69c031e9866..60662f347fcf 100644 --- a/connectivity/source/drivers/mysql/YDriver.cxx +++ b/connectivity/source/drivers/mysql/YDriver.cxx @@ -410,7 +410,7 @@ namespace connectivity { if ( i->second.second == pConnection ) { - xTab = Reference< XTablesSupplier >(i->second.first.get().get(),UNO_QUERY); + xTab.set(i->second.first.get().get(),UNO_QUERY); if ( !xTab.is() ) { xTab = new OMySQLCatalog(connection); @@ -429,7 +429,7 @@ namespace connectivity Reference< XConnection > xTemp(i->first.get(),UNO_QUERY); if ( xTemp == connection ) { - xTab = Reference< XTablesSupplier >(i->second.first.get().get(),UNO_QUERY); + xTab.set(i->second.first.get().get(),UNO_QUERY); if ( !xTab.is() ) { xTab = new OMySQLCatalog(connection); diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index 701bad72a47c..a742d4aa7742 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -1436,7 +1436,7 @@ static void columnMetaData2DatabaseTypeDescription( if( domains ) { Reference< XResultSet > rsDomain = stmt->executeQuery( queryBuf.makeStringAndClear() ); - row = Reference< XRow >( rsDomain, UNO_QUERY_THROW ); + row.set( rsDomain, UNO_QUERY_THROW ); while( rsDomain->next() ) { oidMap[row->getInt(1)] = DatabaseTypeDescription(row->getString(3), row->getString(2) ); @@ -1815,12 +1815,12 @@ static void columnMetaData2DatabaseTypeDescription( "pg_attribute AS att, pg_class AS cl WHERE " "att.attrelid = ? AND att.attnum = ?" ); - parameters = Reference< XParameters >( statement, UNO_QUERY_THROW ); + parameters.set( statement, UNO_QUERY_THROW ); parameters->setString( 1 , tableOid ); parameters->setString( 2 , attnum ); rs = statement->executeQuery(); - xRow = Reference< XRow >( rs, UNO_QUERY_THROW ); + xRow.set( rs, UNO_QUERY_THROW ); if( rs->next() ) { // column name diff --git a/connectivity/source/drivers/postgresql/pq_driver.cxx b/connectivity/source/drivers/postgresql/pq_driver.cxx index 672d0ee974b2..8ff522348834 100644 --- a/connectivity/source/drivers/postgresql/pq_driver.cxx +++ b/connectivity/source/drivers/postgresql/pq_driver.cxx @@ -270,7 +270,7 @@ void OOneInstanceComponentFactory::disposing() Reference< XComponent > rComp; { MutexGuard guard( osl::Mutex::getGlobalMutex() ); - rComp = Reference< XComponent >( m_theInstance, UNO_QUERY ); + rComp.set( m_theInstance, UNO_QUERY ); m_theInstance.clear(); } if( rComp.is() ) diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx index f11ada3dfb64..6e624ac1316f 100644 --- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx +++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx @@ -429,7 +429,7 @@ sal_Bool PreparedStatement::execute( ) data.pLastTableInserted = &m_lastTableInserted; data.pLastResultset = &m_lastResultset; data.owner = *this; - data.tableSupplier = Reference< com::sun::star::sdbcx::XTablesSupplier >( m_connection, UNO_QUERY ); + data.tableSupplier.set( m_connection, UNO_QUERY ); data.concurrency = extractIntProperty( this, getStatics().RESULT_SET_CONCURRENCY ); return executePostgresCommand( m_executedStatement , &data ); // see pq_statement.cxx diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index e37e7f9d5dc6..03c1c31d5576 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -368,7 +368,7 @@ static Sequence< OUString > lookupKeys( } break; } - keySupplier = Reference< XKeysSupplier > ( set, UNO_QUERY ); + keySupplier.set( set, UNO_QUERY ); } } } @@ -854,7 +854,7 @@ sal_Bool Statement::execute( const OUString& sql ) data.pLastTableInserted = &m_lastTableInserted; data.pLastResultset = &m_lastResultset; data.owner = *this; - data.tableSupplier = Reference< com::sun::star::sdbcx::XTablesSupplier >( m_connection, UNO_QUERY ); + data.tableSupplier.set( m_connection, UNO_QUERY ); data.concurrency = extractIntProperty( this, getStatics().RESULT_SET_CONCURRENCY ); return executePostgresCommand( cmd , &data ); diff --git a/connectivity/workben/little/main.cxx b/connectivity/workben/little/main.cxx index 346f60020ca7..3769c478e72d 100644 --- a/connectivity/workben/little/main.cxx +++ b/connectivity/workben/little/main.cxx @@ -53,7 +53,7 @@ void main( int argc, char * argv[] ) if(!xFac.is()) return; - m_xDriver = Reference(xFac->createInstance("com.sun.star.sdbc.driver.dbase.Driver"),UNO_QUERY); + m_xDriver.set(xFac->createInstance("com.sun.star.sdbc.driver.dbase.Driver"),UNO_QUERY); if(m_xDriver.is()) { diff --git a/cppuhelper/source/propertysetmixin.cxx b/cppuhelper/source/propertysetmixin.cxx index 4b42d33e3368..c4de4fa547ae 100644 --- a/cppuhelper/source/propertysetmixin.cxx +++ b/cppuhelper/source/propertysetmixin.cxx @@ -435,7 +435,7 @@ PropertySetMixinImpl::Impl::Impl( m_idlClass = getReflection(m_type.getTypeName()); css::uno::Reference< css::reflection::XTypeDescription > ifc; try { - ifc = css::uno::Reference< css::reflection::XTypeDescription >( + ifc.set( css::uno::Reference< css::container::XHierarchicalNameAccess >( m_context->getValueByName( "/singletons/com.sun.star.reflection." diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index 97a831dfeddf..cd9ec85969d1 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -834,8 +834,7 @@ void cppuhelper::ServiceManager::loadImplementation( css::uno::Reference< css::lang::XMultiComponentFactory > smgr; if (implementation->info->alienContext.is()) { ctxt = implementation->info->alienContext; - smgr = css::uno::Reference< css::lang::XMultiComponentFactory >( - ctxt->getServiceManager(), css::uno::UNO_SET_THROW); + smgr.set(ctxt->getServiceManager(), css::uno::UNO_SET_THROW); } else { assert(context.is()); ctxt = context; @@ -1620,8 +1619,7 @@ void cppuhelper::ServiceManager::insertLegacyFactory( factoryInfo, css::uno::UNO_QUERY); css::uno::Reference< css::lang::XSingleServiceFactory > f2; if (!f1.is()) { - f2 = css::uno::Reference< css::lang::XSingleServiceFactory >( - factoryInfo, css::uno::UNO_QUERY); + f2.set(factoryInfo, css::uno::UNO_QUERY); if (!f2.is()) { throw css::lang::IllegalArgumentException( ("Bad XServiceInfo argument implements neither" diff --git a/cppuhelper/test/testpropshlp.cxx b/cppuhelper/test/testpropshlp.cxx index 8e98f12c57bb..ad62cd95b44e 100644 --- a/cppuhelper/test/testpropshlp.cxx +++ b/cppuhelper/test/testpropshlp.cxx @@ -344,7 +344,7 @@ public: { disposing(); EventObject aEvt; - aEvt.Source = Reference < XInterface > ( (static_cast< OWeakObject * >(this)) ); + aEvt.Source.set( (static_cast< OWeakObject * >(this)) ); rBHelper.aLC.disposeAndClear( aEvt ); rBHelper.bDisposed = sal_True; @@ -796,7 +796,7 @@ void test_PropertySetHelper() Reference < XFastPropertySet > rFast( xPS , UNO_QUERY ); OSL_ENSURE( rFast.is() , "PropertySetHelper: XFastPropertySet nor supported" ); - x = Reference < XInterface > (); + x.clear(); // Test add-remove listener { diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index 937faf69b463..f4f60cfed009 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -171,7 +171,7 @@ void createInstance( throw RuntimeException( "cannot get service instance \"" + rServiceName + "\"!" ); } - rxOut = Reference< T >::query( x ); + rxOut.set( x, UNO_QUERY ); if (! rxOut.is()) { const Type & rType = cppu::UnoType::get(); diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 6964ad0f3edb..48dff09649b2 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -1260,7 +1260,7 @@ IMPL_LINK_NOARG_TYPED(SfxAcceleratorConfigPage, LoadHdl, sfx2::FileDialogHelper* lArgs[0] <<= sCfgName; lArgs[1] <<= css::embed::ElementModes::READ; - xRootStorage = uno::Reference(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY_THROW); + xRootStorage.set(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY_THROW); uno::Reference xUIConfig = xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, embed::ElementModes::READ); if (xUIConfig.is()) { @@ -1289,10 +1289,10 @@ IMPL_LINK_NOARG_TYPED(SfxAcceleratorConfigPage, LoadHdl, sfx2::FileDialogHelper* if (xRootStorage.is()) { uno::Reference xComponent; - xComponent = uno::Reference(xCfgMgr, uno::UNO_QUERY); + xComponent.set(xCfgMgr, uno::UNO_QUERY); if (xComponent.is()) xComponent->dispose(); - xComponent = uno::Reference(xRootStorage, uno::UNO_QUERY); + xComponent.set(xRootStorage, uno::UNO_QUERY); if (xComponent.is()) xComponent->dispose(); } @@ -1343,9 +1343,8 @@ IMPL_LINK_NOARG_TYPED(SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper* lArgs[0] <<= sCfgName; lArgs[1] <<= embed::ElementModes::WRITE; - xRootStorage = uno::Reference( - xStorageFactory->createInstanceWithArguments(lArgs), - uno::UNO_QUERY_THROW); + xRootStorage.set( xStorageFactory->createInstanceWithArguments(lArgs), + uno::UNO_QUERY_THROW); uno::Reference xUIConfig( xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, embed::ElementModes::WRITE), diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index b263ae9478ee..a6c4f1b2ae79 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -872,8 +872,7 @@ SaveInData::SaveInData( if ( !m_xImgMgr.is() ) { - m_xImgMgr = uno::Reference< css::ui::XImageManager >( - GetConfigManager()->getImageManager(), uno::UNO_QUERY ); + m_xImgMgr.set( GetConfigManager()->getImageManager(), uno::UNO_QUERY ); } if ( !IsDocConfig() ) @@ -889,8 +888,7 @@ SaveInData::SaveInData( // as default. if ( m_xParentCfgMgr.is() ) { - m_xParentImgMgr = uno::Reference< css::ui::XImageManager >( - m_xParentCfgMgr->getImageManager(), uno::UNO_QUERY ); + m_xParentImgMgr.set( m_xParentCfgMgr->getImageManager(), uno::UNO_QUERY ); xDefaultImgMgr = &m_xParentImgMgr; } } @@ -1170,8 +1168,7 @@ bool MenuSaveInData::Apply() if ( IsModified() ) { // Apply new menu bar structure to our settings container - m_xMenuSettings = uno::Reference< container::XIndexAccess >( - GetConfigManager()->createSettings(), uno::UNO_QUERY ); + m_xMenuSettings.set( GetConfigManager()->createSettings(), uno::UNO_QUERY ); uno::Reference< container::XIndexContainer > xIndexContainer ( m_xMenuSettings, uno::UNO_QUERY ); @@ -3496,7 +3493,7 @@ void ToolbarSaveInData::SetSystemStyle( // before. It's possible that the current element is not available. uno::Reference< css::awt::XWindow > xWindow; if ( xUIElement.is() ) - xWindow = uno::Reference< css::awt::XWindow >( xUIElement->getRealInterface(), uno::UNO_QUERY ); + xWindow.set( xUIElement->getRealInterface(), uno::UNO_QUERY ); window = VCLUnoHelper::GetWindow( xWindow ); } @@ -4747,8 +4744,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow, uno::Reference< uno::XComponentContext > xComponentContext = ::comphelper::getProcessComponentContext(); - m_xGraphProvider = uno::Reference< graphic::XGraphicProvider >( - graphic::GraphicProvider::create( xComponentContext ) ); + m_xGraphProvider.set( graphic::GraphicProvider::create( xComponentContext ) ); uno::Reference< css::util::XPathSettings > xPathSettings = css::util::thePathSettings::get( xComponentContext ); @@ -4936,9 +4932,7 @@ uno::Reference< graphic::XGraphic> SvxIconSelectorDialog::GetSelectedIcon() nId = pTbSymbol->GetItemId( n ); if ( pTbSymbol->IsItemChecked( nId ) ) { - result = uno::Reference< graphic::XGraphic >( - static_cast< graphic::XGraphic* >( - pTbSymbol->GetItemData( nId ) ) ); + result.set( static_cast< graphic::XGraphic* >( pTbSymbol->GetItemData( nId ) ) ); } } diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index ff248dd03e71..30af1e3aaeed 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -552,7 +552,7 @@ void SfxConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent m_sModuleLongName = sModuleLongName; m_xGlobalCategoryInfo = css::ui::theUICategoryDescription::get( m_xContext ); - m_xModuleCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xGlobalCategoryInfo->getByName(m_sModuleLongName), css::uno::UNO_QUERY_THROW); + m_xModuleCategoryInfo.set(m_xGlobalCategoryInfo->getByName(m_sModuleLongName), css::uno::UNO_QUERY_THROW); m_xUICmdDescription = css::frame::theUICommandDescription::get( m_xContext ); InitModule(); diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx index 45ea0b6f337a..173a9ecfed08 100644 --- a/cui/source/customize/selector.cxx +++ b/cui/source/customize/selector.cxx @@ -450,8 +450,7 @@ void SvxConfigGroupListBox::Init(bool bShowSlots, const Reference< frame::XFrame { try { - xModuleCategories = Reference< container::XNameAccess >( - xAllCategories->getByName( aModuleId ), UNO_QUERY ); + xModuleCategories.set( xAllCategories->getByName( aModuleId ), UNO_QUERY ); } catch ( container::NoSuchElementException& ) { diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index d3d34d756d0a..6c8a7b579fd3 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -569,7 +569,7 @@ short SfxInsertFloatingFrameDialog::Execute() { if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED ) m_xObj->changeState( embed::EmbedStates::RUNNING ); - xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY ); + xSet.set( m_xObj->getComponent(), uno::UNO_QUERY ); OUString aStr; uno::Any aAny = xSet->getPropertyValue( "FrameURL" ); if ( aAny >>= aStr ) @@ -671,7 +671,7 @@ short SfxInsertFloatingFrameDialog::Execute() m_xObj = aCnt.CreateEmbeddedObject( aClassId.GetByteSequence(), aName ); if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED ) m_xObj->changeState( embed::EmbedStates::RUNNING ); - xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY ); + xSet.set( m_xObj->getComponent(), uno::UNO_QUERY ); } if ( m_xObj.is() ) diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index 53eea6bdb7cc..3f003a7543a5 100644 --- a/cui/source/options/optaboutconfig.cxx +++ b/cui/source/options/optaboutconfig.cxx @@ -269,7 +269,7 @@ void CuiAboutConfigTabPage::FillItems(const Reference< XNameAccess >& xNameAcces Reference< XNameAccess > xNextNameAccess; try { - xNextNameAccess = Reference< XNameAccess >(aNode, uno::UNO_QUERY); + xNextNameAccess.set(aNode, uno::UNO_QUERY); bNotLeaf = xNextNameAccess.is(); } catch (const RuntimeException& e) diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 260187a15184..131ae70de066 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -244,8 +244,7 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* ) Reference xFact(xModel, UNO_QUERY); if(xFact.is()) { - pImpl->xPrSet = Reference( - xFact->createInstance("com.sun.star.document.Settings"), UNO_QUERY); + pImpl->xPrSet.set(xFact->createInstance("com.sun.star.document.Settings"), UNO_QUERY); } if( pImpl->xPrSet.is() ) pImpl->xPrSetInfo = pImpl->xPrSet->getPropertySetInfo(); diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index d8ddc4e9b0c3..106f634469d9 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -172,8 +172,7 @@ IMPL_LINK_NOARG_TYPED(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void) { lang::Locale aLocale( LanguageTag::convertToLocale(nLang) ); OUString aURL( linguistic::GetWritableDictionaryURL( sDict ) ); - xNewDic = Reference< XDictionary > ( - xDicList->createDictionary( sDict, aLocale, eType, aURL ) , UNO_QUERY ); + xNewDic.set( xDicList->createDictionary( sDict, aLocale, eType, aURL ) , UNO_QUERY ); xNewDic->setActive( sal_True ); } DBG_ASSERT(xNewDic.is(), "NULL pointer"); @@ -312,7 +311,7 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog( } Reference< XDictionary > xDic; if (nPos != LISTBOX_ENTRY_NOTFOUND) - xDic = Reference< XDictionary > ( aDics.getConstArray()[ nPos ], UNO_QUERY ); + xDic.set( aDics.getConstArray()[ nPos ], UNO_QUERY ); if (xDic.is()) SetLanguage_Impl( LanguageTag( xDic->getLocale() ).getLanguageType() ); diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 5578f45fd3d8..52c58ba52369 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1055,7 +1055,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet& // find out which locales are currently installed and add them to the listbox theArgs[0] = makeAny(NamedValue(OUString("nodepath"), makeAny(OUString(sInstalledLocalesPath)))); - theNameAccess = Reference< XNameAccess > ( + theNameAccess.set( theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs ), UNO_QUERY_THROW ); seqInstalledLanguages = theNameAccess->getElementNames(); LanguageType aLang = LANGUAGE_DONTKNOW; @@ -1074,7 +1074,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet& // find out whether the user has a specific locale specified Sequence< Any > theArgs2(1); theArgs2[0] = makeAny(NamedValue(OUString("nodepath"), makeAny(OUString(sUserLocalePath)))); - theNameAccess = Reference< XNameAccess > ( + theNameAccess.set( theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs2 ), UNO_QUERY_THROW ); if (theNameAccess->hasByName(sUserLocaleKey)) theNameAccess->getByName(sUserLocaleKey) >>= m_sUserLocaleValue; diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 0348f2b9d7e7..bde39e982489 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -736,7 +736,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : { ServiceInfo_Impl aInfo; aInfo.sSpellImplName = pSpellNames[nIdx]; - aInfo.xSpell = uno::Reference( + aInfo.xSpell.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sSpellImplName, aArgs, xContext), UNO_QUERY); uno::Reference xDispName(aInfo.xSpell, UNO_QUERY); @@ -760,7 +760,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : { ServiceInfo_Impl aInfo; aInfo.sGrammarImplName = pGrammarNames[nIdx]; - aInfo.xGrammar = uno::Reference( + aInfo.xGrammar.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sGrammarImplName, aArgs, xContext), UNO_QUERY); uno::Reference xDispName(aInfo.xGrammar, UNO_QUERY); @@ -784,8 +784,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : { ServiceInfo_Impl aInfo; aInfo.sHyphImplName = pHyphNames[nIdx]; - aInfo.xHyph = uno::Reference( - xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sHyphImplName, aArgs, xContext), UNO_QUERY); + aInfo.xHyph.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sHyphImplName, aArgs, xContext), UNO_QUERY); uno::Reference xDispName(aInfo.xHyph, UNO_QUERY); if(xDispName.is()) @@ -808,8 +807,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : { ServiceInfo_Impl aInfo; aInfo.sThesImplName = pThesNames[nIdx]; - aInfo.xThes = uno::Reference( - xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sThesImplName, aArgs, xContext), UNO_QUERY); + aInfo.xThes.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sThesImplName, aArgs, xContext), UNO_QUERY); uno::Reference xDispName(aInfo.xThes, UNO_QUERY); if(xDispName.is()) @@ -1102,7 +1100,7 @@ SvxLinguTabPage::SvxLinguTabPage( vcl::Window* pParent, const SfxItemSet& rSet ) m_pLinguOptionsEditPB->SetAccessibleName(sAccessibleNameOptionEdit); xProp = SvxGetLinguPropertySet(); - xDicList = uno::Reference< XDictionaryList >( SvxGetDictionaryList(), UNO_QUERY ); + xDicList.set( SvxGetDictionaryList(), UNO_QUERY ); if (xDicList.is()) { // keep references to all **currently** available dictionaries, @@ -1623,7 +1621,7 @@ IMPL_LINK_TYPED( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void ) DBG_ASSERT(aDlg, "Dialog creation failed!"); uno::Reference< XDictionary > xNewDic; if ( aDlg->Execute() == RET_OK ) - xNewDic = uno::Reference< XDictionary >( aDlg->GetNewDictionary(), UNO_QUERY ); + xNewDic.set( aDlg->GetNewDictionary(), UNO_QUERY ); if ( xNewDic.is() ) { // add new dics to the end diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index cdde1a1dffec..3dd15b075af5 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -409,8 +409,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* ) try { Reference< XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory(); - pImpl->xFact = Reference( - xMSF->createInstance("com.sun.star.document.FilterFactory"), UNO_QUERY); + pImpl->xFact.set(xMSF->createInstance("com.sun.star.document.FilterFactory"), UNO_QUERY); DBG_ASSERT(pImpl->xFact.is(), "service com.sun.star.document.FilterFactory unavailable"); Reference< XContainerQuery > xQuery(pImpl->xFact, UNO_QUERY); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index e8cdeb4ab50e..ed946e35a565 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -2212,15 +2212,14 @@ void ExtensionsTabPage::CreateDialogWithHandler() if ( bWithHandler ) { Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - m_xEventHdl = Reference< awt::XContainerWindowEventHandler >( - xFactory->createInstance( m_sEventHdl ), UNO_QUERY ); + m_xEventHdl.set( xFactory->createInstance( m_sEventHdl ), UNO_QUERY ); } if ( !bWithHandler || m_xEventHdl.is() ) { SetStyle( GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL ); Reference< awt::XWindowPeer > xParent( VCLUnoHelper::GetInterface( this ), UNO_QUERY ); - m_xPage = Reference < awt::XWindow >( + m_xPage.set( m_xWinProvider->createContainerWindow( m_sPageURL, OUString(), xParent, m_xEventHdl ), UNO_QUERY ); -- cgit v1.2.3