[Libreoffice-commits] core.git: eventattacher/source extensions/source filter/source fpicker/source framework/source hwpfilter/source

Noel Grandin noelgrandin at gmail.com
Sun Nov 1 07:26:35 PST 2015


 eventattacher/source/eventattacher.cxx                  |    2 +-
 extensions/source/bibliography/framectr.cxx             |    4 ++--
 filter/source/config/cache/filtercache.cxx              |    6 +++---
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx    |    2 +-
 fpicker/source/win32/filepicker/workbench/Test_fps.cxx  |    4 ++--
 framework/source/helper/ocomponentaccess.cxx            |    4 ++--
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |    8 ++++----
 framework/source/services/desktop.cxx                   |    4 ++--
 framework/source/uielement/macrosmenucontroller.cxx     |    2 +-
 hwpfilter/source/hwpreader.hxx                          |    7 +++----
 10 files changed, 21 insertions(+), 22 deletions(-)

New commits:
commit 0e6544903bc572d1d6051cbb89a4cfb727401159
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sun Nov 1 09:05:58 2015 +0200

    no need to be so verbose in constructing uno::Reference
    
    Change-Id: I187a26e200e9ecaff2adaf53a2ba3f6e87346030
    Reviewed-on: https://gerrit.libreoffice.org/19724
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index 79cd4db..b3997ae 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -297,7 +297,7 @@ Reference< XInterface > SAL_CALL EventAttacherImpl_CreateInstance( const Referen
 {
     XEventAttacher *pEventAttacher = static_cast<XEventAttacher*>(new EventAttacherImpl( comphelper::getComponentContext(rSMgr) ));
 
-    Reference< XInterface > xRet = Reference<XInterface>::query(pEventAttacher);
+    Reference< XInterface > xRet(pEventAttacher, UNO_QUERY);
 
     return xRet;
 }
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx
index 596d512..abc6a67 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -357,12 +357,12 @@ bool BibFrameController_Impl::SaveModified(const Reference< form::runtime::XForm
     if (!xController.is())
         return false;
 
-    Reference< XResultSetUpdate> _xCursor = Reference< XResultSetUpdate>(xController->getModel(), UNO_QUERY);
+    Reference< XResultSetUpdate> _xCursor(xController->getModel(), UNO_QUERY);
 
     if (!_xCursor.is())
         return false;
 
-    Reference< beans::XPropertySet> _xSet = Reference< beans::XPropertySet>(_xCursor, UNO_QUERY);
+    Reference< beans::XPropertySet> _xSet(_xCursor, UNO_QUERY);
     if (!_xSet.is())
         return false;
 
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index a26f5e0..65cba52 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -636,9 +636,9 @@ void FilterCache::impl_flushByList(const css::uno::Reference< css::container::XN
                                    const OUStringList&                                       lItems)
     throw(css::uno::Exception)
 {
-    css::uno::Reference< css::container::XNameContainer >   xAddRemoveSet = css::uno::Reference< css::container::XNameContainer >  (xSet, css::uno::UNO_QUERY);
-    css::uno::Reference< css::container::XNameReplace >     xReplaceeSet  = css::uno::Reference< css::container::XNameReplace >    (xSet, css::uno::UNO_QUERY);
-    css::uno::Reference< css::lang::XSingleServiceFactory > xFactory      = css::uno::Reference< css::lang::XSingleServiceFactory >(xSet, css::uno::UNO_QUERY);
+    css::uno::Reference< css::container::XNameContainer >   xAddRemoveSet(xSet, css::uno::UNO_QUERY);
+    css::uno::Reference< css::container::XNameReplace >     xReplaceeSet(xSet, css::uno::UNO_QUERY);
+    css::uno::Reference< css::lang::XSingleServiceFactory > xFactory(xSet, css::uno::UNO_QUERY);
 
     for (OUStringList::const_iterator pIt  = lItems.begin();
                                       pIt != lItems.end()  ;
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 6a33329..b82406e 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -632,7 +632,7 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi
         {
             try
             {
-                Reference< XFlushable > xFlushable = Reference< XFlushable >::query( mxTypeDetection );
+                Reference< XFlushable > xFlushable( mxTypeDetection, UNO_QUERY );
                 if( xFlushable.is() )
                     xFlushable->flush();
             }
diff --git a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx
index 98b737c..a33f7cc 100644
--- a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx
+++ b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx
@@ -258,9 +258,9 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[]  )
 
 
     Sequence< Any > arguments(1);
-        arguments[0] = makeAny( FILEOPEN_READONLY_VERSION );
+    arguments[0] = makeAny( FILEOPEN_READONLY_VERSION );
 
-    Reference< XFilePicker > xFilePicker = Reference< XFilePicker >(
+    Reference< XFilePicker > xFilePicker(
         g_xFactory->createInstanceWithArguments(
             FILE_PICKER_SERVICE_NAME, arguments ), UNO_QUERY );
 
diff --git a/framework/source/helper/ocomponentaccess.cxx b/framework/source/helper/ocomponentaccess.cxx
index d5f478b..cd2bdfa 100644
--- a/framework/source/helper/ocomponentaccess.cxx
+++ b/framework/source/helper/ocomponentaccess.cxx
@@ -55,7 +55,7 @@ css::uno::Reference< XEnumeration > SAL_CALL OComponentAccess::createEnumeration
 
     // Set default return value, if method failed.
     // If no desktop exist and there is no task container - return an empty enumeration!
-    css::uno::Reference< XEnumeration > xReturn = css::uno::Reference< XEnumeration >();
+    css::uno::Reference< XEnumeration > xReturn;
 
     // Try to "lock" the desktop for access to task container.
     css::uno::Reference< XInterface > xLock = m_xOwner.get();
@@ -138,7 +138,7 @@ void OComponentAccess::impl_collectAllChildComponents(  const   css::uno::Refere
 css::uno::Reference< XComponent > OComponentAccess::impl_getFrameComponent( const css::uno::Reference< XFrame >& xFrame ) const
 {
     // Set default return value, if method failed.
-    css::uno::Reference< XComponent > xComponent = css::uno::Reference< XComponent >();
+    css::uno::Reference< XComponent > xComponent;
     // Does no controller exists?
     css::uno::Reference< XController > xController = xFrame->getController();
     if ( !xController.is() )
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 56806fe..bde6b83 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -1015,10 +1015,10 @@ void ToolbarLayoutManager::setParentWindow(
 {
     static const char DOCKINGAREASTRING[] = "dockingarea";
 
-    uno::Reference< awt::XWindow > xTopDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
-    uno::Reference< awt::XWindow > xLeftDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
-    uno::Reference< awt::XWindow > xRightDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
-    uno::Reference< awt::XWindow > xBottomDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+    uno::Reference< awt::XWindow > xTopDockWindow( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+    uno::Reference< awt::XWindow > xLeftDockWindow( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+    uno::Reference< awt::XWindow > xRightDockWindow( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+    uno::Reference< awt::XWindow > xBottomDockWindow( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
 
     SolarMutexClearableGuard aWriteLock;
     m_xContainerWindow = uno::Reference< awt::XWindow2 >( xParentWindow, uno::UNO_QUERY );
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 2f02a4c..8ef4229 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -525,10 +525,10 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Desktop::getCurrentFrame() th
     // Start search with our direct active frame (if it exist!).
     // Search on his children for other active frames too.
     // Stop if no one could be found and return last of found ones.
-    css::uno::Reference< css::frame::XFramesSupplier > xLast = css::uno::Reference< css::frame::XFramesSupplier >( getActiveFrame(), css::uno::UNO_QUERY );
+    css::uno::Reference< css::frame::XFramesSupplier > xLast( getActiveFrame(), css::uno::UNO_QUERY );
     if( xLast.is() )
     {
-        css::uno::Reference< css::frame::XFramesSupplier > xNext = css::uno::Reference< css::frame::XFramesSupplier >( xLast->getActiveFrame(), css::uno::UNO_QUERY );
+        css::uno::Reference< css::frame::XFramesSupplier > xNext( xLast->getActiveFrame(), css::uno::UNO_QUERY );
         while( xNext.is() )
         {
             xLast = xNext;
diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx
index 685e14a..4dc434c 100644
--- a/framework/source/uielement/macrosmenucontroller.cxx
+++ b/framework/source/uielement/macrosmenucontroller.cxx
@@ -135,7 +135,7 @@ void MacrosMenuController::addScriptItems( PopupMenu* pPopupMenu, sal_uInt16 sta
     const OUString providerKey("com.sun.star.script.provider.ScriptProviderFor");
     const OUString languageProviderName("com.sun.star.script.provider.LanguageScriptProvider");
     sal_uInt16 itemId = startItemId;
-    Reference< XContentEnumerationAccess > xEnumAccess = Reference< XContentEnumerationAccess >( m_xContext->getServiceManager(), UNO_QUERY_THROW );
+    Reference< XContentEnumerationAccess > xEnumAccess( m_xContext->getServiceManager(), UNO_QUERY_THROW );
     Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration ( languageProviderName );
 
     while ( xEnum->hasMoreElements() )
diff --git a/hwpfilter/source/hwpreader.hxx b/hwpfilter/source/hwpreader.hxx
index a144b50..4142d947 100644
--- a/hwpfilter/source/hwpreader.hxx
+++ b/hwpfilter/source/hwpreader.hxx
@@ -201,15 +201,14 @@ HwpImportFilter::HwpImportFilter(const Reference< XMultiServiceFactory >& rFact)
 {
     OUString sService( WRITER_IMPORTER_NAME );
     try {
-        Reference< XDocumentHandler >
-            xHandler( rFact->createInstance( sService ), UNO_QUERY );
+        Reference< XDocumentHandler > xHandler( rFact->createInstance( sService ), UNO_QUERY );
 
         HwpReader *p = new HwpReader;
         p->setDocumentHandler( xHandler );
 
-        Reference< XImporter > xImporter = Reference< XImporter >( xHandler, UNO_QUERY );
+        Reference< XImporter > xImporter( xHandler, UNO_QUERY );
         rImporter = xImporter;
-        Reference< XFilter > xFilter = Reference< XFilter >( p );
+        Reference< XFilter > xFilter( p );
         rFilter = xFilter;
     }
     catch( Exception & )


More information about the Libreoffice-commits mailing list