diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-05 09:49:43 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-05 09:59:30 +0200 |
commit | 3d96f1ef5556869bb60522c9cfa5c9c6f8db0a18 (patch) | |
tree | dd4a4f6f457333ff91660824b817db22c461bf10 | |
parent | 3fdbf5935e0aff6350e861e868c7e0a12dd1bc8f (diff) |
use uno::Reference::set method instead of assignment
Change-Id: I2f8c9cb71a06f7796576509f605796624e654422
53 files changed, 136 insertions, 149 deletions
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx index cc7e1e456937..b05c7a8640df 100644 --- a/svtools/source/config/accessibilityoptions.cxx +++ b/svtools/source/config/accessibilityoptions.cxx @@ -113,11 +113,11 @@ SvtAccessibilityOptions_Impl::SvtAccessibilityOptions_Impl() { try { - m_xCfg = css::uno::Reference< css::container::XNameAccess >( + m_xCfg.set( ::comphelper::ConfigurationHelper::openConfig( - comphelper::getProcessComponentContext(), - s_sAccessibility, - ::comphelper::ConfigurationHelper::E_STANDARD), + comphelper::getProcessComponentContext(), + s_sAccessibility, + ::comphelper::ConfigurationHelper::E_STANDARD), css::uno::UNO_QUERY); bIsModified = false; diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx index f31041077304..1137e21a89cc 100644 --- a/svtools/source/config/printoptions.cxx +++ b/svtools/source/config/printoptions.cxx @@ -120,11 +120,11 @@ SvtPrintOptions_Impl::SvtPrintOptions_Impl(const OUString& rConfigRoot) { try { - m_xCfg = css::uno::Reference< css::container::XNameAccess >( + m_xCfg.set( ::comphelper::ConfigurationHelper::openConfig( - comphelper::getProcessComponentContext(), - ROOTNODE_PRINTOPTION, - ::comphelper::ConfigurationHelper::E_STANDARD), + comphelper::getProcessComponentContext(), + ROOTNODE_PRINTOPTION, + ::comphelper::ConfigurationHelper::E_STANDARD), css::uno::UNO_QUERY); if (m_xCfg.is()) diff --git a/svtools/source/config/test/test.cxx b/svtools/source/config/test/test.cxx index 0ca5c5a2d2ea..3b01d07d19cf 100644 --- a/svtools/source/config/test/test.cxx +++ b/svtools/source/config/test/test.cxx @@ -210,7 +210,7 @@ Reference< XMultiServiceFactory > TestApplication::getUNOServiceManager() { Reference< XComponentContext > rCtx = cppu::defaultBootstrap_InitialComponentContext(); - smgr = Reference< XMultiServiceFactory > ( rCtx->getServiceManager() , UNO_QUERY ); + smgr.set( rCtx->getServiceManager() , UNO_QUERY ); } return smgr; } diff --git a/svtools/source/control/accessibleruler.cxx b/svtools/source/control/accessibleruler.cxx index 849a6209c283..c6280d5070e8 100644 --- a/svtools/source/control/accessibleruler.cxx +++ b/svtools/source/control/accessibleruler.cxx @@ -349,7 +349,7 @@ void SAL_CALL SvtRulerAccessible::disposing() comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( mnClientId, *this ); mnClientId = 0; } - mxParent = uno::Reference< XAccessible >(); + mxParent.clear(); } } } diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 69fbbef5de85..e1871b8c372e 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -138,11 +138,11 @@ const Reference< XAccessibleContext >& ToolbarMenuEntry::GetAccessible( bool bCr { if( mpControl ) { - mxAccContext = Reference< XAccessibleContext >( mpControl->GetAccessible(), UNO_QUERY ); + mxAccContext.set( mpControl->GetAccessible(), UNO_QUERY ); } else { - mxAccContext = Reference< XAccessibleContext >( new ToolbarMenuEntryAcc( this ) ); + mxAccContext.set( new ToolbarMenuEntryAcc( this ) ); } } diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx index 5bfc82116f33..c27c689f665a 100644 --- a/svtools/source/control/toolbarmenuacc.cxx +++ b/svtools/source/control/toolbarmenuacc.cxx @@ -368,7 +368,7 @@ Reference< XAccessible > SAL_CALL ToolbarMenuAcc::getAccessibleAtPoint( const aw } else { - xRet = Reference< XAccessible >( pEntry->GetAccessible(true), UNO_QUERY ); + xRet.set( pEntry->GetAccessible(true), UNO_QUERY ); } } } diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index 756ac3d55161..1a3bb0fe30ca 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -851,7 +851,7 @@ void AssignmentPersistentData::ImplCommit() Reference< XTablesSupplier > xSupplTables(xConn, UNO_QUERY); if (xSupplTables.is()) { - m_xCurrentDatasourceTables = Reference< XNameAccess >(xSupplTables->getTables(), UNO_QUERY); + m_xCurrentDatasourceTables.set(xSupplTables->getTables(), UNO_QUERY); if (m_xCurrentDatasourceTables.is()) aTableNames = m_xCurrentDatasourceTables->getElementNames(); } diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index 5ccc99e3b65f..74a2f39ffd1f 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -466,11 +466,11 @@ bool ExportDialog::GetGraphicStream() uno::Reference< lang::XComponent > xSourceDoc; if ( mxPage.is() ) - xSourceDoc = uno::Reference< lang::XComponent >( mxPage, uno::UNO_QUERY_THROW ); + xSourceDoc.set( mxPage, uno::UNO_QUERY_THROW ); else if ( mxShapes.is() ) - xSourceDoc = uno::Reference< lang::XComponent >( mxShapes, uno::UNO_QUERY_THROW ); + xSourceDoc.set( mxShapes, uno::UNO_QUERY_THROW ); else if ( mxShape.is() ) - xSourceDoc = uno::Reference< lang::XComponent >( mxShape, uno::UNO_QUERY_THROW ); + xSourceDoc.set( mxShape, uno::UNO_QUERY_THROW ); if ( xSourceDoc.is() ) { xGraphicExporter->setSourceDocument( xSourceDoc ); diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index d5b0a1d1173e..ca850ebc1714 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -358,7 +358,7 @@ uno::Reference< beans::XPropertySet > SAL_CALL GraphicProvider::queryGraphicDesc if( xGraphic.is() ) { - xRet = uno::Reference< beans::XPropertySet >( xGraphic, uno::UNO_QUERY ); + xRet.set( xGraphic, uno::UNO_QUERY ); } else { @@ -371,7 +371,7 @@ uno::Reference< beans::XPropertySet > SAL_CALL GraphicProvider::queryGraphicDesc { uno::Reference< ::graphic::XGraphic > xGraphic( implLoadBitmap( xBtm ) ); if( xGraphic.is() ) - xRet = uno::Reference< beans::XPropertySet >( xGraphic, uno::UNO_QUERY ); + xRet.set( xGraphic, uno::UNO_QUERY ); } return xRet; diff --git a/svtools/source/java/javacontext.cxx b/svtools/source/java/javacontext.cxx index 759570d3f3bd..3830ee557555 100644 --- a/svtools/source/java/javacontext.cxx +++ b/svtools/source/java/javacontext.cxx @@ -70,8 +70,7 @@ Any SAL_CALL JavaContext::getValueByName( const OUString& Name) throw (RuntimeEx { osl::MutexGuard aGuard(osl::Mutex::getGlobalMutex()); if (!m_xHandler.is()) - m_xHandler = Reference< XInteractionHandler >( - new JavaInteractionHandler(m_bShowErrorsOnce)); + m_xHandler.set( new JavaInteractionHandler(m_bShowErrorsOnce)); } retVal = makeAny(m_xHandler); diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx index 82a113371abe..2f9bf8f87ecc 100644 --- a/svtools/source/java/javainteractionhandler.cxx +++ b/svtools/source/java/javainteractionhandler.cxx @@ -94,14 +94,14 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque for ( i = 0; i < aSeqCont.getLength(); i++ ) { - abort = Reference< XInteractionAbort>::query( aSeqCont[i]); + abort.set( aSeqCont[i], UNO_QUERY ); if ( abort.is() ) break; } for ( i= 0; i < aSeqCont.getLength(); i++) { - retry= Reference<XInteractionRetry>::query( aSeqCont[i]); + retry.set( aSeqCont[i], UNO_QUERY ); if ( retry.is() ) break; } diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 1fac755a5cf0..83fa88591c8e 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -112,7 +112,7 @@ void AcceleratorExecute::init(const css::uno::Reference< css::uno::XComponentCon // specify our internal dispatch provider // frame or desktop?! => document or global config. bool bDesktopIsUsed = false; - m_xDispatcher = css::uno::Reference< css::frame::XDispatchProvider >(xEnv, css::uno::UNO_QUERY); + m_xDispatcher.set(xEnv, css::uno::UNO_QUERY); if (!m_xDispatcher.is()) { aLock.clear(); diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx index cc38346d136f..bd70919a1063 100644 --- a/svtools/source/misc/embedtransfer.cxx +++ b/svtools/source/misc/embedtransfer.cxx @@ -199,7 +199,7 @@ bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavo void SvEmbedTransferHelper::ObjectReleased() { - m_xObj = uno::Reference< embed::XEmbeddedObject >(); + m_xObj.clear(); } void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc, diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx index 4f27a682fe7a..ce325fd018eb 100644 --- a/svtools/source/uno/contextmenuhelper.cxx +++ b/svtools/source/uno/contextmenuhelper.cxx @@ -404,8 +404,7 @@ ContextMenuHelper::associateUIConfigurationManagers() { uno::Reference< ui::XUIConfigurationManager > xDocUICfgMgr( xSupplier->getUIConfigurationManager(), uno::UNO_QUERY ); - m_xDocImageMgr = uno::Reference< ui::XImageManager >( - xDocUICfgMgr->getImageManager(), uno::UNO_QUERY ); + m_xDocImageMgr.set( xDocUICfgMgr->getImageManager(), uno::UNO_QUERY ); } } @@ -424,8 +423,7 @@ ContextMenuHelper::associateUIConfigurationManagers() xModuleCfgMgrSupplier->getUIConfigurationManager( aModuleId )); if ( xUICfgMgr.is() ) { - m_xModuleImageMgr = uno::Reference< ui::XImageManager >( - xUICfgMgr->getImageManager(), uno::UNO_QUERY ); + m_xModuleImageMgr.set( xUICfgMgr->getImageManager(), uno::UNO_QUERY ); } uno::Reference< container::XNameAccess > xNameAccess( diff --git a/svtools/source/uno/fpicker.cxx b/svtools/source/uno/fpicker.cxx index 6b5848ec628a..f1cff13f2242 100644 --- a/svtools/source/uno/fpicker.cxx +++ b/svtools/source/uno/fpicker.cxx @@ -66,7 +66,7 @@ Reference< css::uno::XInterface > FilePicker_CreateInstance ( Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager()); if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog()) { - xResult = Reference< css::uno::XInterface >( Application::createFilePicker( context ) ); + xResult.set( Application::createFilePicker( context ) ); if (!xResult.is()) { @@ -139,7 +139,7 @@ Reference< css::uno::XInterface > FolderPicker_CreateInstance ( Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager()); if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog()) { - xResult = Reference< css::uno::XInterface >( Application::createFolderPicker( context ) ); + xResult.set( Application::createFolderPicker( context ) ); if (!xResult.is()) { try diff --git a/svtools/source/uno/framestatuslistener.cxx b/svtools/source/uno/framestatuslistener.cxx index 98d5724d7567..aed11138467f 100644 --- a/svtools/source/uno/framestatuslistener.cxx +++ b/svtools/source/uno/framestatuslistener.cxx @@ -189,7 +189,7 @@ void FrameStatusListener::addStatusListener( const OUString& aCommandURL ) xURLTransformer->parseStrict( aTargetURL ); xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 ); - xStatusListener = Reference< XStatusListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ); + xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY ); URLToDispatchMap::iterator aIter = m_aListenerMap.find( aCommandURL ); if ( aIter != m_aListenerMap.end() ) { @@ -238,7 +238,7 @@ void FrameStatusListener::bindListener() Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY ); if ( m_xContext.is() && xDispatchProvider.is() ) { - xStatusListener = Reference< XStatusListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ); + xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY ); URLToDispatchMap::iterator pIter = m_aListenerMap.begin(); while ( pIter != m_aListenerMap.end() ) { diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx index a5553d3510ae..eede3ba0da08 100644 --- a/svtools/source/uno/statusbarcontroller.cxx +++ b/svtools/source/uno/statusbarcontroller.cxx @@ -387,7 +387,7 @@ void StatusbarController::addStatusListener( const OUString& aCommandURL ) xURLTransformer->parseStrict( aTargetURL ); xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 ); - xStatusListener = Reference< XStatusListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ); + xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY ); URLToDispatchMap::iterator aIter = m_aListenerMap.find( aCommandURL ); if ( aIter != m_aListenerMap.end() ) { @@ -435,7 +435,7 @@ void StatusbarController::bindListener() Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY ); if ( m_xContext.is() && xDispatchProvider.is() ) { - xStatusListener = Reference< XStatusListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ); + xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY ); URLToDispatchMap::iterator pIter = m_aListenerMap.begin(); while ( pIter != m_aListenerMap.end() ) { diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 2ef47dee93ae..e4aaff3e83f1 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -114,7 +114,7 @@ Reference< XLayoutManager > ToolboxController::getLayoutManager() const Reference< XPropertySet > xPropSet; { SolarMutexGuard aSolarMutexGuard; - xPropSet = Reference< XPropertySet >( m_xFrame, UNO_QUERY ); + xPropSet.set( m_xFrame, UNO_QUERY ); } if ( xPropSet.is() ) @@ -422,7 +422,7 @@ void ToolboxController::addStatusListener( const OUString& aCommandURL ) m_xUrlTransformer->parseStrict( aTargetURL ); xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 ); - xStatusListener = Reference< XStatusListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ); + xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY ); URLToDispatchMap::iterator aIter = m_aListenerMap.find( aCommandURL ); if ( aIter != m_aListenerMap.end() ) { @@ -497,7 +497,7 @@ void ToolboxController::bindListener() Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY ); if ( m_xContext.is() && xDispatchProvider.is() ) { - xStatusListener = Reference< XStatusListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ); + xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY ); URLToDispatchMap::iterator pIter = m_aListenerMap.begin(); while ( pIter != m_aListenerMap.end() ) { @@ -647,7 +647,7 @@ void ToolboxController::updateStatus( const OUString& aCommandURL ) // Try to find a dispatch object for the requested command URL Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY ); - xStatusListener = Reference< XStatusListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ); + xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY ); if ( m_xContext.is() && xDispatchProvider.is() ) { aTargetURL.Complete = aCommandURL; diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 9fd40a52d78f..586521aa53f1 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -454,8 +454,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL } } } - xStateSet = Reference<XAccessibleStateSet>( - new ::utl::AccessibleStateSetHelper (*pStateSet)); + xStateSet.set( new ::utl::AccessibleStateSetHelper (*pStateSet)); } else { @@ -500,8 +499,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL } // Create a copy of the state set that may be modified by the // caller without affecting the current state set. - xStateSet = Reference<XAccessibleStateSet>( - new ::utl::AccessibleStateSetHelper (*pStateSet)); + xStateSet.set( new ::utl::AccessibleStateSetHelper (*pStateSet)); } } UpdateDocumentAllSelState(xStateSet); diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index a9c609e361f9..7464cf8426f9 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -1136,7 +1136,7 @@ namespace accessibility ::uno::Reference< XAccessible > xPara; ::accessibility::AccessibleParaManager::WeakPara::HardRefType aHardRef( begin->first.get() ); if( aHardRef.is() ) - xPara = ::uno::Reference< XAccessible >( aHardRef.getRef(), ::uno::UNO_QUERY ); + xPara.set( aHardRef.getRef(), ::uno::UNO_QUERY ); // release everything from the remove position until the end maParaManager.Release(aFunctor.GetParaIndex(), nCurrParas); diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index 3117101f0bc6..0a01bedeb7c7 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -171,7 +171,7 @@ uno::Reference<XAccessible> ShapeTypeHandler::Instance().CreateAccessibleObject ( aShapeInfo, maShapeTreeInfo)); - rChildDescriptor.mxAccessibleShape = uno::Reference<XAccessible> ( + rChildDescriptor.mxAccessibleShape.set( static_cast<uno::XWeak*>(pShape.get()), uno::UNO_QUERY); if ( pShape.is() ) @@ -613,8 +613,7 @@ void ChildrenManagerImpl::SetInfo (const AccessibleShapeTreeInfo& rShapeTreeInfo SolarMutexGuard g; xCurrentBroadcaster = maShapeTreeInfo.GetModelBroadcaster(); xCurrentController = maShapeTreeInfo.GetController(); - xCurrentSelectionSupplier = Reference<view::XSelectionSupplier> ( - xCurrentController, uno::UNO_QUERY); + xCurrentSelectionSupplier.set( xCurrentController, uno::UNO_QUERY); maShapeTreeInfo = rShapeTreeInfo; } @@ -893,10 +892,8 @@ void ChildrenManagerImpl::UpdateSelection() Reference<drawing::XShape> xSelectedShape; if (xSelectionSupplier.is()) { - xSelectedShapeAccess = Reference<container::XIndexAccess> ( - xSelectionSupplier->getSelection(), uno::UNO_QUERY); - xSelectedShape = Reference<drawing::XShape> ( - xSelectionSupplier->getSelection(), uno::UNO_QUERY); + xSelectedShapeAccess.set( xSelectionSupplier->getSelection(), uno::UNO_QUERY); + xSelectedShape.set( xSelectionSupplier->getSelection(), uno::UNO_QUERY); } // Remember the current and new focused shape. diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx index 95ae358444f9..b5489af9f36e 100644 --- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx +++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx @@ -424,7 +424,7 @@ void SAL_CALL SvxPixelCtlAccessible::disposing() mnClientId = 0; } } - //mxParent = uno::Reference< XAccessible >(); + //mxParent.clear(); } } @@ -497,7 +497,7 @@ uno::Reference<XAccessible> SvxPixelCtlAccessible::CreateChild (long nIndex,Poin void SvxPixelCtlAccessible::LoseFocus() { - m_xCurChild = uno::Reference< XAccessible >() ; + m_xCurChild.clear(); } void SvxPixelCtlAccessibleChild::CheckChild() @@ -808,7 +808,7 @@ void SAL_CALL SvxPixelCtlAccessibleChild::disposing() mnClientId = 0; } - mxParent = uno::Reference< XAccessible >(); + mxParent.clear(); delete mpBoundingBox; } diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx index 70df0c9d618f..954766e30a2f 100644 --- a/svx/source/core/graphichelper.cxx +++ b/svx/source/core/graphichelper.cxx @@ -268,7 +268,7 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha aDescriptor[1].Name = "URL"; aDescriptor[1].Value <<= sPath; - Reference< XComponent > xSourceDocument = Reference< XComponent >( xShape, UNO_QUERY_THROW ); + Reference< XComponent > xSourceDocument( xShape, UNO_QUERY_THROW ); if ( xSourceDocument.is() ) { xGraphicExporter->setSourceDocument( xSourceDocument ); diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index 00c0af858c10..736c957405b4 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -703,7 +703,7 @@ SaveProgressDialog::SaveProgressDialog(vcl::Window* pParent, RecoveryCore* pCore m_pProgrParent->set_height_request(aSize.Height()); PluginProgress* pProgress = new PluginProgress(m_pProgrParent, pCore->getComponentContext()); - m_xProgress = css::uno::Reference< css::task::XStatusIndicator >(static_cast< css::task::XStatusIndicator* >(pProgress), css::uno::UNO_QUERY_THROW); + m_xProgress.set(static_cast< css::task::XStatusIndicator* >(pProgress), css::uno::UNO_QUERY_THROW); } SaveProgressDialog::~SaveProgressDialog() @@ -889,7 +889,7 @@ RecoveryDialog::RecoveryDialog(vcl::Window* pParent, RecoveryCore* pCore) m_pFileListLB->InsertHeaderEntry(get<FixedText>("nameft")->GetText() + "\t" + get<FixedText>("statusft")->GetText()); PluginProgress* pProgress = new PluginProgress(m_pProgrParent, pCore->getComponentContext()); - m_xProgress = css::uno::Reference< css::task::XStatusIndicator >(static_cast< css::task::XStatusIndicator* >(pProgress), css::uno::UNO_QUERY_THROW); + m_xProgress.set(static_cast< css::task::XStatusIndicator* >(pProgress), css::uno::UNO_QUERY_THROW); const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); m_pTitleFT->SetBackground(rStyleSettings.GetWindowColor()); diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 70ecd3a60bc6..49faa4561a17 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -110,7 +110,7 @@ public: } Reference<XRubySelection> GetRubySelection() { - xSelection = Reference<XRubySelection>(xController, UNO_QUERY); + xSelection.set(xController, UNO_QUERY); return xSelection; } void UpdateRubyValues() @@ -155,7 +155,7 @@ void SvxRubyData_Impl::SetController(Reference<XController> xCtrl) bHasSelectionChanged = true; xController = xCtrl; - xSelSupp = Reference<XSelectionSupplier>(xController, UNO_QUERY); + xSelSupp.set(xController, UNO_QUERY); if (xSelSupp.is()) xSelSupp->addSelectionChangeListener(this); } diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 21b5fbae06f1..1c05b027a468 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -207,7 +207,7 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, const Reference< css::bea } Reference< XRowSet > xCur; if (m_rParent.getDataSource()) - xCur = Reference< XRowSet > (Reference< XInterface >(*m_rParent.getDataSource()), UNO_QUERY); + xCur.set(Reference< XInterface >(*m_rParent.getDataSource()), UNO_QUERY); // TODO : the cursor wrapper should use an XRowSet interface, too pCellControl->Init( m_rParent.GetDataWindow(), xCur ); @@ -1919,7 +1919,7 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe Reference< css::util::XNumberFormatsSupplier > xSupplier; Reference< XRowSet > xForm; if ( m_rColumn.GetParent().getDataSource() ) - xForm = Reference< XRowSet >( Reference< XInterface >(*m_rColumn.GetParent().getDataSource()), UNO_QUERY ); + xForm.set( Reference< XInterface >(*m_rColumn.GetParent().getDataSource()), UNO_QUERY ); if ( xForm.is() ) xSupplier = getNumberFormats( getConnection( xForm ), true ); SvNumberFormatter* pFormatterUsed = NULL; @@ -3002,7 +3002,7 @@ void DbFilterField::Update() // the columnmodel Reference< css::container::XChild > xModelAsChild(m_rColumn.getModel(), UNO_QUERY); // the grid model - xModelAsChild = Reference< css::container::XChild > (xModelAsChild->getParent(),UNO_QUERY); + xModelAsChild.set(xModelAsChild->getParent(),UNO_QUERY); Reference< XRowSet > xForm(xModelAsChild->getParent(), UNO_QUERY); if (!xForm.is()) return; diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index bff76717db97..107baac9f1c0 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -1415,9 +1415,8 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt Reference< css::util::XNumberFormatsSupplier > xSupplier = getNumberFormats(getConnection(_xCursor), true); if (xSupplier.is()) { - m_xFormatter = Reference< css::util::XNumberFormatter >( - css::util::NumberFormatter::create(m_xContext), - UNO_QUERY); + m_xFormatter.set( css::util::NumberFormatter::create(m_xContext), + UNO_QUERY); m_xFormatter->attachNumberFormatsSupplier(xSupplier); // retrieve the datebase of the Numberformatter diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 2ed4ce57618c..0262ecb58752 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -1062,7 +1062,7 @@ namespace svxform { DBG_ASSERT( _xModel.is(), "XFormsPage::SetModel(): invalid model" ); - m_xUIHelper = Reference< css::xforms::XFormsUIHelper1 >( _xModel, UNO_QUERY ); + m_xUIHelper.set( _xModel, UNO_QUERY ); OUString sRet; m_bHasModel = true; const ImageList& rImageList = m_pNaviWin->GetItemImageList(); @@ -1406,9 +1406,8 @@ namespace svxform // get our frame DBG_ASSERT( pBindings != NULL, "DataNavigatorWindow::LoadModels(): no SfxBindings; can't get frame" ); - m_xFrame = Reference<XFrame>( - pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), - UNO_QUERY ); + m_xFrame.set( pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), + UNO_QUERY ); DBG_ASSERT( m_xFrame.is(), "DataNavigatorWindow::LoadModels(): no frame" ); // add frameaction listener Reference< XFrameActionListener > xListener( @@ -1483,7 +1482,7 @@ namespace svxform { Any aAny = m_xDataContainer->getByName( sSelectedModel ); if ( aAny >>= xModel ) - xUIHelper = Reference< css::xforms::XFormsUIHelper1 >( xModel, UNO_QUERY ); + xUIHelper.set( xModel, UNO_QUERY ); } catch ( Exception& ) { @@ -2799,7 +2798,7 @@ namespace svxform Reference< css::xforms::XModel > xModel; if ( ( m_xBinding->getPropertyValue( PN_BINDING_MODEL ) >>= xModel ) && xModel.is() ) - m_xUIHelper = Reference< css::xforms::XFormsUIHelper1 >( xModel, UNO_QUERY ); + m_xUIHelper.set( xModel, UNO_QUERY ); } catch (const Exception&) { @@ -3196,7 +3195,7 @@ namespace svxform try { m_xNewSubmission = xModel->createSubmission(); - m_xSubmission = Reference< XPropertySet >( m_xNewSubmission, UNO_QUERY ); + m_xSubmission.set( m_xNewSubmission, UNO_QUERY ); } catch ( Exception& ) { diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index f33c0d195474..6adbb55a188c 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1878,8 +1878,8 @@ void FmFilterNavigatorWin::UpdateContent(FmFormShell* pFormShell) xParent.is(); xParent = xChild.is() ? xChild->getParent() : Reference< XInterface > ()) { - xContainer = Reference< XIndexAccess > (xParent, UNO_QUERY); - xChild = Reference< XChild > (xParent, UNO_QUERY); + xContainer.set(xParent, UNO_QUERY); + xChild.set(xParent, UNO_QUERY); } } m_pNavigator->UpdateContent(xContainer, xController); diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index 6f1d36761b02..6bdc2d70bdb0 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -194,7 +194,7 @@ FmEntryData::~FmEntryData() void FmEntryData::newObject( const css::uno::Reference< css::uno::XInterface >& _rxIFace ) { // do not just copy, normalize it - m_xNormalizedIFace = Reference< XInterface >( _rxIFace, UNO_QUERY ); + m_xNormalizedIFace.set( _rxIFace, UNO_QUERY ); m_xProperties.set(m_xNormalizedIFace, css::uno::UNO_QUERY); m_xChild.set(m_xNormalizedIFace, css::uno::UNO_QUERY); } diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index 2cc0e156ec30..6b4a14b797de 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -237,7 +237,7 @@ void FmFormObj::SetPage(SdrPage* _pNewPage) { if ( xSearch == xOldForms ) break; - xSearch = Reference< XChild >( xSearch->getParent(), UNO_QUERY ); + xSearch.set( xSearch->getParent(), UNO_QUERY ); } if ( xSearch.is() ) // implies xSearch == xOldForms, which means we're a valid part of our current page forms hierarchy { @@ -410,7 +410,7 @@ namespace Reference< css::form::XFormComponent> xChild(_xElement, UNO_QUERY); Reference< css::container::XIndexAccess> xParent; if (xChild.is()) - xParent = Reference< css::container::XIndexAccess>(xChild->getParent(), UNO_QUERY); + xParent.set(xChild->getParent(), UNO_QUERY); // while the current content is a form OUString sReturn; @@ -433,7 +433,7 @@ namespace // travel up xChild.set(xParent, css::uno::UNO_QUERY); if (xChild.is()) - xParent = Reference< css::container::XIndexAccess>(xChild->getParent(), UNO_QUERY); + xParent.set(xChild->getParent(), UNO_QUERY); } _rTopLevelElement = xParent; @@ -576,8 +576,8 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface > // of left siblings with the same DSS, which counts for all their ancestors, too) // go down - xDestContainer = Reference< XIndexContainer > (xCurrentDestForm, UNO_QUERY); - xSourceContainer = Reference< XIndexContainer > (xSourceForm, UNO_QUERY); + xDestContainer.set(xCurrentDestForm, UNO_QUERY); + xSourceContainer.set(xSourceForm, UNO_QUERY); DBG_ASSERT(xDestContainer.is() && xSourceContainer.is(), "FmFormObj::ensureModelEnv : invalid container !"); } while ( nTokIndex >= 0 ); diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index 7ab848e63058..b125490cf75f 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -491,7 +491,7 @@ Reference< css::form::XForm > FmFormPageImpl::findPlaceInFormComponentHierarchy pModel->BegUndo(aUndoStr); } - xForm = Reference< css::form::XForm >(::comphelper::getProcessServiceFactory()->createInstance(FM_SUN_COMPONENT_FORM), UNO_QUERY); + xForm.set(::comphelper::getProcessServiceFactory()->createInstance(FM_SUN_COMPONENT_FORM), UNO_QUERY); // a form should always have the command type table as default Reference< css::beans::XPropertySet > xFormProps(xForm, UNO_QUERY); try { xFormProps->setPropertyValue(FM_PROP_COMMANDTYPE, makeAny(sal_Int32(CommandType::TABLE))); } diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 09e5ac2df5f2..8bf812d8980f 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1539,7 +1539,7 @@ void FmXFormShell::ExecuteSearch() Reference< XGridPeer> xGridPeer(xActiveControl->getPeer(), UNO_QUERY); Reference< XIndexAccess> xColumns; if (xGridPeer.is()) - xColumns = Reference< XIndexAccess>(xGridPeer->getColumns(),UNO_QUERY); + xColumns.set(xGridPeer->getColumns(),UNO_QUERY); sal_Int16 nViewCol = xGrid->getCurrentColumnPosition(); sal_Int16 nModelCol = GridView2ModelPos(xColumns, nViewCol); @@ -1664,7 +1664,7 @@ void FmXFormShell::SetY2KState(sal_uInt16 n) if (!xCurrentForms.is()) { // im alive-Modus sind meine Forms nicht gesetzt, wohl aber die an der Page if (m_pShell->GetCurPage()) - xCurrentForms = Reference< XIndexAccess>( m_pShell->GetCurPage()->GetForms( false ), UNO_QUERY ); + xCurrentForms.set( m_pShell->GetCurPage()->GetForms( false ), UNO_QUERY ); } if (!xCurrentForms.is()) return; @@ -1852,7 +1852,7 @@ void FmXFormShell::setActiveController( const Reference< runtime::XFormControlle // switch all nav dispatchers belonging to the form of the current nav controller to 'non active' Reference< XResultSet> xNavigationForm; if (m_xNavigationController.is()) - xNavigationForm = Reference< XResultSet>(m_xNavigationController->getModel(), UNO_QUERY); + xNavigationForm.set(m_xNavigationController->getModel(), UNO_QUERY); aGuard.clear(); m_bInActivate = true; @@ -1860,7 +1860,7 @@ void FmXFormShell::setActiveController( const Reference< runtime::XFormControlle // check if the 2 controllers serve different forms Reference< XResultSet> xOldForm; if (m_xActiveController.is()) - xOldForm = Reference< XResultSet>(m_xActiveController->getModel(), UNO_QUERY); + xOldForm.set(m_xActiveController->getModel(), UNO_QUERY); Reference< XResultSet> xNewForm; if (xController.is()) xNewForm = Reference< XResultSet>(xController->getModel(), UNO_QUERY); @@ -1925,7 +1925,7 @@ void FmXFormShell::setActiveController( const Reference< runtime::XFormControlle // activate all dispatchers belonging to form of the new navigation controller xNavigationForm = NULL; if (m_xNavigationController.is()) - xNavigationForm = Reference< XResultSet>(m_xNavigationController->getModel(), UNO_QUERY); + xNavigationForm.set(m_xNavigationController->getModel(), UNO_QUERY); m_bInActivate = false; @@ -2110,11 +2110,11 @@ void FmXFormShell::startListening() Reference< runtime::XFormController > xParent; while (xChild.is()) { - xChild = Reference< XChild>(xChild->getParent(), UNO_QUERY); - xParent = Reference< runtime::XFormController >(xChild, UNO_QUERY); + xChild.set(xChild->getParent(), UNO_QUERY); + xParent.set(xChild, UNO_QUERY); Reference< XPropertySet> xParentSet; if (xParent.is()) - xParentSet = Reference< XPropertySet>(xParent->getModel(), UNO_QUERY); + xParentSet.set(xParent->getModel(), UNO_QUERY); if (xParentSet.is()) { xParentSet->getPropertyValue(FM_PROP_NAVIGATION) >>= m_eNavigate; @@ -2143,7 +2143,7 @@ void FmXFormShell::startListening() Reference< XPropertySet> xNavigationSet; if (m_xNavigationController.is()) { - xNavigationSet = Reference< XPropertySet>(m_xNavigationController->getModel(), UNO_QUERY); + xNavigationSet.set(m_xNavigationController->getModel(), UNO_QUERY); if (xNavigationSet.is()) xNavigationSet->addPropertyChangeListener(FM_PROP_ROWCOUNT,this); } diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index aae9551b4262..d96ef9390d7a 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -91,7 +91,7 @@ void FmSearchThread::onTerminated() FmRecordCountListener::FmRecordCountListener(const Reference< css::sdbc::XResultSet > & dbcCursor) { - m_xListening = Reference< css::beans::XPropertySet > (dbcCursor, UNO_QUERY); + m_xListening.set(dbcCursor, UNO_QUERY); if (!m_xListening.is()) return; @@ -310,7 +310,7 @@ void FmSearchEngine::BuildAndInsertFieldInfo(const Reference< css::container::XI // die FieldInfo dazu aufbauen FieldInfo fiCurrent; - fiCurrent.xContents = Reference< css::sdb::XColumn > (xCurrentField, UNO_QUERY); + fiCurrent.xContents.set(xCurrentField, UNO_QUERY); fiCurrent.nFormatKey = ::comphelper::getINT32(xProperties->getPropertyValue(FM_PROP_FORMATKEY)); fiCurrent.bDoubleHandling = false; if (m_xFormatSupplier.is()) @@ -693,9 +693,8 @@ FmSearchEngine::FmSearchEngine(const Reference< XComponentContext >& _rxContext, ,m_nTransliterationFlags(0) { - m_xFormatter = Reference< css::util::XNumberFormatter >( - css::util::NumberFormatter::create( ::comphelper::getProcessComponentContext() ), - UNO_QUERY_THROW); + m_xFormatter.set( css::util::NumberFormatter::create( ::comphelper::getProcessComponentContext() ), + UNO_QUERY_THROW); m_xFormatter->attachNumberFormatsSupplier(m_xFormatSupplier); Init(sVisibleFields); @@ -1257,7 +1256,7 @@ void FmSearchEngine::RebuildUsedFields(sal_Int32 nFieldIndex, bool bForce) { Reference< css::sdbcx::XColumnsSupplier > xSupplyCols(IFACECAST(m_xSearchCursor), UNO_QUERY); DBG_ASSERT(xSupplyCols.is(), "FmSearchEngine::RebuildUsedFields : invalid cursor (no columns supplier) !"); - xFields = Reference< css::container::XIndexAccess > (xSupplyCols->getColumns(), UNO_QUERY); + xFields.set(xSupplyCols->getColumns(), UNO_QUERY); BuildAndInsertFieldInfo(xFields, m_arrFieldMapping[i]); } } @@ -1266,7 +1265,7 @@ void FmSearchEngine::RebuildUsedFields(sal_Int32 nFieldIndex, bool bForce) Reference< css::container::XIndexAccess > xFields; Reference< css::sdbcx::XColumnsSupplier > xSupplyCols(IFACECAST(m_xSearchCursor), UNO_QUERY); DBG_ASSERT(xSupplyCols.is(), "FmSearchEngine::RebuildUsedFields : invalid cursor (no columns supplier) !"); - xFields = Reference< css::container::XIndexAccess > (xSupplyCols->getColumns(), UNO_QUERY); + xFields.set (xSupplyCols->getColumns(), UNO_QUERY); BuildAndInsertFieldInfo(xFields, m_arrFieldMapping[static_cast< size_t >(nFieldIndex)]); } diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx index 646e39e045a4..233cc82eeba0 100644 --- a/svx/source/form/fmtools.cxx +++ b/svx/source/form/fmtools.cxx @@ -262,9 +262,9 @@ void CursorWrapper::ImplConstruct(const Reference< css::sdbc::XResultSet>& _rxCu const CursorWrapper& CursorWrapper::operator=(const Reference< css::sdbc::XRowSet>& _rxCursor) { - m_xMoveOperations = Reference< css::sdbc::XResultSet>(_rxCursor, UNO_QUERY); - m_xBookmarkOperations = Reference< css::sdbcx::XRowLocate>(_rxCursor, UNO_QUERY); - m_xColumnsSupplier = Reference< css::sdbcx::XColumnsSupplier>(_rxCursor, UNO_QUERY); + m_xMoveOperations.set(_rxCursor, UNO_QUERY); + m_xBookmarkOperations.set(_rxCursor, UNO_QUERY); + m_xColumnsSupplier.set(_rxCursor, UNO_QUERY); if (!m_xMoveOperations.is() || !m_xBookmarkOperations.is() || !m_xColumnsSupplier.is()) { // all or nothing !! m_xMoveOperations = NULL; @@ -428,7 +428,7 @@ bool isRowSetAlive(const Reference< XInterface >& _rxRowSet) Reference< css::sdbcx::XColumnsSupplier> xSupplyCols(_rxRowSet, UNO_QUERY); Reference< css::container::XIndexAccess> xCols; if (xSupplyCols.is()) - xCols = Reference< css::container::XIndexAccess>(xSupplyCols->getColumns(), UNO_QUERY); + xCols.set(xSupplyCols->getColumns(), UNO_QUERY); if (xCols.is() && (xCols->getCount() > 0)) bIsAlive = true; diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 7956ba114b5e..925da1d21627 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -570,7 +570,7 @@ FormController::FormController(const Reference< css::uno::XComponentContext > & osl_atomic_increment(&m_refCount); { m_xTabController = TabController::create( m_xComponentContext ); - m_xAggregate = Reference< XAggregation >( m_xTabController, UNO_QUERY_THROW ); + m_xAggregate.set( m_xTabController, UNO_QUERY_THROW ); m_xAggregate->setDelegator( *this ); } osl_atomic_decrement(&m_refCount); @@ -1664,7 +1664,7 @@ void FormController::focusGained(const FocusEvent& e) throw( RuntimeException, s // zunaechst das Control fragen ob es das IFace unterstuetzt Reference< XBoundComponent > xBound(m_xCurrentControl, UNO_QUERY); if (!xBound.is() && m_xCurrentControl.is()) - xBound = Reference< XBoundComponent > (m_xCurrentControl->getModel(), UNO_QUERY); + xBound.set(m_xCurrentControl->getModel(), UNO_QUERY); // lock if we lose the focus during commit m_bCommitLock = true; @@ -1867,8 +1867,8 @@ void FormController::setModel(const Reference< XTabControllerModel > & Model) th // set the new model wait for the load event if (m_xTabController.is()) m_xTabController->setModel(Model); - m_xModelAsIndex = Reference< XIndexAccess > (Model, UNO_QUERY); - m_xModelAsManager = Reference< XEventAttacherManager > (Model, UNO_QUERY); + m_xModelAsIndex.set(Model, UNO_QUERY); + m_xModelAsManager.set(Model, UNO_QUERY); // only if both ifaces exit, the controller will work successful if (!m_xModelAsIndex.is() || !m_xModelAsManager.is()) @@ -2015,7 +2015,7 @@ void FormController::setContainer(const Reference< XControlContainer > & xContai ::osl::MutexGuard aGuard( m_aMutex ); Reference< XContainer > xCurrentContainer; if (m_xTabController.is()) - xCurrentContainer = Reference< XContainer > (m_xTabController->getContainer(), UNO_QUERY); + xCurrentContainer.set(m_xTabController->getContainer(), UNO_QUERY); if (xCurrentContainer.is()) { xCurrentContainer->removeContainerListener(this); @@ -2828,7 +2828,7 @@ void SAL_CALL FormController::elementInserted(const ContainerEvent& evt) throw( // are we in filtermode and a XModeSelector has inserted an element else if (m_bFiltering && Reference< XModeSelector > (evt.Source, UNO_QUERY).is()) { - xModel = Reference< XFormComponent > (evt.Source, UNO_QUERY); + xModel.set(evt.Source, UNO_QUERY); if (xModel.is() && m_xModelAsIndex == xModel->getParent()) { Reference< XPropertySet > xSet(xControl->getModel(), UNO_QUERY); diff --git a/svx/source/form/formdispatchinterceptor.cxx b/svx/source/form/formdispatchinterceptor.cxx index 16e774f20373..e2abd5ba493d 100644 --- a/svx/source/form/formdispatchinterceptor.cxx +++ b/svx/source/form/formdispatchinterceptor.cxx @@ -157,7 +157,7 @@ namespace svxform if (xIntercepted.is()) xIntercepted->releaseDispatchProviderInterceptor(static_cast<XDispatchProviderInterceptor*>(this)); - // m_xIntercepted = Reference< XDispatchProviderInterception >(); + // m_xIntercepted.clear(); // Don't reset m_xIntercepted: It may be needed by our owner to check for which object we were // responsible. As we hold the object with a weak reference only, this should be no problem. // 88936 - 23.07.2001 - frank.schoenheit@sun.com diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index e19fa8e5ba53..b09288749a61 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -1108,9 +1108,9 @@ namespace svxform // position in DropParents, where to insert dropped entries if (pTargetData) - xContainer = Reference< XIndexContainer > (pTargetData->GetElement(), UNO_QUERY); + xContainer.set(pTargetData->GetElement(), UNO_QUERY); else - xContainer = Reference< XIndexContainer > (GetNavModel()->GetForms(), UNO_QUERY); + xContainer.set(GetNavModel()->GetForms(), UNO_QUERY); // always insert at the end nIndex = xContainer->getCount(); @@ -1135,7 +1135,7 @@ namespace svxform if (aEvts.getLength()) { - xManager = Reference< XEventAttacherManager > (xContainer, UNO_QUERY); + xManager.set(xContainer, UNO_QUERY); if (xManager.is()) xManager->registerScriptEvents(nIndex, aEvts); } diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx index 139cfb2f4491..279932f00e8b 100644 --- a/svx/source/form/navigatortreemodel.cxx +++ b/svx/source/form/navigatortreemodel.cxx @@ -273,9 +273,9 @@ namespace svxform Reference< XIndexContainer > xContainer; if (pFolder) - xContainer = Reference< XIndexContainer > (pFolder->GetFormIface(), UNO_QUERY); + xContainer.set(pFolder->GetFormIface(), UNO_QUERY); else - xContainer = Reference< XIndexContainer > (GetForms(), UNO_QUERY); + xContainer.set(GetForms(), UNO_QUERY); bool bUndo = m_pFormModel->IsUndoEnabled(); diff --git a/svx/source/form/sdbdatacolumn.cxx b/svx/source/form/sdbdatacolumn.cxx index 0b028a42f456..d5272878fae0 100644 --- a/svx/source/form/sdbdatacolumn.cxx +++ b/svx/source/form/sdbdatacolumn.cxx @@ -38,8 +38,8 @@ namespace svxform DataColumn::DataColumn(const Reference< css::beans::XPropertySet>& _rxIFace) { m_xPropertySet = _rxIFace; - m_xColumn = Reference< css::sdb::XColumn>(_rxIFace, UNO_QUERY); - m_xColumnUpdate = Reference< css::sdb::XColumnUpdate>(_rxIFace, UNO_QUERY); + m_xColumn.set(_rxIFace, UNO_QUERY); + m_xColumnUpdate.set(_rxIFace, UNO_QUERY); if (!m_xPropertySet.is() || !m_xColumn.is()) { diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 4a639efa38cc..46b6036af998 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -365,7 +365,7 @@ GalleryProgress::GalleryProgress( GraphicFilter* pFilter ) : if ( xMonitor.is() ) { - mxProgressBar = uno::Reference< awt::XProgressBar >( xMonitor, uno::UNO_QUERY ); + mxProgressBar.set( xMonitor, uno::UNO_QUERY ); if( mxProgressBar.is() ) { diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx index c04f0dba0e0e..887b3bcc76a5 100644 --- a/svx/source/gengal/gengal.cxx +++ b/svx/source/gengal/gengal.cxx @@ -189,8 +189,7 @@ void GalApp::Init() uno::Reference<uno::XComponentContext> xComponentContext = ::cppu::defaultBootstrap_InitialComponentContext(); - xMSF = uno::Reference<lang::XMultiServiceFactory> - ( xComponentContext->getServiceManager(), uno::UNO_QUERY ); + xMSF.set( xComponentContext->getServiceManager(), uno::UNO_QUERY ); if( !xMSF.is() ) { fprintf( stderr, "Failed to bootstrap\n" ); diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx index ea2667dba8c4..6c523cf108d0 100644 --- a/svx/source/smarttags/SmartTagMgr.cxx +++ b/svx/source/smarttags/SmartTagMgr.cxx @@ -125,7 +125,7 @@ void SmartTagMgr::RecognizeTextRange(const Reference< text::XTextRange>& xRange, { Reference < smarttags::XSmartTagRecognizer > xRecognizer = maRecognizerList[i]; - Reference< smarttags::XRangeBasedSmartTagRecognizer > xRangeBasedRecognizer = Reference< smarttags::XRangeBasedSmartTagRecognizer >( xRecognizer, UNO_QUERY); + Reference< smarttags::XRangeBasedSmartTagRecognizer > xRangeBasedRecognizer( xRecognizer, UNO_QUERY); if (!xRangeBasedRecognizer.is()) continue; @@ -354,7 +354,7 @@ void SmartTagMgr::LoadLibraries() Reference< lang::XServiceInfo > xsInfo; if (a >>= xsInfo) - xSCF = Reference< lang::XSingleComponentFactory >(xsInfo, UNO_QUERY); + xSCF.set(xsInfo, UNO_QUERY); else continue; @@ -381,7 +381,7 @@ void SmartTagMgr::LoadLibraries() Reference< lang::XSingleComponentFactory > xSCF; if (a >>= xsInfo) - xSCF = Reference< lang::XSingleComponentFactory >(xsInfo, UNO_QUERY); + xSCF.set(xsInfo, UNO_QUERY); else continue; @@ -437,7 +437,7 @@ void SmartTagMgr::PrepareConfiguration( const OUString& rConfigurationGroupName if ( xConfigurationAccess.is() ) { - mxConfigurationSettings = Reference< beans::XPropertySet >( xConfigurationAccess, UNO_QUERY ); + mxConfigurationSettings.set( xConfigurationAccess, UNO_QUERY ); } } diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index 6bfca2613f28..00fc659aada2 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -105,7 +105,7 @@ uno::Reference<awt::XControlContainer> SdrPageWindow::GetControlContainer( bool { // Printer and VirtualDevice, or rather: no OutDev uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - const_cast< SdrPageWindow* >( this )->mpImpl->mxControlContainer = uno::Reference< awt::XControlContainer >(xFactory->createInstance("com.sun.star.awt.UnoControlContainer"), uno::UNO_QUERY); + const_cast< SdrPageWindow* >( this )->mpImpl->mxControlContainer.set(xFactory->createInstance("com.sun.star.awt.UnoControlContainer"), uno::UNO_QUERY); uno::Reference< awt::XControlModel > xModel(xFactory->createInstance("com.sun.star.awt.UnoControlContainerModel"), uno::UNO_QUERY); uno::Reference< awt::XControl > xControl(mpImpl->mxControlContainer, uno::UNO_QUERY); if (xControl.is()) diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 456cd007c50e..c03e0e9ac62e 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -428,7 +428,7 @@ Reference< XCustomShapeEngine > SdrObjCustomShape::GetCustomShapeEngine() const aArgument[ 0 ] <<= aPropValues; Reference< XInterface > xInterface( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( aEngine, aArgument, xContext ) ); if ( xInterface.is() ) - mxCustomShapeEngine = Reference< XCustomShapeEngine >( xInterface, UNO_QUERY ); + mxCustomShapeEngine.set( xInterface, UNO_QUERY ); } return mxCustomShapeEngine; diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 574a4f566926..268fccd9ae12 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -303,8 +303,8 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::saveObject() throw embed::ObjectSaveVetoException(); // the common persistence is supported by objects and links - xPersist = uno::Reference< embed::XCommonEmbedPersist >( mpObj->GetObjRef(), uno::UNO_QUERY_THROW ); - xModifiable = uno::Reference< util::XModifiable >( mpObj->GetParentXModel(), uno::UNO_QUERY ); + xPersist.set( mpObj->GetObjRef(), uno::UNO_QUERY_THROW ); + xModifiable.set( mpObj->GetParentXModel(), uno::UNO_QUERY ); } xPersist->storeOwn(); @@ -342,7 +342,7 @@ uno::Reference< util::XCloseable > SAL_CALL SdrLightEmbeddedClient_Impl::getComp SolarMutexGuard aGuard; if ( mpObj ) - xResult = uno::Reference< util::XCloseable >( mpObj->GetParentXModel(), uno::UNO_QUERY ); + xResult.set( mpObj->GetParentXModel(), uno::UNO_QUERY ); return xResult; } diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index b43064880600..e5c95130c9c8 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -458,7 +458,7 @@ void SdrUnoObj::CreateUnoControlModel(const OUString& rModelName) uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); if (!aUnoControlModelTypeName.isEmpty() ) { - xModel = uno::Reference< awt::XControlModel >(xContext->getServiceManager()->createInstanceWithContext( + xModel.set(xContext->getServiceManager()->createInstanceWithContext( aUnoControlModelTypeName, xContext), uno::UNO_QUERY); if (xModel.is()) @@ -478,8 +478,7 @@ void SdrUnoObj::CreateUnoControlModel(const OUString& rModelName, uno::Reference< awt::XControlModel > xModel; if (!aUnoControlModelTypeName.isEmpty() && rxSFac.is() ) { - xModel = uno::Reference< awt::XControlModel >(rxSFac->createInstance( - aUnoControlModelTypeName), uno::UNO_QUERY); + xModel.set(rxSFac->createInstance(aUnoControlModelTypeName), uno::UNO_QUERY); if (xModel.is()) SetChanged(); diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx index 158be7ddb02a..4f67b59654ff 100644 --- a/svx/source/table/accessiblecell.cxx +++ b/svx/source/table/accessiblecell.cxx @@ -258,7 +258,7 @@ Reference<XAccessibleStateSet> SAL_CALL AccessibleCell::getAccessibleStateSet() } // Create a copy of the state set that may be modified by the // caller without affecting the current state set. - xStateSet = Reference<XAccessibleStateSet>(new ::utl::AccessibleStateSetHelper (*pStateSet)); + xStateSet.set(new ::utl::AccessibleStateSetHelper (*pStateSet)); } } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 7bcd9760c857..b1658c159ad7 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2137,7 +2137,7 @@ throw ( Exception, RuntimeException, std::exception) SID_STYLE_FAMILY_START + i, OUString::createFromAscii( StyleSlotToStyleCommand[i] ), *this ); - m_xBoundItems[i] = Reference< XComponent >( static_cast< OWeakObject* >( pBoundItems[i] ), UNO_QUERY ); + m_xBoundItems[i].set( static_cast< OWeakObject* >( pBoundItems[i] ), UNO_QUERY ); pFamilyState[i] = NULL; } } diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index 7d9ab48f50ce..333ec3a46301 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -481,7 +481,7 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( vcl::Window* pParent ) //get dictionaries { if(!m_xContext.is()) - m_xContext = Reference< XComponentContext >( ::cppu::defaultBootstrap_InitialComponentContext() ); + m_xContext.set( ::cppu::defaultBootstrap_InitialComponentContext() ); if(m_xContext.is()) { Reference< linguistic2::XConversionDictionaryList > xDictionaryList = linguistic2::ConversionDictionaryList::create(m_xContext); @@ -496,30 +496,30 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( vcl::Window* pParent ) aLocale.Language = "zh"; if( xContainer->hasByName( aNameTo_Simplified ) ) - xDictionary_To_Simplified = Reference< linguistic2::XConversionDictionary >( + xDictionary_To_Simplified.set( xContainer->getByName( aNameTo_Simplified ), UNO_QUERY ); else { aLocale.Country = "TW"; - xDictionary_To_Simplified = Reference< linguistic2::XConversionDictionary >( + xDictionary_To_Simplified.set( xDictionaryList->addNewDictionary( aNameTo_Simplified - , aLocale, linguistic2::ConversionDictionaryType::SCHINESE_TCHINESE - ), UNO_QUERY ); + , aLocale, linguistic2::ConversionDictionaryType::SCHINESE_TCHINESE + ), UNO_QUERY ); } if (xDictionary_To_Simplified.is()) xDictionary_To_Simplified->setActive( sal_True ); if( xContainer->hasByName( aNameTo_Traditional ) ) - xDictionary_To_Traditional = Reference< linguistic2::XConversionDictionary >( + xDictionary_To_Traditional.set( xContainer->getByName( aNameTo_Traditional ), UNO_QUERY ); else { aLocale.Country = "CN"; - xDictionary_To_Traditional = Reference< linguistic2::XConversionDictionary >( + xDictionary_To_Traditional.set( xDictionaryList->addNewDictionary( aNameTo_Traditional - , aLocale, linguistic2::ConversionDictionaryType::SCHINESE_TCHINESE - ), UNO_QUERY ); + ,aLocale, linguistic2::ConversionDictionaryType::SCHINESE_TCHINESE), + UNO_QUERY ); } if (xDictionary_To_Traditional.is()) xDictionary_To_Traditional->setActive( sal_True ); diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index b3548ea40ebc..dbd32b3951a4 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -1067,7 +1067,7 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes Any aInteraction; Sequence< css::uno::Reference< css::task::XInteractionContinuation > > lContinuations(1); ::comphelper::OInteractionApprove* pApprove = new ::comphelper::OInteractionApprove(); - lContinuations[0] = Reference< XInteractionContinuation >(static_cast< XInteractionContinuation* >(pApprove), UNO_QUERY); + lContinuations[0].set(static_cast< XInteractionContinuation* >(pApprove), UNO_QUERY); GraphicFilterRequest aErrorCode; aErrorCode.ErrCode = nStatus; @@ -1098,9 +1098,9 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon // any break inside this one loop while will throw a IllegalArgumentException do { - mxPage = Reference< XDrawPage >::query( xComponent ); - mxShapes = Reference< XShapes >::query( xComponent ); - mxShape = Reference< XShape >::query( xComponent ); + mxPage.set( xComponent, UNO_QUERY ); + mxShapes.set( xComponent, UNO_QUERY ); + mxShape.set( xComponent, UNO_QUERY ); // Step 1: try a generic XShapes if( !mxPage.is() && !mxShape.is() && mxShapes.is() ) @@ -1132,9 +1132,9 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon do { xInt = xChild->getParent(); - mxPage = Reference< XDrawPage >::query( xInt ); + mxPage.set( xInt, UNO_QUERY ); if( !mxPage.is() ) - xChild = Reference< XChild >::query( xInt ); + xChild.set( xInt, UNO_QUERY ); } while( !mxPage.is() && xChild.is() ); diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 6296941e900a..de6a352ce31c 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -712,7 +712,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SvxUnoDrawPagesAccess::insertNewBy pPage = new SdrPage(*mrModel.mpDoc); mrModel.mpDoc->InsertPage( pPage, (sal_uInt16)nIndex ); - xDrawPage = uno::Reference< drawing::XDrawPage >::query( pPage->getUnoPage() ); + xDrawPage.set( pPage->getUnoPage(), uno::UNO_QUERY ); } return xDrawPage; diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 9db5d91c1346..65ec23491c4f 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -452,7 +452,7 @@ Reference< drawing::XShapeGroup > SAL_CALL SvxDrawPage::group( const Reference< { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); if( pObj ) - xShapeGroup = Reference< drawing::XShapeGroup >::query( pObj->getUnoShape() ); + xShapeGroup.set( pObj->getUnoShape(), UNO_QUERY ); } mpView->HideSdrPage(); |