[Libreoffice-commits] core.git: comphelper/source configmgr/qa configmgr/source connectivity/source connectivity/workben cppuhelper/source cppuhelper/test cpputools/source cui/source

Noel Grandin noel at peralex.com
Fri Oct 30 09:09:08 UTC 2015


 comphelper/source/container/container.cxx                       |    2 
 comphelper/source/container/embeddedobjectcontainer.cxx         |   21 ++++------
 comphelper/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 
 connectivity/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 
 connectivity/source/drivers/firebird/StatementCommonBase.cxx    |    2 
 connectivity/source/drivers/hsqldb/HDriver.cxx                  |    2 
 connectivity/source/drivers/macab/MacabStatement.cxx            |    2 
 connectivity/source/drivers/mork/MStatement.cxx                 |    2 
 connectivity/source/drivers/mysql/YDriver.cxx                   |    4 -
 connectivity/source/drivers/postgresql/pq_databasemetadata.cxx  |    6 +-
 connectivity/source/drivers/postgresql/pq_driver.cxx            |    2 
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx |    2 
 connectivity/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(-)

New commits:
commit cb4fa1d1e2e61b686442a9d26220c0f1a6e1d4e7
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Oct 30 07:59:06 2015 +0200

    use uno::Reference::set method instead of assignment
    
    Change-Id: I080668f86f0ab8b3bba857ee21411f907ae285c4

diff --git a/comphelper/source/container/container.cxx b/comphelper/source/container/container.cxx
index 9bd468e..a8bd896 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 caa2d25..fa86241 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 6140d5c..1210147 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 5de0554..160c08a 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<css::bea
 
     uno::Reference<frame::XFrame> xFrame(xDesktop->getActiveFrame());
     if (!xFrame.is())
-        xFrame = uno::Reference<frame::XFrame>(xDesktop, uno::UNO_QUERY);
+        xFrame.set(xDesktop, uno::UNO_QUERY);
 
     uno::Reference<frame::XDispatchProvider> xDispatchProvider(xFrame, uno::UNO_QUERY);
     if (!xDispatchProvider.is())
diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx
index 204d1a9..d43ecf6 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 e6cef1d..0790567 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 d17d650..6dc3e21 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 da3b369..7a39696 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 c795a48..306a5e6 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 33b8c9c..65f2fa7 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 89dac95..82c9b1e 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 c1aec07..40e1eb6 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 4fadaf6..2d02746 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 d6eb7e4..573a30e 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 a5ef047..3380879 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<XParametersSupplier>  xParameters = Reference<XParametersSupplier> (_xComposer, UNO_QUERY);
+    Reference<XParametersSupplier>  xParameters(_xComposer, UNO_QUERY);
 
     Reference<XIndexAccess>  xParamsAsIndicies = xParameters.is() ? xParameters->getParameters() : Reference<XIndexAccess>();
     sal_Int32 nParamCount = xParamsAsIndicies.is() ? xParamsAsIndicies->getCount() : 0;
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index 7f5b680..c59a551 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<XColumnsSupplier>(xColProp,UNO_QUERY);
-                    xColumns = Reference<XIndexAccess>(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<XColumnsSupplier>(xColProp,UNO_QUERY);
-                    xColumns = Reference<XIndexAccess>(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<XColumnsSupplier>(xColProp,UNO_QUERY);
-                    xColumns = Reference<XIndexAccess>(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 5a4fe74..c8c7194 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 d4defb5..d780e31 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 13d11ac..55b4889 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 6ca1953..2e4c756 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 a7ece0a..7d33401 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<XResultSet>(pResult);
+    m_xResultSet.set(pResult);
     return xRS;
 }
 
diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx
index bdb6ede..0d6883f 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<XIndexAccess>(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 f69c031..60662f3 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 701bad7..a742d4a 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 672d0ee..8ff5223 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 f11ada3..6e624ac 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 e37e7f9..03c1c31 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 346f600..3769c47 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<XDriver>(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 4b42d33..c4de4fa 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 97a831d..cd9ec85 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 8e98f12..ad62cd9 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 937faf6..f4f60cf 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<T>::get();
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 6964ad0..48dff09 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<embed::XStorage>(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY_THROW);
+            xRootStorage.set(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY_THROW);
             uno::Reference<embed::XStorage> 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<lang::XComponent> xComponent;
-            xComponent = uno::Reference<css::lang::XComponent>(xCfgMgr, uno::UNO_QUERY);
+            xComponent.set(xCfgMgr, uno::UNO_QUERY);
             if (xComponent.is())
                 xComponent->dispose();
-            xComponent = uno::Reference<css::lang::XComponent>(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<embed::XStorage>(
-                                xStorageFactory->createInstanceWithArguments(lArgs),
-                                uno::UNO_QUERY_THROW);
+            xRootStorage.set( xStorageFactory->createInstanceWithArguments(lArgs),
+                              uno::UNO_QUERY_THROW);
 
             uno::Reference<embed::XStorage> xUIConfig(
                                 xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, embed::ElementModes::WRITE),
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index b263ae9..a6c4f1b 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 ff248dd..30af1e3 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 45ea0b6..173a9ec 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 d3d34d7..6c8a7b5 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 53eea6b..3f003a7 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 260187a..131ae70 100644
--- a/cui/source/options/optasian.cxx
+++ b/cui/source/options/optasian.cxx
@@ -244,8 +244,7 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* )
     Reference<XMultiServiceFactory> xFact(xModel, UNO_QUERY);
     if(xFact.is())
     {
-        pImpl->xPrSet = Reference<XPropertySet>(
-            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 d8ddc4e..106f634 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 5578f45..52c58ba 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 0348f2b..bde39e9 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<XSpellChecker>(
+        aInfo.xSpell.set(
                         xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sSpellImplName, aArgs, xContext), UNO_QUERY);
 
         uno::Reference<XServiceDisplayName> xDispName(aInfo.xSpell, UNO_QUERY);
@@ -760,7 +760,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
     {
         ServiceInfo_Impl aInfo;
         aInfo.sGrammarImplName = pGrammarNames[nIdx];
-        aInfo.xGrammar = uno::Reference<XProofreader>(
+        aInfo.xGrammar.set(
                         xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sGrammarImplName, aArgs, xContext), UNO_QUERY);
 
         uno::Reference<XServiceDisplayName> xDispName(aInfo.xGrammar, UNO_QUERY);
@@ -784,8 +784,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
     {
         ServiceInfo_Impl aInfo;
         aInfo.sHyphImplName = pHyphNames[nIdx];
-        aInfo.xHyph = uno::Reference<XHyphenator>(
-                        xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sHyphImplName, aArgs, xContext), UNO_QUERY);
+        aInfo.xHyph.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sHyphImplName, aArgs, xContext), UNO_QUERY);
 
         uno::Reference<XServiceDisplayName> 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<XThesaurus>(
-                        xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sThesImplName, aArgs, xContext), UNO_QUERY);
+        aInfo.xThes.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sThesImplName, aArgs, xContext), UNO_QUERY);
 
         uno::Reference<XServiceDisplayName> 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 cdde1a1..3dd15b07 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<XNameContainer>(
-                    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 e8cdeb4..ed946e3 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 );
 


More information about the Libreoffice-commits mailing list