diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-11-01 09:05:58 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-01 15:26:10 +0000 |
commit | 0e6544903bc572d1d6051cbb89a4cfb727401159 (patch) | |
tree | 5090895789c763971457ef11fc8de55aed77d019 | |
parent | no need to use OUString constructor in call to createInstance (diff) | |
download | core-0e6544903bc572d1d6051cbb89a4cfb727401159.tar.gz core-0e6544903bc572d1d6051cbb89a4cfb727401159.zip |
no need to be so verbose in constructing uno::Reference
Change-Id: I187a26e200e9ecaff2adaf53a2ba3f6e87346030
Reviewed-on: https://gerrit.libreoffice.org/19724
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | eventattacher/source/eventattacher.cxx | 2 | ||||
-rw-r--r-- | extensions/source/bibliography/framectr.cxx | 4 | ||||
-rw-r--r-- | filter/source/config/cache/filtercache.cxx | 6 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 2 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/workbench/Test_fps.cxx | 4 | ||||
-rw-r--r-- | framework/source/helper/ocomponentaccess.cxx | 4 | ||||
-rw-r--r-- | framework/source/layoutmanager/toolbarlayoutmanager.cxx | 8 | ||||
-rw-r--r-- | framework/source/services/desktop.cxx | 4 | ||||
-rw-r--r-- | framework/source/uielement/macrosmenucontroller.cxx | 2 | ||||
-rw-r--r-- | hwpfilter/source/hwpreader.hxx | 7 |
10 files changed, 21 insertions, 22 deletions
diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx index 79cd4db05102..b3997aefaed3 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 596d51276ecd..abc6a672cd88 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 a26f5e0540ad..65cba521b004 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 6a333298f231..b82406e16256 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 98b737cb243f..a33f7ccad3ca 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 d5f478b0a6b4..cd2bdfa67ef0 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 56806fe2c35f..bde6b83204bd 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 2f02a4ce5e23..8ef42297d4f3 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 685e14a89a19..4dc434ca5235 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 a144b50afd6d..4142d94769f3 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 & ) |