diff options
27 files changed, 51 insertions, 60 deletions
diff --git a/dbaccess/source/core/api/preparedstatement.cxx b/dbaccess/source/core/api/preparedstatement.cxx index 28912f229f40..83dd22fb5eab 100644 --- a/dbaccess/source/core/api/preparedstatement.cxx +++ b/dbaccess/source/core/api/preparedstatement.cxx @@ -49,7 +49,7 @@ OPreparedStatement::OPreparedStatement(const Reference< XConnection > & _xConn, const Reference< XInterface > & _xStatement) :OStatementBase(_xConn, _xStatement) { - m_xAggregateAsParameters = Reference< XParameters >( m_xAggregateAsSet, UNO_QUERY_THROW ); + m_xAggregateAsParameters.set( m_xAggregateAsSet, UNO_QUERY_THROW ); Reference<XDatabaseMetaData> xMeta = _xConn->getMetaData(); m_pColumns = new OColumns(*this, m_aMutex, xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers(),::std::vector< OUString>(), NULL,NULL); diff --git a/dbaccess/source/core/api/statement.cxx b/dbaccess/source/core/api/statement.cxx index fa2d6ce5e8ef..dd251b7ae5c1 100644 --- a/dbaccess/source/core/api/statement.cxx +++ b/dbaccess/source/core/api/statement.cxx @@ -53,7 +53,7 @@ OStatementBase::OStatementBase(const Reference< XConnection > & _xConn, { OSL_ENSURE(_xStatement.is() ,"Statement is NULL!"); m_xAggregateAsSet.set(_xStatement,UNO_QUERY); - m_xAggregateAsCancellable = Reference< css::util::XCancellable > (m_xAggregateAsSet, UNO_QUERY); + m_xAggregateAsCancellable.set(m_xAggregateAsSet, UNO_QUERY); } OStatementBase::~OStatementBase() diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index 85ee5ef1e2f8..cf45d53176dc 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -196,7 +196,9 @@ connectivity::sdbcx::ObjectType OTableContainer::createObject(const OUString& _r Sequence< OUString> aTypeFilter; getAllTableTypeFilter( aTypeFilter ); - Reference< XResultSet > xRes = m_xMetaData.is() ? m_xMetaData->getTables(aCatalog,sSchema,sTable,aTypeFilter) : Reference< XResultSet >(); + Reference< XResultSet > xRes; + if ( m_xMetaData.is() ) + xRes = m_xMetaData->getTables(aCatalog,sSchema,sTable,aTypeFilter); if(xRes.is() && xRes->next()) { Reference< XRow > xRow(xRes,UNO_QUERY); @@ -242,7 +244,7 @@ Reference< XPropertySet > OTableContainer::createDescriptor() Reference<XDataDescriptorFactory> xDataFactory(m_xMasterContainer,UNO_QUERY); if ( xDataFactory.is() && m_xMetaData.is() ) { - xMasterColumnsSup = Reference< XColumnsSupplier >( xDataFactory->createDataDescriptor(), UNO_QUERY ); + xMasterColumnsSup.set( xDataFactory->createDataDescriptor(), UNO_QUERY ); ODBTableDecorator* pTable = new ODBTableDecorator( m_xConnection, xMasterColumnsSup, ::dbtools::getNumberFormats( m_xConnection ) ,NULL); xRet = pTable; pTable->construct(); diff --git a/dbaccess/source/sdbtools/connection/connectiondependent.hxx b/dbaccess/source/sdbtools/connection/connectiondependent.hxx index 28a294a07caf..845a52c0669a 100644 --- a/dbaccess/source/sdbtools/connection/connectiondependent.hxx +++ b/dbaccess/source/sdbtools/connection/connectiondependent.hxx @@ -90,7 +90,7 @@ namespace sdbtools inline bool acquireConnection( GuardAccess ) { - m_xConnection = css::uno::Reference< css::sdbc::XConnection >(m_aConnection); + m_xConnection.set(m_aConnection); return m_xConnection.is(); } inline void releaseConnection( GuardAccess ) diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 195864b288b7..9516a481eb14 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -209,7 +209,7 @@ void OApplicationController::openDialog( const OUString& _sServiceName ) // create the dialog Reference< XExecutableDialog > xAdminDialog; - xAdminDialog = Reference< XExecutableDialog >( + xAdminDialog.set( getORB()->getServiceManager()->createInstanceWithArgumentsAndContext(_sServiceName, aArgs, getORB()), UNO_QUERY); diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index d998829bff98..a26c9ac4db5d 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -691,8 +691,7 @@ void SbaXDataBrowserController::initFormatter() if(xSupplier.is()) { // create a new formatter - m_xFormatter = Reference< util::XNumberFormatter > ( - util::NumberFormatter::create(getORB()), UNO_QUERY_THROW); + m_xFormatter.set(util::NumberFormatter::create(getORB()), UNO_QUERY_THROW); m_xFormatter->attachNumberFormatsSupplier(xSupplier); } else // clear the formatter @@ -2229,7 +2228,7 @@ bool SbaXDataBrowserController::CommitCurrent() // zunaechst das Control fragen ob es das IFace unterstuetzt Reference< css::form::XBoundComponent > xBoundControl(xActiveControl, UNO_QUERY); if (!xBoundControl.is()) - xBoundControl = Reference< css::form::XBoundComponent > (xActiveControl->getModel(), UNO_QUERY); + xBoundControl.set(xActiveControl->getModel(), UNO_QUERY); if (xBoundControl.is() && !xBoundControl->commit()) return false; } diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx index a9e44ac48fc3..b249306b1bc1 100644 --- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx +++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx @@ -106,7 +106,8 @@ namespace dbaui { Reference<XChild> xChild(xConnection,UNO_QUERY); Reference<XStorable> xStore; - xStore = Reference<XStorable>( xChild.is() ? getDataSourceOrModel(xChild->getParent()) : Reference<XInterface>(),UNO_QUERY ); + if ( xChild.is() ) + xStore.set( getDataSourceOrModel(xChild->getParent()), UNO_QUERY ); // check for the concrete type if ( xStore.is() && !xStore->isReadonly() && ::std::any_of(_rFlavors.begin(),_rFlavors.end(),TAppSupportedSotFunctor(E_TABLE,true)) ) return DND_ACTION_COPY; diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index 004faa65f972..901752e6ed4b 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -222,7 +222,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, con { if ( (pArguments->Name == "MasterForm") && (pArguments->Value.getValueTypeClass() == TypeClass_INTERFACE) ) { - xMasterForm = Reference< XRowSet > (*static_cast<Reference< XInterface > const *>(pArguments->Value.getValue()), UNO_QUERY); + xMasterForm.set(*static_cast<Reference< XInterface > const *>(pArguments->Value.getValue()), UNO_QUERY); break; } } diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index acd4550739be..638dd5ff9c42 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -1437,7 +1437,7 @@ Reference< XPropertySet > SbaGridControl::getDataSource() const Reference< XChild > xColumns(GetPeer()->getColumns(), UNO_QUERY); Reference< XPropertySet > xDataSource; if (xColumns.is()) - xReturn = Reference< XPropertySet > (xColumns->getParent(), UNO_QUERY); + xReturn.set(xColumns->getParent(), UNO_QUERY); return xReturn; } diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index c1cdc7f14cdd..29b056f9da7f 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -245,7 +245,7 @@ bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyVal if ( !xHandler.is() ) { // instantiate the default SDB interaction handler - xHandler = Reference< XInteractionHandler >( task::InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY ); + xHandler.set( task::InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY ); } OUString sName = pName ? pName->GetValue() : OUString(); diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 7a3769df11d1..c1c0e77453c8 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -68,7 +68,7 @@ namespace dbaui set_height_request(200); if (rxContext.is()) - m_xFormatter = Reference< XNumberFormatter>( NumberFormatter::create( rxContext ), UNO_QUERY_THROW); + m_xFormatter.set( NumberFormatter::create( rxContext ), UNO_QUERY_THROW); else { OSL_FAIL("OParameterDialog::OParameterDialog: need a service factory!"); } diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 423fb3bd22b8..20704cab1133 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1501,8 +1501,7 @@ Reference< XNumberFormatter > getNumberFormatter(const Reference< XConnection >& if ( xSupplier.is() ) { // create a new formatter - xFormatter = Reference< util::XNumberFormatter > ( - util::NumberFormatter::create( _rxContext ), UNO_QUERY_THROW); + xFormatter.set(util::NumberFormatter::create( _rxContext ), UNO_QUERY_THROW); xFormatter->attachNumberFormatsSupplier(xSupplier); } } diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx index 8ed65da45918..7c2b8015b6ba 100644 --- a/dbaccess/source/ui/misc/datasourceconnector.cxx +++ b/dbaccess/source/ui/misc/datasourceconnector.cxx @@ -130,7 +130,7 @@ namespace dbaui if ( !xHandler.is() ) { // instantiate the default SDB interaction handler - xHandler = Reference< XInteractionHandler >( InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY ); + xHandler.set( InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY ); } xConnection = xConnectionCompletion->connectWithCompletion(xHandler); diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx index 343b840738f4..35cb35e1cd9b 100644 --- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -258,7 +258,7 @@ namespace dbaui Reference< XChild > xConnAsChild( m_pImpl->m_xConnection, UNO_QUERY ); Reference< XDataSource > xDS; if ( xConnAsChild.is() ) - xDS = Reference< XDataSource >( xConnAsChild->getParent(), UNO_QUERY ); + xDS.set( xConnAsChild->getParent(), UNO_QUERY ); // (take the indirection through XDataSource to ensure we have a correct object ....) m_pImpl->m_aDataSource = DataSourceHolder(xDS); @@ -284,8 +284,7 @@ namespace dbaui Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection); if(xSupplier.is()) { - m_pImpl->m_xFormatter = Reference< XNumberFormatter >( - NumberFormatter::create(getORB()), UNO_QUERY_THROW); + m_pImpl->m_xFormatter.set(NumberFormatter::create(getORB()), UNO_QUERY_THROW); m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier); } OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!"); diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index dd2d477dfa84..1cf3748e6ca7 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -124,7 +124,7 @@ namespace dbaui Reference< XInteractionSupplyParameters > xParamCallback; if (-1 != nParamPos) - xParamCallback = Reference< XInteractionSupplyParameters >(_rContinuations[nParamPos], UNO_QUERY); + xParamCallback.set(_rContinuations[nParamPos], UNO_QUERY); OSL_ENSURE(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s"); ScopedVclPtrInstance< OParameterDialog > aDlg(nullptr, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext); diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 60e2605cb000..c9b7d137856d 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2143,8 +2143,7 @@ void Desktop::PreloadConfigurationData() } // preload filter configuration - xNameAccess = Reference< XNameAccess >( - xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.FilterFactory", xContext), + xNameAccess.set(xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.FilterFactory", xContext), UNO_QUERY ); if ( xNameAccess.is() ) { @@ -2158,8 +2157,7 @@ void Desktop::PreloadConfigurationData() } // preload type detection configuration - xNameAccess = Reference< XNameAccess >( - xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.TypeDetection", xContext), + xNameAccess.set(xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.TypeDetection", xContext), UNO_QUERY ); if ( xNameAccess.is() ) { @@ -2728,7 +2726,7 @@ void Desktop::OpenSplashScreen() aSeq[0] <<= bVisible; aSeq[1] <<= aAppName; css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - m_rSplashScreen = Reference<XStatusIndicator>( + m_rSplashScreen.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aSplashService, aSeq, xContext), UNO_QUERY); diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx index 38b7d2135ade..359ee1c7b8f2 100644 --- a/desktop/source/app/check_ext_deps.cxx +++ b/desktop/source/app/check_ext_deps.cxx @@ -331,7 +331,7 @@ static void impl_setNeedsCompatCheck() beans::NamedValue v( OUString("nodepath"), makeAny( OUString("org.openoffice.Setup/Office") ) ); theArgs[0] <<= v; - Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >( + Reference< beans::XPropertySet > pset( theConfigProvider->createInstanceWithArguments( aAccessSrvc, theArgs ), UNO_QUERY_THROW ); Any value = makeAny( OUString("never") ); @@ -362,7 +362,7 @@ static bool impl_needsCompatCheck() beans::NamedValue v( OUString("nodepath"), makeAny( OUString("org.openoffice.Setup/Office") ) ); theArgs[0] <<= v; - Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >( + Reference< beans::XPropertySet > pset( theConfigProvider->createInstanceWithArguments( OUString(aAccessSrvc), theArgs ), UNO_QUERY_THROW ); Any result = pset->getPropertyValue("LastCompatibilityCheckID"); diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 3bf045c6a527..bac549950724 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -455,7 +455,7 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatchRequ // This is a synchron loading of a component so we don't have to deal with our statusChanged listener mechanism. try { - xDoc = Reference < XPrintable >( ::comphelper::SynchronousDispatch::dispatch( xDesktop, aName, aTarget, 0, aArgs ), UNO_QUERY ); + xDoc.set( ::comphelper::SynchronousDispatch::dispatch( xDesktop, aName, aTarget, 0, aArgs ), UNO_QUERY ); } catch (const css::lang::IllegalArgumentException& iae) { diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx index 3689b6f2cd77..cd34cd4d108c 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx @@ -66,18 +66,20 @@ TheExtensionManager::TheExtensionManager( const uno::Reference< awt::XWindow > & beans::PropertyValue aValue( OUString("nodepath"), 0, uno::Any( OUString("/org.openoffice.Office.OptionsDialog/Nodes") ), beans::PropertyState_DIRECT_VALUE ); args[0] <<= aValue; - m_xNameAccessNodes = uno::Reference< container::XNameAccess >( + m_xNameAccessNodes.set( xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - uno::Sequence< uno::Any >( args, 1 )), uno::UNO_QUERY_THROW); + uno::Sequence< uno::Any >( args, 1 )), + uno::UNO_QUERY_THROW); // get the 'get more extensions here' url uno::Reference< container::XNameAccess > xNameAccessRepositories; beans::PropertyValue aValue2( OUString("nodepath"), 0, uno::Any( OUString("/org.openoffice.Office.ExtensionManager/ExtensionRepositories") ), beans::PropertyState_DIRECT_VALUE ); args[0] <<= aValue2; - xNameAccessRepositories = uno::Reference< container::XNameAccess > ( + xNameAccessRepositories.set( xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", - uno::Sequence< uno::Any >( args, 1 )), uno::UNO_QUERY_THROW); + uno::Sequence< uno::Any >( args, 1 )), + uno::UNO_QUERY_THROW); try { //throws css::container::NoSuchElementException, css::lang::WrappedTargetException uno::Any value = xNameAccessRepositories->getByName("WebsiteLink"); diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index e662c31165b7..8913224efbfe 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -596,8 +596,7 @@ bool ExtensionManager::doChecksForAddExtension( if (licenseAttributes && licenseAttributes->suppressIfRequired && props.isSuppressedLicense()) - _xCmdEnv = Reference<ucb::XCommandEnvironment>( - new NoLicenseCommandEnv(xCmdEnv->getInteractionHandler())); + _xCmdEnv.set(new NoLicenseCommandEnv(xCmdEnv->getInteractionHandler())); bCanInstall = xTmpExtension->checkPrerequisites( xAbortChannel, _xCmdEnv, xOldExtension.is() || props.isExtensionUpdate()) == 0; diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx index a27c1718eb9a..ae0d56e8e50c 100644 --- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx +++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx @@ -227,8 +227,7 @@ ExtensionDescription::ExtensionDescription( sDescriptionUri + " does not contain the root element <description>.", 0); } - m_xRoot = Reference<css::xml::dom::XNode>( - xRoot, css::uno::UNO_QUERY_THROW); + m_xRoot.set(xRoot, css::uno::UNO_QUERY_THROW); OUString nsDescription = xRoot->getNamespaceURI(); //check if this namespace is supported diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx index 4ec7b373a61c..35bdd1701e6c 100644 --- a/desktop/source/deployment/misc/dp_update.cxx +++ b/desktop/source/deployment/misc/dp_update.cxx @@ -115,8 +115,7 @@ void getOwnUpdateInfos( if (*id2 == id) { i->second.version = infoset.getVersion(); - i->second.info = Reference< xml::dom::XNode >( - infos[j], UNO_QUERY_THROW); + i->second.info.set(infos[j], UNO_QUERY_THROW); } break; } diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx index 3f607ae04b0c..a2c03235d855 100644 --- a/desktop/source/deployment/registry/dp_backenddb.cxx +++ b/desktop/source/deployment/registry/dp_backenddb.cxx @@ -170,7 +170,7 @@ void BackendDb::revokeEntry(OUString const & url) { try { - Reference<css::xml::dom::XElement> entry = Reference<css::xml::dom::XElement>(getKeyElement(url), UNO_QUERY); + Reference<css::xml::dom::XElement> entry(getKeyElement(url), UNO_QUERY); if (entry.is()) { entry->setAttribute("revoked", "true"); @@ -191,7 +191,7 @@ bool BackendDb::activateEntry(OUString const & url) try { bool ret = false; - Reference<css::xml::dom::XElement> entry = Reference<css::xml::dom::XElement>(getKeyElement(url), UNO_QUERY); + Reference<css::xml::dom::XElement> entry(getKeyElement(url), UNO_QUERY); if (entry.is()) { //no attribute "active" means it is active, that is, registered. @@ -215,7 +215,7 @@ bool BackendDb::hasActiveEntry(OUString const & url) try { bool ret = false; - Reference<css::xml::dom::XElement> entry = Reference<css::xml::dom::XElement>(getKeyElement(url), UNO_QUERY); + Reference<css::xml::dom::XElement> entry(getKeyElement(url), UNO_QUERY); if (entry.is()) { OUString sActive = entry->getAttribute("revoked"); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 32b01012d4ed..d9a3fdd42425 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1285,13 +1285,7 @@ static bool initialize_uno(const OUString& aAppProgramURL) return false; } - xSFactory = uno::Reference<lang::XMultiServiceFactory>(xFactory, uno::UNO_QUERY_THROW); - if (!xSFactory.is()) - { - gImpl->maLastExceptionMsg = "XMultiServiceFactory could not be created"; - SAL_INFO("lok", "XMultiServiceFactory could not be created"); - return false; - } + xSFactory.set(xFactory, uno::UNO_QUERY_THROW); comphelper::setProcessServiceFactory(xSFactory); SAL_INFO("lok", "Uno initialized - " << xContext.is()); diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 37ce482b014f..1f8e9999ff69 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -279,7 +279,7 @@ bool MigrationImpl::doMigration() if (vModulesInfo[i].bHasMenubar) { - uno::Reference< container::XIndexContainer > xOldVersionMenuSettings = uno::Reference< container::XIndexContainer >(xOldCfgManager->getSettings(sMenubarResourceURL, sal_True), uno::UNO_QUERY); + uno::Reference< container::XIndexContainer > xOldVersionMenuSettings(xOldCfgManager->getSettings(sMenubarResourceURL, sal_True), uno::UNO_QUERY); uno::Reference< container::XIndexContainer > xNewVersionMenuSettings = aNewVersionUIInfo.getNewMenubarSettings(vModulesInfo[i].sModuleShortName); OUString sParent; compareOldAndNewConfig(sParent, xOldVersionMenuSettings, xNewVersionMenuSettings, sMenubarResourceURL); @@ -294,7 +294,7 @@ bool MigrationImpl::doMigration() OUString sToolbarName = vModulesInfo[i].m_vToolbars[j]; OUString sToolbarResourceURL = sToolbarResourcePre + sToolbarName; - uno::Reference< container::XIndexContainer > xOldVersionToolbarSettings = uno::Reference< container::XIndexContainer >(xOldCfgManager->getSettings(sToolbarResourceURL, sal_True), uno::UNO_QUERY); + uno::Reference< container::XIndexContainer > xOldVersionToolbarSettings(xOldCfgManager->getSettings(sToolbarResourceURL, sal_True), uno::UNO_QUERY); uno::Reference< container::XIndexContainer > xNewVersionToolbarSettings = aNewVersionUIInfo.getNewToolbarSettings(vModulesInfo[i].sModuleShortName, sToolbarName); OUString sParent; compareOldAndNewConfig(sParent, xOldVersionToolbarSettings, xNewVersionToolbarSettings, sToolbarResourceURL); @@ -878,7 +878,7 @@ uno::Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPa // access the provider uno::Sequence< uno::Any > theArgs(1); theArgs[ 0 ] <<= sConfigURL; - xNameAccess = uno::Reference< XNameAccess > ( + xNameAccess.set( theConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), uno::UNO_QUERY_THROW ); } @@ -966,7 +966,7 @@ void MigrationImpl::runServices() seqArguments[2] = uno::makeAny(NamedValue("ExtensionBlackList", uno::makeAny( seqExtBlackList ))); - xMigrationJob = uno::Reference< XJob >( + xMigrationJob.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(i_mig->service, seqArguments, xContext), uno::UNO_QUERY_THROW); @@ -1008,11 +1008,11 @@ void MigrationImpl::runServices() embed::FileSystemStorageFactory::create(comphelper::getProcessComponentContext())); uno::Reference< embed::XStorage > xModules; - xModules = uno::Reference< embed::XStorage >(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY); + xModules.set(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY); if (!xModules.is()) return vModulesInfo; - uno::Reference< container::XNameAccess > xAccess = uno::Reference< container::XNameAccess >(xModules, uno::UNO_QUERY); + uno::Reference< container::XNameAccess > xAccess(xModules, uno::UNO_QUERY); uno::Sequence< OUString > lNames = xAccess->getElementNames(); sal_Int32 nLength = lNames.getLength(); for (sal_Int32 i=0; i<nLength; ++i) @@ -1026,7 +1026,7 @@ void MigrationImpl::runServices() uno::Reference< embed::XStorage > xMenubar = xModule->openStorageElement(MENUBAR, embed::ElementModes::READ); if (xMenubar.is()) { - uno::Reference< container::XNameAccess > xNameAccess = uno::Reference< container::XNameAccess >(xMenubar, uno::UNO_QUERY); + uno::Reference< container::XNameAccess > xNameAccess(xMenubar, uno::UNO_QUERY); if (xNameAccess->getElementNames().getLength() > 0) { aModuleInfo.sModuleShortName = sModuleShortName; @@ -1040,7 +1040,7 @@ void MigrationImpl::runServices() const OUString RESOURCEURL_CUSTOM_ELEMENT("custom_"); sal_Int32 nCustomLen = 7; - uno::Reference< container::XNameAccess > xNameAccess = uno::Reference< container::XNameAccess >(xToolbar, uno::UNO_QUERY); + uno::Reference< container::XNameAccess > xNameAccess(xToolbar, uno::UNO_QUERY); ::uno::Sequence< OUString > lToolbars = xNameAccess->getElementNames(); for (sal_Int32 j=0; j<lToolbars.getLength(); ++j) { diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index eb1b0052f085..726a192c362c 100644 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -209,7 +209,7 @@ bool OO3ExtensionMigration::scanDescriptionXml( const OUString& sDescriptionXmlU { if ( !m_xDocBuilder.is() ) { - m_xDocBuilder = uno::Reference< xml::dom::XDocumentBuilder >( xml::dom::DocumentBuilder::create(m_ctx) ); + m_xDocBuilder.set( xml::dom::DocumentBuilder::create(m_ctx) ); } if ( !m_xSimpleFileAccess.is() ) diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index 7378033f01c9..2320851d3410 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -236,7 +236,7 @@ Reference<XInterface> AccInstanceProvider::getInstance (const OUString& aName ) if ( aName == "StarOffice.ServiceManager" ) { - rInstance = Reference< XInterface >( m_rContext->getServiceManager() ); + rInstance.set( m_rContext->getServiceManager() ); } else if ( aName == "StarOffice.ComponentContext" ) { @@ -279,7 +279,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL offacc_component_getFactory(char const *pIm if (desktop::Acceptor::impl_getImplementationName().equalsAscii( pImplementationName ) ) { - xFactory = Reference< XSingleServiceFactory >( cppu::createSingleFactory( + xFactory.set( cppu::createSingleFactory( xServiceManager, desktop::Acceptor::impl_getImplementationName(), desktop::Acceptor::impl_getInstance, desktop::Acceptor::impl_getSupportedServiceNames()) ); } |