diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-02 10:04:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-02 12:23:16 +0200 |
commit | 5797d29e9ead0a3dd181b616dfcc968a9127012d (patch) | |
tree | ec8828c4c2e7617f8d8e9334507bab517aed6dc9 /framework/source/services | |
parent | 4ea0390faa22037f1d4f703c0882a027cf2ae643 (diff) |
use uno::Reference::set method instead of assignment
Change-Id: Ic979f8a7734d0ef7a915d47a875cdcd460c0cc58
Diffstat (limited to 'framework/source/services')
-rw-r--r-- | framework/source/services/autorecovery.cxx | 13 | ||||
-rw-r--r-- | framework/source/services/desktop.cxx | 22 | ||||
-rw-r--r-- | framework/source/services/dispatchhelper.cxx | 2 | ||||
-rw-r--r-- | framework/source/services/frame.cxx | 16 | ||||
-rw-r--r-- | framework/source/services/pathsettings.cxx | 6 | ||||
-rw-r--r-- | framework/source/services/taskcreatorsrv.cxx | 4 |
6 files changed, 30 insertions, 33 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 76960f78b066..d7da617df0a5 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -1893,7 +1893,7 @@ void AutoRecovery::implts_readConfig() AutoRecovery::TDocumentInfo aInfo; aInfo.NewTempURL.clear(); - aInfo.Document = css::uno::Reference< css::frame::XModel >(); + aInfo.Document.clear(); xItem->getPropertyValue(OUString(CFG_ENTRY_PROP_ORIGINALURL)) >>= aInfo.OrgURL; xItem->getPropertyValue(OUString(CFG_ENTRY_PROP_TEMPURL)) >>= aInfo.OldTempURL; xItem->getPropertyValue(OUString(CFG_ENTRY_PROP_TEMPLATEURL)) >>= aInfo.TemplateURL; @@ -1954,10 +1954,9 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume if (! xCFG.is()) { // open module config on demand and cache the update access - xCFG = css::uno::Reference< css::container::XNameAccess >( - ::comphelper::ConfigurationHelper::openConfig(m_xContext, OUString(CFG_PACKAGE_MODULES), - ::comphelper::ConfigurationHelper::E_STANDARD), - css::uno::UNO_QUERY_THROW); + xCFG.set( ::comphelper::ConfigurationHelper::openConfig(m_xContext, OUString(CFG_PACKAGE_MODULES), + ::comphelper::ConfigurationHelper::E_STANDARD), + css::uno::UNO_QUERY_THROW); /* SAFE */ { osl::MutexGuard g2(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); @@ -2074,7 +2073,7 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn try { - xCFG = css::uno::Reference< css::container::XHierarchicalNameAccess >(implts_openConfig(), css::uno::UNO_QUERY_THROW); + xCFG.set(implts_openConfig(), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::container::XNameAccess > xCheck; xCFG->getByHierarchicalName(OUString(CFG_ENTRY_RECOVERYLIST)) >>= xCheck; @@ -2108,7 +2107,7 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn css::uno::Reference< css::beans::XPropertySet > xSet; bool bNew = (!xCheck->hasByName(sID)); if (bNew) - xSet = css::uno::Reference< css::beans::XPropertySet >(xCreate->createInstance(), css::uno::UNO_QUERY_THROW); + xSet.set(xCreate->createInstance(), css::uno::UNO_QUERY_THROW); else xCheck->getByName(sID) >>= xSet; diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 8ef42297d4f3..de006a7f8522 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -95,7 +95,7 @@ void Desktop::constructorInit() // Attention: We share our frame container with this helper. Container is threadsafe himself ... So I think we can do that. // But look on dispose() for right order of deinitialization. OFrames* pFramesHelper = new OFrames( this, &m_aChildTaskContainer ); - m_xFramesHelper = css::uno::Reference< css::frame::XFrames >( static_cast< ::cppu::OWeakObject* >(pFramesHelper), css::uno::UNO_QUERY ); + m_xFramesHelper.set( static_cast< ::cppu::OWeakObject* >(pFramesHelper), css::uno::UNO_QUERY ); // Initialize a new dispatchhelper-object to handle dispatches. // We use these helper as slave for our interceptor helper ... not directly! @@ -108,14 +108,14 @@ void Desktop::constructorInit() // Hold interception helper by reference only - not by pointer! // So it's easier to destroy it. InterceptionHelper* pInterceptionHelper = new InterceptionHelper( this, xDispatchProvider ); - m_xDispatchHelper = css::uno::Reference< css::frame::XDispatchProvider >( static_cast< ::cppu::OWeakObject* >(pInterceptionHelper), css::uno::UNO_QUERY ); + m_xDispatchHelper.set( static_cast< ::cppu::OWeakObject* >(pInterceptionHelper), css::uno::UNO_QUERY ); OUStringBuffer sUntitledPrefix (256); sUntitledPrefix.append (FWK_RESSTR(STR_UNTITLED_DOCUMENT)); sUntitledPrefix.append (" "); ::comphelper::NumberedCollection* pNumbers = new ::comphelper::NumberedCollection (); - m_xTitleNumberGenerator = css::uno::Reference< css::frame::XUntitledNumbers >(static_cast< ::cppu::OWeakObject* >(pNumbers), css::uno::UNO_QUERY_THROW); + m_xTitleNumberGenerator.set(static_cast< ::cppu::OWeakObject* >(pNumbers), css::uno::UNO_QUERY_THROW); pNumbers->setOwner ( static_cast< ::cppu::OWeakObject* >(this) ); pNumbers->setUntitledPrefix ( sUntitledPrefix.makeStringAndClear () ); @@ -532,7 +532,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Desktop::getCurrentFrame() th while( xNext.is() ) { xLast = xNext; - xNext = css::uno::Reference< css::frame::XFramesSupplier >( xNext->getActiveFrame(), css::uno::UNO_QUERY ); + xNext.set( xNext->getActiveFrame(), css::uno::UNO_QUERY ); } } return css::uno::Reference< css::frame::XFrame >( xLast, css::uno::UNO_QUERY ); @@ -1142,7 +1142,7 @@ void SAL_CALL Desktop::dispatchFinished( const css::frame::DispatchResultEvent& SolarMutexGuard g; if( m_eLoadState != E_INTERACTION ) { - m_xLastFrame = css::uno::Reference< css::frame::XFrame >(); + m_xLastFrame.clear(); m_eLoadState = E_FAILED; if( aEvent.State == css::frame::DispatchResultState::SUCCESS ) { @@ -1213,13 +1213,13 @@ void SAL_CALL Desktop::handle( const css::uno::Reference< css::task::XInteractio for( sal_Int32 nStep=0; nStep<nCount; ++nStep ) { if( ! xAbort.is() ) - xAbort = css::uno::Reference< css::task::XInteractionAbort >( lContinuations[nStep], css::uno::UNO_QUERY ); + xAbort.set( lContinuations[nStep], css::uno::UNO_QUERY ); if( ! xApprove.is() ) - xApprove = css::uno::Reference< css::task::XInteractionApprove >( lContinuations[nStep], css::uno::UNO_QUERY ); + xApprove.set( lContinuations[nStep], css::uno::UNO_QUERY ); if( ! xFilterSelect.is() ) - xFilterSelect = css::uno::Reference< css::document::XInteractionFilterSelect >( lContinuations[nStep], css::uno::UNO_QUERY ); + xFilterSelect.set( lContinuations[nStep], css::uno::UNO_QUERY ); } // differ between abortable interactions (error, unknown filter ...) @@ -1535,7 +1535,7 @@ css::uno::Reference< css::lang::XComponent > Desktop::impl_getFrameComponent( co if( !xController.is() ) { // Controller not exist - use the VCL-component. - xComponent = css::uno::Reference< css::lang::XComponent >( xFrame->getComponentWindow(), css::uno::UNO_QUERY ); + xComponent.set( xFrame->getComponentWindow(), css::uno::UNO_QUERY ); } else { @@ -1544,12 +1544,12 @@ css::uno::Reference< css::lang::XComponent > Desktop::impl_getFrameComponent( co if( xModel.is() ) { // Model exist - use the model as component. - xComponent = css::uno::Reference< css::lang::XComponent >( xModel, css::uno::UNO_QUERY ); + xComponent.set( xModel, css::uno::UNO_QUERY ); } else { // Model not exist - use the controller as component. - xComponent = css::uno::Reference< css::lang::XComponent >( xController, css::uno::UNO_QUERY ); + xComponent.set( xController, css::uno::UNO_QUERY ); } } diff --git a/framework/source/services/dispatchhelper.cxx b/framework/source/services/dispatchhelper.cxx index 4548670d6d46..1c0b9d163bbe 100644 --- a/framework/source/services/dispatchhelper.cxx +++ b/framework/source/services/dispatchhelper.cxx @@ -120,7 +120,7 @@ css::uno::Any SAL_CALL DispatchHelper::executeDispatch( css::uno::Reference< css::frame::XDispatchResultListener > xListener(xTHIS, css::uno::UNO_QUERY); /* SAFE { */ osl::ClearableMutexGuard aWriteLock(m_mutex); - m_xBroadcaster = css::uno::Reference< css::uno::XInterface >(xNotifyDispatch, css::uno::UNO_QUERY); + m_xBroadcaster.set(xNotifyDispatch, css::uno::UNO_QUERY); m_aResult = css::uno::Any(); m_aBlock.reset(); aWriteLock.clear(); diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 74d7f51c6d57..c10e13575c87 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -524,26 +524,26 @@ void Frame::initListeners() css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( static_cast< ::cppu::OWeakObject* >(pDispatchHelper), css::uno::UNO_QUERY ); DispatchInformationProvider* pInfoHelper = new DispatchInformationProvider(m_xContext, this); - m_xDispatchInfoHelper = css::uno::Reference< css::frame::XDispatchInformationProvider >( static_cast< ::cppu::OWeakObject* >(pInfoHelper), css::uno::UNO_QUERY ); + m_xDispatchInfoHelper.set( static_cast< ::cppu::OWeakObject* >(pInfoHelper), css::uno::UNO_QUERY ); // Initialize a new interception helper object to handle dispatches and implement an interceptor mechanism. // Set created dispatch provider as slowest slave of it. // Hold interception helper by reference only - not by pointer! // So it's easier to destroy it. InterceptionHelper* pInterceptionHelper = new InterceptionHelper( this, xDispatchProvider ); - m_xDispatchHelper = css::uno::Reference< css::frame::XDispatchProvider >( static_cast< ::cppu::OWeakObject* >(pInterceptionHelper), css::uno::UNO_QUERY ); + m_xDispatchHelper.set( static_cast< ::cppu::OWeakObject* >(pInterceptionHelper), css::uno::UNO_QUERY ); // Initialize a new XFrames-helper-object to handle XIndexAccess and XElementAccess. // We hold member as reference ... not as pointer too! // Attention: We share our frame container with this helper. Container is threadsafe himself ... So I think we can do that. // But look on dispose() for right order of deinitialization. OFrames* pFramesHelper = new OFrames( this, &m_aChildFrameContainer ); - m_xFramesHelper = css::uno::Reference< css::frame::XFrames >( static_cast< ::cppu::OWeakObject* >(pFramesHelper), css::uno::UNO_QUERY ); + m_xFramesHelper.set( static_cast< ::cppu::OWeakObject* >(pFramesHelper), css::uno::UNO_QUERY ); // Initialize a the drop target listener. // We hold member as reference ... not as pointer too! OpenFileDropTargetListener* pDropListener = new OpenFileDropTargetListener( m_xContext, this ); - m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >( static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY ); + m_xDropTargetListener.set( static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY ); // Safe impossible cases // We can't work without these helpers! @@ -853,7 +853,7 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >& // Initialize title functionality TitleHelper* pTitleHelper = new TitleHelper( xContext ); - m_xTitleHelper = css::uno::Reference< css::frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pTitleHelper), css::uno::UNO_QUERY_THROW); + m_xTitleHelper.set(static_cast< ::cppu::OWeakObject* >(pTitleHelper), css::uno::UNO_QUERY_THROW); pTitleHelper->setOwner(xThis); } @@ -2038,7 +2038,7 @@ void SAL_CALL Frame::dispose() throw( css::uno::RuntimeException, std::exception if( m_xParent.is() ) { m_xParent->getFrames()->remove( xThis ); - m_xParent = css::uno::Reference< css::frame::XFramesSupplier >(); + m_xParent.clear(); } /* } SAFE */ @@ -2565,7 +2565,7 @@ void SAL_CALL Frame::disposing( const css::lang::EventObject& aEvent ) throw( cs aWriteLock.clear(); implts_stopWindowListening(); aWriteLock.reset(); - m_xContainerWindow = css::uno::Reference< css::awt::XWindow >(); + m_xContainerWindow.clear(); } } @@ -2801,7 +2801,7 @@ void Frame::impl_disposeContainerWindow( css::uno::Reference< css::awt::XWindow // All VclComponents are XComponents; so call dispose before discarding // a css::uno::Reference< XVclComponent >, because this frame is the owner of the window xWindow->dispose(); - xWindow = css::uno::Reference< css::awt::XWindow >(); + xWindow.clear(); } } diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx index 6764d1e1cbe7..fadcaf5321b4 100644 --- a/framework/source/services/pathsettings.cxx +++ b/framework/source/services/pathsettings.cxx @@ -1462,8 +1462,7 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgOld() if (! xCfg.is()) { - xCfg = css::uno::Reference< css::container::XNameAccess >( - ::comphelper::ConfigurationHelper::openConfig( + xCfg.set( ::comphelper::ConfigurationHelper::openConfig( m_xContext, CFG_NODE_OLD, ::comphelper::ConfigurationHelper::E_STANDARD), // not readonly! Sometimes we need write access there !!! @@ -1490,8 +1489,7 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgNew() if (! xCfg.is()) { - xCfg = css::uno::Reference< css::container::XNameAccess >( - ::comphelper::ConfigurationHelper::openConfig( + xCfg.set( ::comphelper::ConfigurationHelper::openConfig( m_xContext, CFG_NODE_NEW, ::comphelper::ConfigurationHelper::E_STANDARD), diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index bbe7a818a09b..70c1651707f8 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -238,7 +238,7 @@ css::uno::Reference< css::awt::XWindow > TaskCreatorService::implts_createContai if ( ! xParentWindow.is()) bTopWindow = false; else - xParentWindowPeer = css::uno::Reference< css::awt::XWindowPeer >(xParentWindow, css::uno::UNO_QUERY_THROW); + xParentWindowPeer.set(xParentWindow, css::uno::UNO_QUERY_THROW); } // describe window properties. @@ -248,7 +248,7 @@ css::uno::Reference< css::awt::XWindow > TaskCreatorService::implts_createContai aDescriptor.Type = css::awt::WindowClass_TOP; aDescriptor.WindowServiceName = "window"; aDescriptor.ParentIndex = -1; - aDescriptor.Parent = css::uno::Reference< css::awt::XWindowPeer >(); + aDescriptor.Parent.clear(); aDescriptor.Bounds = aPosSize; aDescriptor.WindowAttributes = css::awt::WindowAttribute::BORDER | css::awt::WindowAttribute::MOVEABLE | |