summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-05 08:52:58 +0200
committerNoel Grandin <noel@peralex.com>2015-11-05 09:59:30 +0200
commitc8782b39116eee3ddc3ef0a38c6f6dde09b6ec00 (patch)
treea37c11f8ec6436d00b36fec99027bb3b06668372 /sfx2
parentb46496c4154ff3784ecd59ed6e15b6ee07a66f22 (diff)
use uno::Reference::set method instead of assignment
Change-Id: Id9e7621ca7170d6cc80d8ce14f155ce564691ec0
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appopen.cxx2
-rw-r--r--sfx2/source/appl/appuno.cxx34
-rw-r--r--sfx2/source/appl/childwin.cxx6
-rw-r--r--sfx2/source/appl/helpinterceptor.cxx4
-rw-r--r--sfx2/source/appl/imagemgr.cxx4
-rw-r--r--sfx2/source/appl/imestatuswindow.cxx3
-rw-r--r--sfx2/source/appl/opengrf.cxx2
-rw-r--r--sfx2/source/appl/shutdownicon.cxx2
-rw-r--r--sfx2/source/appl/workwin.cxx14
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx10
-rw-r--r--sfx2/source/config/evntconf.cxx7
-rw-r--r--sfx2/source/control/bindings.cxx5
-rw-r--r--sfx2/source/control/querystatus.cxx5
-rw-r--r--sfx2/source/control/recentdocsviewitem.cxx2
-rw-r--r--sfx2/source/control/statcach.cxx4
-rw-r--r--sfx2/source/control/unoctitm.cxx4
-rw-r--r--sfx2/source/dialog/backingcomp.cxx4
-rw-r--r--sfx2/source/dialog/backingwindow.cxx2
-rw-r--r--sfx2/source/dialog/dockwin.cxx2
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx4
-rw-r--r--sfx2/source/dialog/mailmodel.cxx5
-rw-r--r--sfx2/source/dialog/recfloat.cxx5
-rw-r--r--sfx2/source/doc/docfile.cxx6
-rw-r--r--sfx2/source/doc/doctempl.cxx5
-rw-r--r--sfx2/source/doc/doctemplates.cxx2
-rw-r--r--sfx2/source/doc/guisaveas.cxx23
-rw-r--r--sfx2/source/doc/objmisc.cxx6
-rw-r--r--sfx2/source/doc/objserv.cxx2
-rw-r--r--sfx2/source/doc/objstor.cxx33
-rw-r--r--sfx2/source/doc/objxtor.cxx4
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx18
-rw-r--r--sfx2/source/doc/templatedlg.cxx5
-rw-r--r--sfx2/source/notify/eventsupplier.cxx5
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx2
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx3
-rw-r--r--sfx2/source/view/ipclient.cxx2
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx6
-rw-r--r--sfx2/source/view/viewfrm.cxx4
-rw-r--r--sfx2/source/view/viewprn.cxx2
-rw-r--r--sfx2/source/view/viewsh.cxx14
40 files changed, 125 insertions, 147 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 73157a54970e..0d1b0f8fbcc6 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1069,7 +1069,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
if ( xModel.is() )
xController = xModel->getCurrentController();
else
- xController = Reference < XController >( xComp, UNO_QUERY );
+ xController.set( xComp, UNO_QUERY );
}
else
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 94a3e4c5bb7e..52ed0ffcf054 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1680,9 +1680,9 @@ RequestFilterOptions::RequestFilterOptions( uno::Reference< frame::XModel > rMod
OUString temp;
uno::Reference< uno::XInterface > temp2;
document::FilterOptionsRequest aOptionsRequest( temp,
- temp2,
- rModel,
- rProperties );
+ temp2,
+ rModel,
+ rProperties );
m_aRequest <<= aOptionsRequest;
@@ -1690,8 +1690,8 @@ RequestFilterOptions::RequestFilterOptions( uno::Reference< frame::XModel > rMod
m_pOptions = new FilterOptionsContinuation;
m_lContinuations.realloc( 2 );
- m_lContinuations[0] = uno::Reference< task::XInteractionContinuation >( m_pAbort );
- m_lContinuations[1] = uno::Reference< task::XInteractionContinuation >( m_pOptions );
+ m_lContinuations[0].set( m_pAbort );
+ m_lContinuations[1].set( m_pOptions );
}
uno::Any SAL_CALL RequestFilterOptions::getRequest()
@@ -1727,15 +1727,13 @@ RequestPackageReparation_Impl::RequestPackageReparation_Impl( const OUString& aN
{
OUString temp;
uno::Reference< uno::XInterface > temp2;
- document::BrokenPackageRequest aBrokenPackageRequest( temp,
- temp2,
- aName );
- m_aRequest <<= aBrokenPackageRequest;
+ document::BrokenPackageRequest aBrokenPackageRequest( temp, temp2, aName );
+ m_aRequest <<= aBrokenPackageRequest;
m_pApprove = new comphelper::OInteractionApprove;
m_pDisapprove = new comphelper::OInteractionDisapprove;
- m_lContinuations.realloc( 2 );
- m_lContinuations[0] = uno::Reference< task::XInteractionContinuation >( m_pApprove );
- m_lContinuations[1] = uno::Reference< task::XInteractionContinuation >( m_pDisapprove );
+ m_lContinuations.realloc( 2 );
+ m_lContinuations[0].set( m_pApprove );
+ m_lContinuations[1].set( m_pDisapprove );
}
bool RequestPackageReparation_Impl::isApproved()
@@ -1795,13 +1793,11 @@ NotifyBrokenPackage_Impl::NotifyBrokenPackage_Impl( const OUString& aName )
{
OUString temp;
uno::Reference< uno::XInterface > temp2;
- document::BrokenPackageRequest aBrokenPackageRequest( temp,
- temp2,
- aName );
- m_aRequest <<= aBrokenPackageRequest;
- m_pAbort = new comphelper::OInteractionAbort;
- m_lContinuations.realloc( 1 );
- m_lContinuations[0] = uno::Reference< task::XInteractionContinuation >( m_pAbort );
+ document::BrokenPackageRequest aBrokenPackageRequest( temp, temp2, aName );
+ m_aRequest <<= aBrokenPackageRequest;
+ m_pAbort = new comphelper::OInteractionAbort;
+ m_lContinuations.realloc( 1 );
+ m_lContinuations[0].set( m_pAbort );
}
uno::Any SAL_CALL NotifyBrokenPackage_Impl::getRequest()
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index fbac0dc0795c..05c80c279a58 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -88,12 +88,12 @@ class DisposeListener : public ::cppu::WeakImplHelper< css::lang::XEventListener
if( m_pOwner && m_pData )
{
- m_pData->xListener = css::uno::Reference< css::lang::XEventListener >();
+ m_pData->xListener.clear();
if ( m_pData->pWorkWin )
{
// m_pOwner and m_pData will be killed
- m_pData->xFrame = css::uno::Reference< css::frame::XFrame >();
+ m_pData->xFrame.clear();
m_pData->pWorkWin->GetBindings().Execute( m_pOwner->GetType() );
}
else
@@ -747,7 +747,7 @@ void SfxChildWindow::SetFrame( const css::uno::Reference< css::frame::XFrame > &
// Use already existing or create new one.
if( rFrame.is() )
if( !pImp->xListener.is() )
- pImp->xListener = css::uno::Reference< css::lang::XEventListener >( new DisposeListener( this, pImp ) );
+ pImp->xListener.set( new DisposeListener( this, pImp ) );
// Set new frame in data container
// and build new listener connection, if necessary.
diff --git a/sfx2/source/appl/helpinterceptor.cxx b/sfx2/source/appl/helpinterceptor.cxx
index 070a3a96e47d..b25d28b4cd86 100644
--- a/sfx2/source/appl/helpinterceptor.cxx
+++ b/sfx2/source/appl/helpinterceptor.cxx
@@ -106,7 +106,7 @@ void HelpInterceptor_Impl::addURL( const OUString& rURL )
void HelpInterceptor_Impl::setInterception( Reference< XFrame > xFrame )
{
- m_xIntercepted = Reference< XDispatchProviderInterception>( xFrame, UNO_QUERY );
+ m_xIntercepted.set( xFrame, UNO_QUERY );
if ( m_xIntercepted.is() )
m_xIntercepted->registerDispatchProviderInterceptor( static_cast<XDispatchProviderInterceptor*>(this) );
@@ -145,7 +145,7 @@ Reference< XDispatch > SAL_CALL HelpInterceptor_Impl::queryDispatch(
{
DBG_ASSERT( xResult.is(), "invalid dispatch" );
HelpDispatch_Impl* pHelpDispatch = new HelpDispatch_Impl( *this, xResult );
- xResult = Reference< XDispatch >( static_cast< ::cppu::OWeakObject* >(pHelpDispatch), UNO_QUERY );
+ xResult.set( static_cast< ::cppu::OWeakObject* >(pHelpDispatch), UNO_QUERY );
}
return xResult;
diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx
index ca42f41b29df..40ca5e78f6f5 100644
--- a/sfx2/source/appl/imagemgr.cxx
+++ b/sfx2/source/appl/imagemgr.cxx
@@ -111,7 +111,7 @@ Image SAL_CALL GetImage(
if ( xSupplier.is() )
{
Reference< XUIConfigurationManager > xDocUICfgMgr( xSupplier->getUIConfigurationManager(), UNO_QUERY );
- xDocImgMgr = Reference< XImageManager >( xDocUICfgMgr->getImageManager(), UNO_QUERY );
+ xDocImgMgr.set( xDocUICfgMgr->getImageManager(), UNO_QUERY );
}
}
@@ -176,7 +176,7 @@ Image SAL_CALL GetImage(
}
Reference< XUIConfigurationManager > xUICfgMgr = xModuleCfgMgrSupplier->getUIConfigurationManager( aModuleId );
- xModuleImageManager = Reference< XImageManager >( xUICfgMgr->getImageManager(), UNO_QUERY );
+ xModuleImageManager.set( xUICfgMgr->getImageManager(), UNO_QUERY );
m_aModuleIdToImageMgrMap.insert( ModuleIdToImagegMgr::value_type( aModuleId, xModuleImageManager ));
}
diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx
index b8153e9caa44..fdf1369a725e 100644
--- a/sfx2/source/appl/imestatuswindow.cxx
+++ b/sfx2/source/appl/imestatuswindow.cxx
@@ -209,8 +209,7 @@ css::uno::Reference< css::beans::XPropertySet > ImeStatusWindow::getConfig()
css::beans::PropertyState_DIRECT_VALUE);
css::uno::Sequence< css::uno::Any > aArgs(1);
aArgs[0] <<= aArg;
- m_xConfig
- = css::uno::Reference< css::beans::XPropertySet >(
+ m_xConfig.set(
xProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess",
aArgs),
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 8ced8cfa2687..bd42619f9b72 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -89,7 +89,7 @@ SvxOpenGrf_Impl::SvxOpenGrf_Impl()
SFXWB_GRAPHIC)
{
uno::Reference < XFilePicker2 > xFP = aFileDlg.GetFilePicker();
- xCtrlAcc = uno::Reference < XFilePickerControlAccess >(xFP, UNO_QUERY);
+ xCtrlAcc.set(xFP, UNO_QUERY);
}
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index cfc6344ba065..d6f014a28811 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -284,7 +284,7 @@ void ShutdownIcon::FromTemplate()
css::uno::Reference < css::frame::XFramesSupplier > xDesktop ( getInstance()->m_xDesktop, UNO_QUERY);
css::uno::Reference < css::frame::XFrame > xFrame( xDesktop->getActiveFrame() );
if ( !xFrame.is() )
- xFrame = css::uno::Reference < css::frame::XFrame >( xDesktop, UNO_QUERY );
+ xFrame.set( xDesktop, UNO_QUERY );
URL aTargetURL;
aTargetURL.Complete = ".uno:NewDoc";
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 8789a3e70d20..baae2c1c6c6e 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -187,7 +187,7 @@ void LayoutManagerListener::setFrame( const css::uno::Reference< css::frame::XFr
css::uno::Reference< css::frame::XLayoutManagerListener >(
static_cast< OWeakObject* >( this ), css::uno::UNO_QUERY ));
- xPropSet = css::uno::Reference< css::beans::XPropertySet >( xLayoutManager, UNO_QUERY );
+ xPropSet.set( xLayoutManager, UNO_QUERY );
if ( xPropSet.is() )
{
aValue = xPropSet->getPropertyValue( "LockCount" );
@@ -237,7 +237,7 @@ throw( css::uno::RuntimeException, std::exception )
css::uno::Reference< css::frame::XFrame > xFrame( m_xFrame.get(), css::uno::UNO_QUERY );
if ( xFrame.is() )
{
- m_xFrame = css::uno::Reference< css::frame::XFrame >();
+ m_xFrame.clear();
m_bHasFrame = false;
css::uno::Reference< css::beans::XPropertySet > xPropSet( xFrame, css::uno::UNO_QUERY );
@@ -279,7 +279,7 @@ throw( css::uno::RuntimeException, std::exception )
SolarMutexGuard aGuard;
m_pWrkWin = 0;
m_bHasFrame = false;
- m_xFrame = css::uno::Reference< css::frame::XFrame >();
+ m_xFrame.clear();
}
@@ -554,9 +554,8 @@ SfxWorkWindow::SfxWorkWindow( vcl::Window *pWin, SfxBindings& rB, SfxWorkWindow*
// create and initialize layout manager listener
Reference< css::frame::XFrame > xFrame = GetFrameInterface();
LayoutManagerListener* pLayoutManagerListener = new LayoutManagerListener( this );
- m_xLayoutManagerListener = css::uno::Reference< css::lang::XComponent >(
- static_cast< cppu::OWeakObject* >( pLayoutManagerListener ),
- css::uno::UNO_QUERY );
+ m_xLayoutManagerListener.set( static_cast< cppu::OWeakObject* >( pLayoutManagerListener ),
+ css::uno::UNO_QUERY );
pLayoutManagerListener->setFrame( xFrame );
}
@@ -1197,8 +1196,7 @@ Reference< css::task::XStatusIndicator > SfxWorkWindow::GetStatusIndicator()
xLayoutManager->getElement( m_aProgressBarResName );
if ( xProgressBar.is() )
{
- xStatusIndicator = Reference< css::task::XStatusIndicator >(
- xProgressBar->getRealInterface(), UNO_QUERY );
+ xStatusIndicator.set( xProgressBar->getRealInterface(), UNO_QUERY );
}
}
}
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 5679c3596adb..50ad26985c33 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -639,7 +639,7 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const css::uno::Sequence <
uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
uno::Reference< container::XContainerQuery > xTypeCFG;
if( xServiceManager.is() )
- xTypeCFG = uno::Reference < css::container::XContainerQuery >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY );
+ xTypeCFG.set( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY );
if ( xTypeCFG.is() )
{
// make query for all types matching the properties
@@ -813,8 +813,8 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const OUString& rName,
uno::Reference< container::XNameAccess > xTypeCFG ;
if( xServiceManager.is() )
{
- xFilterCFG = uno::Reference< container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY );
- xTypeCFG = uno::Reference< container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY );
+ xFilterCFG.set( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY );
+ xTypeCFG.set( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY );
}
if( xFilterCFG.is() && xTypeCFG.is() )
@@ -1150,8 +1150,8 @@ void SfxFilterContainer::ReadFilters_Impl( bool bUpdate )
uno::Reference< container::XNameAccess > xTypeCFG ;
if( xServiceManager.is() )
{
- xFilterCFG = uno::Reference< container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY );
- xTypeCFG = uno::Reference< container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY );
+ xFilterCFG.set( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY );
+ xTypeCFG.set( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY );
}
if( xFilterCFG.is() && xTypeCFG.is() )
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 9df4ad094384..3005e084b756 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -225,13 +225,12 @@ void PropagateEvent_Impl( SfxObjectShell *pDoc, const OUString& aEventName, cons
uno::Reference < document::XEventsSupplier > xSupplier;
if ( pDoc )
{
- xSupplier = uno::Reference < document::XEventsSupplier >( pDoc->GetModel(), uno::UNO_QUERY );
+ xSupplier.set( pDoc->GetModel(), uno::UNO_QUERY );
}
else
{
- xSupplier = uno::Reference < document::XEventsSupplier >
- ( frame::theGlobalEventBroadcaster::get(::comphelper::getProcessComponentContext()),
- uno::UNO_QUERY );
+ xSupplier.set( frame::theGlobalEventBroadcaster::get(::comphelper::getProcessComponentContext()),
+ uno::UNO_QUERY );
}
if ( xSupplier.is() )
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index fd539fe899e2..3f788bf8183f 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1813,8 +1813,7 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp )
css::uno::Reference < css::frame::XDispatchProvider > xProv;
if ( pDisp )
- xProv = css::uno::Reference < css::frame::XDispatchProvider >
- ( pDisp->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY );
+ xProv.set( pDisp->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY );
SetDispatchProvider_Impl( xProv );
InvalidateAll( true );
@@ -2175,7 +2174,7 @@ uno::Reference < frame::XDispatch > SfxBindings::GetDispatch( const SfxSlot* pSl
new SfxOfficeDispatch( *this, pDispatcher, pSlot, aURL );
pDispatch->SetMasterUnoCommand( bMasterCommand );
- xRet = uno::Reference < frame::XDispatch >( pDispatch );
+ xRet.set( pDispatch );
if ( !pCache )
pCache = GetStateCache( pSlot->nSlotId );
diff --git a/sfx2/source/control/querystatus.cxx b/sfx2/source/control/querystatus.cxx
index 8c5127c5e158..6f86cfc9d1e9 100644
--- a/sfx2/source/control/querystatus.cxx
+++ b/sfx2/source/control/querystatus.cxx
@@ -208,9 +208,8 @@ SfxItemState SfxQueryStatus_Impl::QueryState( SfxPoolItem*& rpPoolItem )
SfxQueryStatus::SfxQueryStatus( const Reference< XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& rCommand )
{
m_pSfxQueryStatusImpl = new SfxQueryStatus_Impl( rDispatchProvider, nSlotId, rCommand );
- m_xStatusListener = Reference< XStatusListener >(
- static_cast< cppu::OWeakObject* >( m_pSfxQueryStatusImpl ),
- UNO_QUERY );
+ m_xStatusListener.set( static_cast< cppu::OWeakObject* >( m_pSfxQueryStatusImpl ),
+ UNO_QUERY );
}
SfxQueryStatus::~SfxQueryStatus()
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx
index 0b202ca8c815..4c1381241cb3 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -191,7 +191,7 @@ void RecentDocsViewItem::OpenDocument()
uno::Reference<frame::XFrame> xActiveFrame = xDesktop->getActiveFrame();
//osl::ClearableMutexGuard aLock(m_aMutex);
- xDispatchProvider = Reference<frame::XDispatchProvider>(xActiveFrame, UNO_QUERY);
+ xDispatchProvider.set(xActiveFrame, UNO_QUERY);
//aLock.clear();
aTargetURL.Complete = maURL;
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
index 6ad13ccb01d1..987323c3e8ff 100644
--- a/sfx2/source/control/statcach.cxx
+++ b/sfx2/source/control/statcach.cxx
@@ -68,7 +68,7 @@ void SAL_CALL BindDispatch_Impl::disposing( const css::lang::EventObject& ) thro
if ( xDisp.is() )
{
xDisp->removeStatusListener( static_cast<css::frame::XStatusListener*>(this), aURL );
- xDisp = css::uno::Reference< css::frame::XDispatch > ();
+ xDisp.clear();
}
}
@@ -154,7 +154,7 @@ void BindDispatch_Impl::Release()
if ( xDisp.is() )
{
xDisp->removeStatusListener( static_cast<css::frame::XStatusListener*>(this), aURL );
- xDisp = css::uno::Reference< css::frame::XDispatch > ();
+ xDisp.clear();
}
pCache = NULL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 813a48aa7a53..2bac67573c33 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -197,7 +197,7 @@ void SfxUnoControllerItem::ReleaseDispatch()
if ( xDispatch.is() )
{
xDispatch->removeStatusListener( static_cast<css::frame::XStatusListener*>(this), aCommand );
- xDispatch = css::uno::Reference< css::frame::XDispatch > ();
+ xDispatch.clear();
}
}
@@ -211,7 +211,7 @@ void SfxUnoControllerItem::GetNewDispatch()
}
// forget old dispatch
- xDispatch = css::uno::Reference< css::frame::XDispatch > ();
+ xDispatch.clear();
// no arms, no cookies !
if ( !pBindings->GetDispatcher_Impl() || !pBindings->GetDispatcher_Impl()->GetFrame() )
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index 6bc43e1def13..72df7c17767d 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -582,7 +582,7 @@ void SAL_CALL BackingComp::disposing( /*IN*/ const css::lang::EventObject& aEven
OUString("unexpected source or called twice"),
static_cast< ::cppu::OWeakObject* >(this));
- m_xWindow = css::uno::Reference< css::awt::XWindow >();
+ m_xWindow.clear();
/* } SAFE */
}
@@ -629,7 +629,7 @@ void SAL_CALL BackingComp::dispose()
}
css::uno::Reference< css::awt::XKeyListener > xKeyThis(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY);
m_xWindow->removeKeyListener(xKeyThis);
- m_xWindow = css::uno::Reference< css::awt::XWindow >();
+ m_xWindow.clear();
}
// forget all other used references
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index 3f88321b06d5..c487880e15c0 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -213,7 +213,7 @@ void BackingWindow::dispose()
xDropTarget->setActive(false);
}
}
- mxDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >();
+ mxDropTargetListener.clear();
}
disposeBuilder();
mpOpenButton.clear();
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 86693b5d1b20..0f350658f0ca 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -155,7 +155,7 @@ SfxDockingWrapper::SfxDockingWrapper( vcl::Window* pParentWnd ,
uno::Reference< awt::XWindow > xWindow;
try
{
- xWindow = uno::Reference< awt::XWindow>(
+ xWindow.set(
xFactoryMgr->createInstanceWithArgumentsAndContext( aArgs, xContext ),
uno::UNO_QUERY );
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 47fe7096b55a..ce20f850c9c2 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -956,7 +956,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
m_bHaveFilterOptions = true;
if( xFactory.is() )
{
- mxFilterCFG = uno::Reference< XNameAccess >(
+ mxFilterCFG.set(
xFactory->createInstance( "com.sun.star.document.FilterFactory" ),
UNO_QUERY );
}
@@ -972,7 +972,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
mbHasSelectionBox = true;
if ( mbExport && !mxFilterCFG.is() && xFactory.is() )
{
- mxFilterCFG = uno::Reference< XNameAccess >(
+ mxFilterCFG.set(
xFactory->createInstance( "com.sun.star.document.FilterFactory" ),
UNO_QUERY );
}
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 352babf489ba..74b18fbc4d7c 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -518,8 +518,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
if ( xDispatchProvider.is() )
{
- xPrepareDispatch = css::uno::Reference< css::frame::XDispatch >(
- xDispatchProvider->queryDispatch( aPrepareURL, OUString(), 0 ));
+ xPrepareDispatch.set( xDispatchProvider->queryDispatch( aPrepareURL, OUString(), 0 ));
if ( xPrepareDispatch.is() )
{
PrepareListener_Impl* pPrepareListener;
@@ -587,7 +586,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
if ( xDispatchProvider.is() )
{
- css::uno::Reference< css::frame::XDispatch > xDispatch = css::uno::Reference< css::frame::XDispatch >(
+ css::uno::Reference< css::frame::XDispatch > xDispatch(
xDispatchProvider->queryDispatch( aURL, OUString(), 0 ));
if ( xDispatch.is() )
{
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx
index 8b68474cda65..0cb4a836985f 100644
--- a/sfx2/source/dialog/recfloat.cxx
+++ b/sfx2/source/dialog/recfloat.cxx
@@ -183,9 +183,8 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl(
m_pTbx,
nItemId,
aCommandStr );
- xStopRecTbxCtrl = uno::Reference< frame::XToolbarController >(
- static_cast< cppu::OWeakObject* >( pController ),
- uno::UNO_QUERY );
+ xStopRecTbxCtrl.set( static_cast< cppu::OWeakObject* >( pController ),
+ uno::UNO_QUERY );
uno::Reference< util::XUpdatable > xUpdate( xStopRecTbxCtrl, uno::UNO_QUERY );
if ( xUpdate.is() )
xUpdate->update();
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index f6a641bd63a9..10243019863e 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1320,8 +1320,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempIfNo )
const SfxUnoAnyItem* pxProgressItem = SfxItemSet::GetItem<SfxUnoAnyItem>(GetItemSet(), SID_PROGRESS_STATUSBAR_CONTROL, false);
if( pxProgressItem && ( pxProgressItem->GetValue() >>= xStatusIndicator ) )
- xProgressHandler = Reference< css::ucb::XProgressHandler >(
- new utl::ProgressHandlerWrap( xStatusIndicator ) );
+ xProgressHandler.set( new utl::ProgressHandlerWrap( xStatusIndicator ) );
uno::Sequence< beans::PropertyValue > aAddProps( 2 );
aAddProps[0].Name = "RepairPackage";
@@ -1358,8 +1357,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempIfNo )
try
{
- pImp->xStorage = uno::Reference< embed::XStorage >(
- ::comphelper::OStorageHelper::GetStorageFactory()->createInstanceWithArguments( aArgs ),
+ pImp->xStorage.set( ::comphelper::OStorageHelper::GetStorageFactory()->createInstanceWithArguments( aArgs ),
uno::UNO_QUERY );
}
catch( const uno::Exception& )
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 1910068932b0..056ca1c7b388 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -831,15 +831,14 @@ bool SfxDocumentTemplates::CopyFrom
uno::Reference< XStorable > xStorable;
try
{
- xStorable = uno::Reference< XStorable >(
+ xStorable.set(
xDesktop->loadComponentFromURL( aTemplURL.GetMainURL(INetURLObject::NO_DECODE),
"_blank",
0,
aArgs ),
UNO_QUERY );
- xDocPropsSupplier = uno::Reference< XDocumentPropertiesSupplier >(
- xStorable, UNO_QUERY );
+ xDocPropsSupplier.set( xStorable, UNO_QUERY );
}
catch( Exception& )
{
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 3a40a3145786..8e831101957c 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -455,7 +455,7 @@ void SfxDocTplService_Impl::init_Impl()
}
OUString const aService = SERVICENAME_TYPEDETECTION;
- mxType = uno::Reference< XTypeDetection > ( mxContext->getServiceManager()->createInstanceWithContext(aService, mxContext), UNO_QUERY );
+ mxType.set( mxContext->getServiceManager()->createInstanceWithContext(aService, mxContext), UNO_QUERY );
getDirList();
readFolderList();
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 0062a93dff97..1ba7ba072f94 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -354,9 +354,9 @@ ModelData_Impl::ModelData_Impl( SfxStoringHelper& aOwner,
// because chart2 only writes the basic stream out.
// In future in might make sense to implement a full scale object shell in
// chart2 and make chart2 an own program.
- m_xModel = uno::Reference< frame::XModel >(xCurrentComponent, uno::UNO_QUERY_THROW );
- m_xStorable = uno::Reference< frame::XStorable >(xModel, uno::UNO_QUERY_THROW );
- m_xStorable2 = uno::Reference< frame::XStorable2 >(xModel, uno::UNO_QUERY_THROW );
+ m_xModel.set(xCurrentComponent, uno::UNO_QUERY_THROW );
+ m_xStorable.set(xModel, uno::UNO_QUERY_THROW );
+ m_xStorable2.set(xModel, uno::UNO_QUERY_THROW );
}
}
catch(...)
@@ -397,7 +397,7 @@ uno::Reference< frame::XStorable > ModelData_Impl::GetStorable()
{
if ( !m_xStorable.is() )
{
- m_xStorable = uno::Reference< frame::XStorable >( m_xModel, uno::UNO_QUERY );
+ m_xStorable.set( m_xModel, uno::UNO_QUERY );
if ( !m_xStorable.is() )
throw uno::RuntimeException();
}
@@ -410,7 +410,7 @@ uno::Reference< frame::XStorable2 > ModelData_Impl::GetStorable2()
{
if ( !m_xStorable2.is() )
{
- m_xStorable2 = uno::Reference< frame::XStorable2 >( m_xModel, uno::UNO_QUERY );
+ m_xStorable2.set( m_xModel, uno::UNO_QUERY );
if ( !m_xStorable2.is() )
throw uno::RuntimeException();
}
@@ -423,7 +423,7 @@ uno::Reference< util::XModifiable > ModelData_Impl::GetModifiable()
{
if ( !m_xModifiable.is() )
{
- m_xModifiable = uno::Reference< util::XModifiable >( m_xModel, uno::UNO_QUERY );
+ m_xModifiable.set( m_xModel, uno::UNO_QUERY );
if ( !m_xModifiable.is() )
throw uno::RuntimeException();
}
@@ -1181,7 +1181,7 @@ OUString ModelData_Impl::GetRecommendedExtension( const OUString& aTypeName )
if ( aTypeName.isEmpty() )
return OUString();
- uno::Reference< container::XNameAccess > xTypeDetection = uno::Reference< container::XNameAccess >(
+ uno::Reference< container::XNameAccess > xTypeDetection(
comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.TypeDetection"),
uno::UNO_QUERY );
if ( xTypeDetection.is() )
@@ -1260,7 +1260,7 @@ OUString ModelData_Impl::GetRecommendedName( const OUString& aSuggestedName, con
if ( !aRecommendedName.isEmpty() && !aTypeName.isEmpty() )
{
// adjust the extension to the type
- uno::Reference< container::XNameAccess > xTypeDetection = uno::Reference< container::XNameAccess >(
+ uno::Reference< container::XNameAccess > xTypeDetection(
comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.TypeDetection"),
uno::UNO_QUERY );
if ( xTypeDetection.is() )
@@ -1294,9 +1294,8 @@ uno::Reference< container::XNameAccess > SfxStoringHelper::GetFilterConfiguratio
{
if ( !m_xFilterCFG.is() )
{
- m_xFilterCFG = uno::Reference< container::XNameAccess >(
- comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.FilterFactory"),
- uno::UNO_QUERY );
+ m_xFilterCFG.set( comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.FilterFactory"),
+ uno::UNO_QUERY );
if ( !m_xFilterCFG.is() )
throw uno::RuntimeException();
@@ -1310,7 +1309,7 @@ uno::Reference< container::XContainerQuery > SfxStoringHelper::GetFilterQuery()
{
if ( !m_xFilterQuery.is() )
{
- m_xFilterQuery = uno::Reference< container::XContainerQuery >( GetFilterConfiguration(), uno::UNO_QUERY );
+ m_xFilterQuery.set( GetFilterConfiguration(), uno::UNO_QUERY );
if ( !m_xFilterQuery.is() )
throw uno::RuntimeException();
}
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 96f23e61d0c9..709775c01613 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1835,10 +1835,8 @@ bool SfxObjectShell::UseInteractionToHandleError(
uno::Sequence< uno::Reference< task::XInteractionContinuation > > lContinuations(2);
::comphelper::OInteractionAbort* pAbort = new ::comphelper::OInteractionAbort();
::comphelper::OInteractionApprove* pApprove = new ::comphelper::OInteractionApprove();
- lContinuations[0] = uno::Reference< task::XInteractionContinuation >(
- static_cast< task::XInteractionContinuation* >( pAbort ), uno::UNO_QUERY );
- lContinuations[1] = uno::Reference< task::XInteractionContinuation >(
- static_cast< task::XInteractionContinuation* >( pApprove ), uno::UNO_QUERY );
+ lContinuations[0].set( static_cast< task::XInteractionContinuation* >( pAbort ), uno::UNO_QUERY );
+ lContinuations[1].set( static_cast< task::XInteractionContinuation* >( pApprove ), uno::UNO_QUERY );
task::ErrorCodeRequest aErrorCode;
aErrorCode.ErrCode = nError;
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 53a318d1830d..0d7b367c5475 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -195,7 +195,7 @@ bool SfxInstanceCloseGuard_Impl::Init_Impl( const uno::Reference< util::XCloseab
try
{
m_pPreventer = new SfxClosePreventer_Impl();
- m_xPreventer = uno::Reference< util::XCloseListener >( m_pPreventer );
+ m_xPreventer.set( m_pPreventer );
xCloseable->addCloseListener( m_xPreventer );
m_xCloseable = xCloseable;
bResult = true;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 7f0a94c1c27b..2c5850e3300a 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -431,7 +431,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
void SfxObjectShell::PrepareSecondTryLoad_Impl()
{
// only for internal use
- pImp->m_xDocStorage = uno::Reference< embed::XStorage >();
+ pImp->m_xDocStorage.clear();
pImp->m_bIsInit = false;
ResetError();
}
@@ -891,9 +891,8 @@ sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDo
css::uno::Reference< XNameAccess > xFilterCFG;
if( xServiceManager.is() )
{
- xFilterCFG = css::uno::Reference< XNameAccess >(
- xServiceManager->createInstance("com.sun.star.document.FilterFactory"),
- UNO_QUERY );
+ xFilterCFG.set( xServiceManager->createInstance("com.sun.star.document.FilterFactory"),
+ UNO_QUERY );
}
if( xFilterCFG.is() )
@@ -2203,11 +2202,14 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
uno::Reference< document::XFilter > xLoader;
if ( !aFilterImplName.isEmpty() )
{
- try{
- xLoader = uno::Reference< document::XFilter >
- ( xFilterFact->createInstanceWithArguments( aFilterName, uno::Sequence < uno::Any >() ), uno::UNO_QUERY );
- }catch(const uno::Exception&)
- { xLoader.clear(); }
+ try
+ {
+ xLoader.set( xFilterFact->createInstanceWithArguments( aFilterName, uno::Sequence < uno::Any >() ), uno::UNO_QUERY );
+ }
+ catch(const uno::Exception&)
+ {
+ xLoader.clear();
+ }
}
if ( xLoader.is() )
{
@@ -2334,11 +2336,14 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
if ( !aFilterImplName.isEmpty() )
{
- try{
- xExporter = uno::Reference< document::XExporter >
- ( xFilterFact->createInstanceWithArguments( aFilterName, uno::Sequence < uno::Any >() ), uno::UNO_QUERY );
- }catch(const uno::Exception&)
- { xExporter.clear(); }
+ try
+ {
+ xExporter.set( xFilterFact->createInstanceWithArguments( aFilterName, uno::Sequence < uno::Any >() ), uno::UNO_QUERY );
+ }
+ catch(const uno::Exception&)
+ {
+ xExporter.clear();
+ }
}
}
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index f2dc2e57468c..e9c5731bee02 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -1094,10 +1094,10 @@ Reference<lang::XComponent> SfxObjectShell::CreateAndLoadComponent( const SfxIte
uno::Reference < frame::XComponentLoader > xLoader;
if ( pFrame )
{
- xLoader = uno::Reference < frame::XComponentLoader >( pFrame->GetFrameInterface(), uno::UNO_QUERY );
+ xLoader.set( pFrame->GetFrameInterface(), uno::UNO_QUERY );
}
else
- xLoader = uno::Reference < frame::XComponentLoader >( frame::Desktop::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY );
+ xLoader.set( frame::Desktop::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY );
Reference <lang::XComponent> xComp;
try
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 9cfb22ca805f..ee9f02a3ab86 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -433,7 +433,7 @@ void SfxOwnFramesLocker::UnlockFrames()
pWindow->Enable();
- m_aLockedFrames[nInd] = Reference< frame::XFrame >();
+ m_aLockedFrames[nInd].clear();
}
}
catch( Exception& )
@@ -784,8 +784,8 @@ void SAL_CALL SfxBaseModel::dispose() throw(RuntimeException, std::exception)
EndListening( *m_pData->m_pObjectShell );
}
- m_pData->m_xCurrent = Reference< frame::XController > ();
- m_pData->m_seqControllers = Sequence< Reference< frame::XController > > () ;
+ m_pData->m_xCurrent.clear();
+ m_pData->m_seqControllers.realloc(0);
// m_pData member must be set to zero before 0delete is called to
// force disposed exception whenever someone tries to access our
@@ -1121,7 +1121,7 @@ void SAL_CALL SfxBaseModel::disconnectController( const Reference< frame::XContr
m_pData->m_seqControllers = aNewSeq;
if ( xController == m_pData->m_xCurrent )
- m_pData->m_xCurrent = Reference< frame::XController > ();
+ m_pData->m_xCurrent.clear();
}
namespace
@@ -3218,10 +3218,8 @@ Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData() throw
// currently no frame for this document at all or View is under construction
return Reference < container::XIndexAccess >();
- m_pData->m_contViewData = Reference < container::XIndexAccess >(
- document::IndexedPropertyValues::create(
- ::comphelper::getProcessComponentContext() ),
- UNO_QUERY );
+ m_pData->m_contViewData.set( document::IndexedPropertyValues::create( ::comphelper::getProcessComponentContext() ),
+ UNO_QUERY );
if ( !m_pData->m_contViewData.is() )
{
@@ -3934,7 +3932,7 @@ Reference< frame::XTitle > SfxBaseModel::impl_getTitleHelper ()
Reference< frame::XModel > xThis (static_cast< frame::XModel* >(this), UNO_QUERY_THROW);
::framework::TitleHelper* pHelper = new ::framework::TitleHelper(xContext);
- m_pData->m_xTitleHelper = Reference< frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pHelper), UNO_QUERY_THROW);
+ m_pData->m_xTitleHelper.set(static_cast< ::cppu::OWeakObject* >(pHelper), UNO_QUERY_THROW);
pHelper->setOwner (xThis );
pHelper->connectWithUntitledNumbers (xDesktop);
}
@@ -3952,7 +3950,7 @@ Reference< frame::XUntitledNumbers > SfxBaseModel::impl_getUntitledHelper ()
Reference< frame::XModel > xThis (static_cast< frame::XModel* >(this), UNO_QUERY_THROW);
::comphelper::NumberedCollection* pHelper = new ::comphelper::NumberedCollection();
- m_pData->m_xNumberedControllers = Reference< frame::XUntitledNumbers >(static_cast< ::cppu::OWeakObject* >(pHelper), UNO_QUERY_THROW);
+ m_pData->m_xNumberedControllers.set(static_cast< ::cppu::OWeakObject* >(pHelper), UNO_QUERY_THROW);
pHelper->setOwner (xThis);
pHelper->setUntitledPrefix (OUString(" : "));
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index e87cc5cf5eed..aef48ecfe082 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1131,9 +1131,8 @@ void SfxTemplateManagerDlg::OnTemplateEdit ()
try
{
- xStorable = uno::Reference< XStorable >(
- mxDesktop->loadComponentFromURL(pItem->getPath(),"_default", 0, aArgs ),
- uno::UNO_QUERY );
+ xStorable.set( mxDesktop->loadComponentFromURL(pItem->getPath(),"_default", 0, aArgs ),
+ uno::UNO_QUERY );
}
catch( const uno::Exception& )
{
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index f788ae16d642..43df7bbe5963 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -241,9 +241,8 @@ void SfxEvents_Impl::Execute( uno::Any& aEventData, const document::DocumentEven
}
else
{
- xProv = uno::Reference< frame::XDispatchProvider > (
- frame::Desktop::create( ::comphelper::getProcessComponentContext() ),
- uno::UNO_QUERY );
+ xProv.set( frame::Desktop::create( ::comphelper::getProcessComponentContext() ),
+ uno::UNO_QUERY );
}
uno::Reference < frame::XDispatch > xDisp;
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 7c4ef5a40fae..e632565d5363 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -238,7 +238,7 @@ void SAL_CALL SidebarController::notifyContextChangeEvent (const css::ui::Contex
rEvent.ContextName);
if (maRequestedContext != maCurrentContext)
{
- mxCurrentController = css::uno::Reference<css::frame::XController>(rEvent.Source, css::uno::UNO_QUERY);
+ mxCurrentController.set(rEvent.Source, css::uno::UNO_QUERY);
maAsynchronousDeckSwitch.CancelRequest();
maContextChangeUpdate.RequestCall();
// TODO: this call is redundant but mandatory for unit test to update context on document loading
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index fb794e636e34..05d47c72bbd4 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -992,8 +992,7 @@ SfxFrameStatusListener* SfxPopupWindow::GetOrCreateStatusListener()
::comphelper::getProcessComponentContext(),
m_xFrame,
this );
- m_xStatusListener = Reference< XComponent >( static_cast< cppu::OWeakObject* >(
- m_pStatusListener ), UNO_QUERY );
+ m_xStatusListener.set( static_cast< cppu::OWeakObject* >( m_pStatusListener ), UNO_QUERY );
}
return m_pStatusListener;
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index e940f507ec95..13d53eb93dd8 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -630,7 +630,7 @@ SfxInPlaceClient::~SfxInPlaceClient()
m_pImp->m_pClient = NULL;
// the next call will destroy m_pImp if no other reference to it exists
- m_pImp->m_xClient = uno::Reference < embed::XEmbeddedClient >();
+ m_pImp->m_xClient.clear();
m_pImp->release();
// TODO/LATER:
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index ba6edfb7467e..05d5a5b25025 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -774,7 +774,7 @@ Reference< frame::XDispatch > SAL_CALL SfxBaseController::queryDispatch( const
Reference< frame::XFrame > xParentFrame;
Reference< frame::XFrame > xOwnFrame = pAct->GetFrame().GetFrameInterface();
if ( xOwnFrame.is() )
- xParentFrame = Reference< frame::XFrame >( xOwnFrame->getCreator(), uno::UNO_QUERY );
+ xParentFrame.set( xOwnFrame->getCreator(), uno::UNO_QUERY );
if ( xParentFrame.is() )
{
@@ -831,7 +831,7 @@ Reference< frame::XDispatch > SAL_CALL SfxBaseController::queryDispatch( const
Reference< frame::XFrame > xParentFrame;
Reference< frame::XFrame > xOwnFrame = pAct->GetFrame().GetFrameInterface();
if ( xOwnFrame.is() )
- xParentFrame = Reference< frame::XFrame >( xOwnFrame->getCreator(), uno::UNO_QUERY );
+ xParentFrame.set( xOwnFrame->getCreator(), uno::UNO_QUERY );
if ( xParentFrame.is() )
{
@@ -1499,7 +1499,7 @@ Reference< frame::XTitle > SfxBaseController::impl_getTitleHelper ()
Reference< frame::XController > xThis (static_cast< frame::XController* >(this), uno::UNO_QUERY_THROW);
::framework::TitleHelper* pHelper = new ::framework::TitleHelper(::comphelper::getProcessComponentContext());
- m_pData->m_xTitleHelper = Reference< frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW);
+ m_pData->m_xTitleHelper.set(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW);
pHelper->setOwner (xThis );
pHelper->connectWithUntitledNumbers (xUntitledProvider);
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 41edaed924c7..411963922ee2 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2616,9 +2616,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro )
}
else
{
- xLib = css::uno::Reference< css::container::XNameAccess >(
- xLibCont->createLibrary(sLib),
- css::uno::UNO_QUERY);
+ xLib.set( xLibCont->createLibrary(sLib), css::uno::UNO_QUERY);
}
// pack the macro as direct usable "sub" routine
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 0d7c8cde155e..d2c381f8826f 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -209,7 +209,7 @@ Sequence< beans::PropertyValue > SfxPrinterController::getMergedOptions() const
mpLastPrinter = xPrinter.get();
VCLXDevice* pXDevice = new VCLXDevice();
pXDevice->SetOutputDevice( mpLastPrinter );
- mxDevice = Reference< awt::XDevice >( pXDevice );
+ mxDevice.set( pXDevice );
}
Sequence< beans::PropertyValue > aRenderOptions( 1 );
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 18d0bb5ddd4d..51eb5d9742ae 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -141,7 +141,7 @@ private:
SfxClipboardChangeListener::SfxClipboardChangeListener( SfxViewShell* pView, const uno::Reference< datatransfer::clipboard::XClipboardNotifier >& xClpbrdNtfr )
: m_pViewShell( 0 ), m_xClpbrdNtfr( xClpbrdNtfr )
{
- m_xCtrl = uno::Reference < lang::XComponent >( pView->GetController(), uno::UNO_QUERY );
+ m_xCtrl.set( pView->GetController(), uno::UNO_QUERY );
if ( m_xCtrl.is() )
{
m_xCtrl->addEventListener( uno::Reference < lang::XEventListener > ( static_cast < lang::XEventListener* >( this ) ) );
@@ -244,9 +244,8 @@ static OUString RetrieveLabelFromCommand(
if ( !xNameAccess.is() )
{
- xNameAccess = css::uno::Reference< css::container::XNameAccess >(
- css::frame::theUICommandDescription::get(xContext),
- css::uno::UNO_QUERY_THROW );
+ xNameAccess.set( css::frame::theUICommandDescription::get(xContext),
+ css::uno::UNO_QUERY_THROW );
s_xNameAccess = xNameAccess;
}
@@ -1949,7 +1948,7 @@ bool SfxViewShell::TryContextMenuInterception( Menu& rIn, const OUString& rMenuI
&rIn, &rMenuIdentifier );
// get selection from controller
- aEvent.Selection = uno::Reference < view::XSelectionSupplier > ( GetController(), uno::UNO_QUERY );
+ aEvent.Selection.set( GetController(), uno::UNO_QUERY );
// call interceptors
::cppu::OInterfaceIteratorHelper aIt( pImp->aInterceptorContainer );
@@ -2049,7 +2048,7 @@ Reference< view::XRenderable > SfxViewShell::GetRenderable()
{
Reference< frame::XModel > xModel( pObj->GetModel() );
if( xModel.is() )
- xRender = Reference< view::XRenderable >( xModel, UNO_QUERY );
+ xRender.set( xModel, UNO_QUERY );
}
return xRender;
}
@@ -2058,8 +2057,7 @@ uno::Reference< datatransfer::clipboard::XClipboardNotifier > SfxViewShell::GetC
{
uno::Reference< datatransfer::clipboard::XClipboardNotifier > xClipboardNotifier;
if ( GetViewFrame() )
- xClipboardNotifier = uno::Reference< datatransfer::clipboard::XClipboardNotifier >(
- GetViewFrame()->GetWindow().GetClipboard(), uno::UNO_QUERY );
+ xClipboardNotifier.set( GetViewFrame()->GetWindow().GetClipboard(), uno::UNO_QUERY );
return xClipboardNotifier;
}