diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-30 07:59:06 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-30 11:08:36 +0200 |
commit | cb4fa1d1e2e61b686442a9d26220c0f1a6e1d4e7 (patch) | |
tree | 2d819dbc32230f7af209b59a5c1f262f4964fa84 /cui | |
parent | 3bc5df7f32501075149e4b41f6e98ea8dd2cfcbd (diff) |
use uno::Reference::set method instead of assignment
Change-Id: I080668f86f0ab8b3bba857ee21411f907ae285c4
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/acccfg.cxx | 11 | ||||
-rw-r--r-- | cui/source/customize/cfg.cxx | 18 | ||||
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 2 | ||||
-rw-r--r-- | cui/source/customize/selector.cxx | 3 | ||||
-rw-r--r-- | cui/source/dialogs/insdlg.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/optaboutconfig.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/optasian.cxx | 3 | ||||
-rw-r--r-- | cui/source/options/optdict.cxx | 5 | ||||
-rw-r--r-- | cui/source/options/optgdlg.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/optlingu.cxx | 14 | ||||
-rw-r--r-- | cui/source/options/optsave.cxx | 3 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 5 |
12 files changed, 30 insertions, 44 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 6964ad0f3edb..48dff09649b2 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -1260,7 +1260,7 @@ IMPL_LINK_NOARG_TYPED(SfxAcceleratorConfigPage, LoadHdl, sfx2::FileDialogHelper* lArgs[0] <<= sCfgName; lArgs[1] <<= css::embed::ElementModes::READ; - xRootStorage = uno::Reference<embed::XStorage>(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY_THROW); + xRootStorage.set(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY_THROW); uno::Reference<embed::XStorage> xUIConfig = xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, embed::ElementModes::READ); if (xUIConfig.is()) { @@ -1289,10 +1289,10 @@ IMPL_LINK_NOARG_TYPED(SfxAcceleratorConfigPage, LoadHdl, sfx2::FileDialogHelper* if (xRootStorage.is()) { uno::Reference<lang::XComponent> xComponent; - xComponent = uno::Reference<css::lang::XComponent>(xCfgMgr, uno::UNO_QUERY); + xComponent.set(xCfgMgr, uno::UNO_QUERY); if (xComponent.is()) xComponent->dispose(); - xComponent = uno::Reference<css::lang::XComponent>(xRootStorage, uno::UNO_QUERY); + xComponent.set(xRootStorage, uno::UNO_QUERY); if (xComponent.is()) xComponent->dispose(); } @@ -1343,9 +1343,8 @@ IMPL_LINK_NOARG_TYPED(SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper* lArgs[0] <<= sCfgName; lArgs[1] <<= embed::ElementModes::WRITE; - xRootStorage = uno::Reference<embed::XStorage>( - xStorageFactory->createInstanceWithArguments(lArgs), - uno::UNO_QUERY_THROW); + xRootStorage.set( xStorageFactory->createInstanceWithArguments(lArgs), + uno::UNO_QUERY_THROW); uno::Reference<embed::XStorage> xUIConfig( xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, embed::ElementModes::WRITE), diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index b263ae9478ee..a6c4f1b2ae79 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -872,8 +872,7 @@ SaveInData::SaveInData( if ( !m_xImgMgr.is() ) { - m_xImgMgr = uno::Reference< css::ui::XImageManager >( - GetConfigManager()->getImageManager(), uno::UNO_QUERY ); + m_xImgMgr.set( GetConfigManager()->getImageManager(), uno::UNO_QUERY ); } if ( !IsDocConfig() ) @@ -889,8 +888,7 @@ SaveInData::SaveInData( // as default. if ( m_xParentCfgMgr.is() ) { - m_xParentImgMgr = uno::Reference< css::ui::XImageManager >( - m_xParentCfgMgr->getImageManager(), uno::UNO_QUERY ); + m_xParentImgMgr.set( m_xParentCfgMgr->getImageManager(), uno::UNO_QUERY ); xDefaultImgMgr = &m_xParentImgMgr; } } @@ -1170,8 +1168,7 @@ bool MenuSaveInData::Apply() if ( IsModified() ) { // Apply new menu bar structure to our settings container - m_xMenuSettings = uno::Reference< container::XIndexAccess >( - GetConfigManager()->createSettings(), uno::UNO_QUERY ); + m_xMenuSettings.set( GetConfigManager()->createSettings(), uno::UNO_QUERY ); uno::Reference< container::XIndexContainer > xIndexContainer ( m_xMenuSettings, uno::UNO_QUERY ); @@ -3496,7 +3493,7 @@ void ToolbarSaveInData::SetSystemStyle( // before. It's possible that the current element is not available. uno::Reference< css::awt::XWindow > xWindow; if ( xUIElement.is() ) - xWindow = uno::Reference< css::awt::XWindow >( xUIElement->getRealInterface(), uno::UNO_QUERY ); + xWindow.set( xUIElement->getRealInterface(), uno::UNO_QUERY ); window = VCLUnoHelper::GetWindow( xWindow ); } @@ -4747,8 +4744,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow, uno::Reference< uno::XComponentContext > xComponentContext = ::comphelper::getProcessComponentContext(); - m_xGraphProvider = uno::Reference< graphic::XGraphicProvider >( - graphic::GraphicProvider::create( xComponentContext ) ); + m_xGraphProvider.set( graphic::GraphicProvider::create( xComponentContext ) ); uno::Reference< css::util::XPathSettings > xPathSettings = css::util::thePathSettings::get( xComponentContext ); @@ -4936,9 +4932,7 @@ uno::Reference< graphic::XGraphic> SvxIconSelectorDialog::GetSelectedIcon() nId = pTbSymbol->GetItemId( n ); if ( pTbSymbol->IsItemChecked( nId ) ) { - result = uno::Reference< graphic::XGraphic >( - static_cast< graphic::XGraphic* >( - pTbSymbol->GetItemData( nId ) ) ); + result.set( static_cast< graphic::XGraphic* >( pTbSymbol->GetItemData( nId ) ) ); } } diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index ff248dd03e71..30af1e3aaeed 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -552,7 +552,7 @@ void SfxConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent m_sModuleLongName = sModuleLongName; m_xGlobalCategoryInfo = css::ui::theUICategoryDescription::get( m_xContext ); - m_xModuleCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xGlobalCategoryInfo->getByName(m_sModuleLongName), css::uno::UNO_QUERY_THROW); + m_xModuleCategoryInfo.set(m_xGlobalCategoryInfo->getByName(m_sModuleLongName), css::uno::UNO_QUERY_THROW); m_xUICmdDescription = css::frame::theUICommandDescription::get( m_xContext ); InitModule(); diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx index 45ea0b6f337a..173a9ecfed08 100644 --- a/cui/source/customize/selector.cxx +++ b/cui/source/customize/selector.cxx @@ -450,8 +450,7 @@ void SvxConfigGroupListBox::Init(bool bShowSlots, const Reference< frame::XFrame { try { - xModuleCategories = Reference< container::XNameAccess >( - xAllCategories->getByName( aModuleId ), UNO_QUERY ); + xModuleCategories.set( xAllCategories->getByName( aModuleId ), UNO_QUERY ); } catch ( container::NoSuchElementException& ) { diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index d3d34d756d0a..6c8a7b579fd3 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -569,7 +569,7 @@ short SfxInsertFloatingFrameDialog::Execute() { if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED ) m_xObj->changeState( embed::EmbedStates::RUNNING ); - xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY ); + xSet.set( m_xObj->getComponent(), uno::UNO_QUERY ); OUString aStr; uno::Any aAny = xSet->getPropertyValue( "FrameURL" ); if ( aAny >>= aStr ) @@ -671,7 +671,7 @@ short SfxInsertFloatingFrameDialog::Execute() m_xObj = aCnt.CreateEmbeddedObject( aClassId.GetByteSequence(), aName ); if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED ) m_xObj->changeState( embed::EmbedStates::RUNNING ); - xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY ); + xSet.set( m_xObj->getComponent(), uno::UNO_QUERY ); } if ( m_xObj.is() ) diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index 53eea6bdb7cc..3f003a7543a5 100644 --- a/cui/source/options/optaboutconfig.cxx +++ b/cui/source/options/optaboutconfig.cxx @@ -269,7 +269,7 @@ void CuiAboutConfigTabPage::FillItems(const Reference< XNameAccess >& xNameAcces Reference< XNameAccess > xNextNameAccess; try { - xNextNameAccess = Reference< XNameAccess >(aNode, uno::UNO_QUERY); + xNextNameAccess.set(aNode, uno::UNO_QUERY); bNotLeaf = xNextNameAccess.is(); } catch (const RuntimeException& e) diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 260187a15184..131ae70de066 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -244,8 +244,7 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* ) Reference<XMultiServiceFactory> xFact(xModel, UNO_QUERY); if(xFact.is()) { - pImpl->xPrSet = Reference<XPropertySet>( - xFact->createInstance("com.sun.star.document.Settings"), UNO_QUERY); + pImpl->xPrSet.set(xFact->createInstance("com.sun.star.document.Settings"), UNO_QUERY); } if( pImpl->xPrSet.is() ) pImpl->xPrSetInfo = pImpl->xPrSet->getPropertySetInfo(); diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index d8ddc4e9b0c3..106f634469d9 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -172,8 +172,7 @@ IMPL_LINK_NOARG_TYPED(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void) { lang::Locale aLocale( LanguageTag::convertToLocale(nLang) ); OUString aURL( linguistic::GetWritableDictionaryURL( sDict ) ); - xNewDic = Reference< XDictionary > ( - xDicList->createDictionary( sDict, aLocale, eType, aURL ) , UNO_QUERY ); + xNewDic.set( xDicList->createDictionary( sDict, aLocale, eType, aURL ) , UNO_QUERY ); xNewDic->setActive( sal_True ); } DBG_ASSERT(xNewDic.is(), "NULL pointer"); @@ -312,7 +311,7 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog( } Reference< XDictionary > xDic; if (nPos != LISTBOX_ENTRY_NOTFOUND) - xDic = Reference< XDictionary > ( aDics.getConstArray()[ nPos ], UNO_QUERY ); + xDic.set( aDics.getConstArray()[ nPos ], UNO_QUERY ); if (xDic.is()) SetLanguage_Impl( LanguageTag( xDic->getLocale() ).getLanguageType() ); diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 5578f45fd3d8..52c58ba52369 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1055,7 +1055,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet& // find out which locales are currently installed and add them to the listbox theArgs[0] = makeAny(NamedValue(OUString("nodepath"), makeAny(OUString(sInstalledLocalesPath)))); - theNameAccess = Reference< XNameAccess > ( + theNameAccess.set( theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs ), UNO_QUERY_THROW ); seqInstalledLanguages = theNameAccess->getElementNames(); LanguageType aLang = LANGUAGE_DONTKNOW; @@ -1074,7 +1074,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet& // find out whether the user has a specific locale specified Sequence< Any > theArgs2(1); theArgs2[0] = makeAny(NamedValue(OUString("nodepath"), makeAny(OUString(sUserLocalePath)))); - theNameAccess = Reference< XNameAccess > ( + theNameAccess.set( theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs2 ), UNO_QUERY_THROW ); if (theNameAccess->hasByName(sUserLocaleKey)) theNameAccess->getByName(sUserLocaleKey) >>= m_sUserLocaleValue; diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 0348f2b9d7e7..bde39e982489 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -736,7 +736,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : { ServiceInfo_Impl aInfo; aInfo.sSpellImplName = pSpellNames[nIdx]; - aInfo.xSpell = uno::Reference<XSpellChecker>( + aInfo.xSpell.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sSpellImplName, aArgs, xContext), UNO_QUERY); uno::Reference<XServiceDisplayName> xDispName(aInfo.xSpell, UNO_QUERY); @@ -760,7 +760,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : { ServiceInfo_Impl aInfo; aInfo.sGrammarImplName = pGrammarNames[nIdx]; - aInfo.xGrammar = uno::Reference<XProofreader>( + aInfo.xGrammar.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sGrammarImplName, aArgs, xContext), UNO_QUERY); uno::Reference<XServiceDisplayName> xDispName(aInfo.xGrammar, UNO_QUERY); @@ -784,8 +784,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : { ServiceInfo_Impl aInfo; aInfo.sHyphImplName = pHyphNames[nIdx]; - aInfo.xHyph = uno::Reference<XHyphenator>( - xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sHyphImplName, aArgs, xContext), UNO_QUERY); + aInfo.xHyph.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sHyphImplName, aArgs, xContext), UNO_QUERY); uno::Reference<XServiceDisplayName> xDispName(aInfo.xHyph, UNO_QUERY); if(xDispName.is()) @@ -808,8 +807,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : { ServiceInfo_Impl aInfo; aInfo.sThesImplName = pThesNames[nIdx]; - aInfo.xThes = uno::Reference<XThesaurus>( - xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sThesImplName, aArgs, xContext), UNO_QUERY); + aInfo.xThes.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sThesImplName, aArgs, xContext), UNO_QUERY); uno::Reference<XServiceDisplayName> xDispName(aInfo.xThes, UNO_QUERY); if(xDispName.is()) @@ -1102,7 +1100,7 @@ SvxLinguTabPage::SvxLinguTabPage( vcl::Window* pParent, const SfxItemSet& rSet ) m_pLinguOptionsEditPB->SetAccessibleName(sAccessibleNameOptionEdit); xProp = SvxGetLinguPropertySet(); - xDicList = uno::Reference< XDictionaryList >( SvxGetDictionaryList(), UNO_QUERY ); + xDicList.set( SvxGetDictionaryList(), UNO_QUERY ); if (xDicList.is()) { // keep references to all **currently** available dictionaries, @@ -1623,7 +1621,7 @@ IMPL_LINK_TYPED( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void ) DBG_ASSERT(aDlg, "Dialog creation failed!"); uno::Reference< XDictionary > xNewDic; if ( aDlg->Execute() == RET_OK ) - xNewDic = uno::Reference< XDictionary >( aDlg->GetNewDictionary(), UNO_QUERY ); + xNewDic.set( aDlg->GetNewDictionary(), UNO_QUERY ); if ( xNewDic.is() ) { // add new dics to the end diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index cdde1a1dffec..3dd15b075af5 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -409,8 +409,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* ) try { Reference< XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory(); - pImpl->xFact = Reference<XNameContainer>( - xMSF->createInstance("com.sun.star.document.FilterFactory"), UNO_QUERY); + pImpl->xFact.set(xMSF->createInstance("com.sun.star.document.FilterFactory"), UNO_QUERY); DBG_ASSERT(pImpl->xFact.is(), "service com.sun.star.document.FilterFactory unavailable"); Reference< XContainerQuery > xQuery(pImpl->xFact, UNO_QUERY); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index e8cdeb4ab50e..ed946e35a565 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -2212,15 +2212,14 @@ void ExtensionsTabPage::CreateDialogWithHandler() if ( bWithHandler ) { Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - m_xEventHdl = Reference< awt::XContainerWindowEventHandler >( - xFactory->createInstance( m_sEventHdl ), UNO_QUERY ); + m_xEventHdl.set( xFactory->createInstance( m_sEventHdl ), UNO_QUERY ); } if ( !bWithHandler || m_xEventHdl.is() ) { SetStyle( GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL ); Reference< awt::XWindowPeer > xParent( VCLUnoHelper::GetInterface( this ), UNO_QUERY ); - m_xPage = Reference < awt::XWindow >( + m_xPage.set( m_xWinProvider->createContainerWindow( m_sPageURL, OUString(), xParent, m_xEventHdl ), UNO_QUERY ); |