diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-05-14 23:49:52 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-05-14 23:52:51 +0300 |
commit | a4f512d09ff39ef2a46a7e5ad512460c6093d25a (patch) | |
tree | d1a4c640ac02ce3fd91aa97df09b3fa58e872d41 /cui | |
parent | b08e9f08072ec2f632dd8bbbc8d0b5ca2de8b532 (diff) |
tdf#107847 Make sure m_xContext is not empty
Change-Id: I21d87b3a3d9732266e8c7d18cc07924700aaaafc
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 14 | ||||
-rw-r--r-- | cui/source/tabpages/macroass.cxx | 2 |
2 files changed, 6 insertions, 10 deletions
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index c6e310e6505c..ad171a755354 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -676,28 +676,24 @@ void SfxConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent SetUpdateMode(false); ClearAll(); // Remove all old entries from treelist box + m_xContext = xContext; m_xFrame = xFrame; - if( xContext.is() ) + if( bEventMode ) { - m_xContext = xContext; m_sModuleLongName = sModuleLongName; - m_xGlobalCategoryInfo = css::ui::theUICategoryDescription::get( m_xContext ); m_xModuleCategoryInfo.set(m_xGlobalCategoryInfo->getByName(m_sModuleLongName), css::uno::UNO_QUERY_THROW); m_xUICmdDescription = css::frame::theUICommandDescription::get( m_xContext ); - if ( bEventMode ) - InitModule(); + InitModule(); } SAL_INFO("cui.customize", "** ** About to initialise SF Scripts"); // Add Scripting Framework entries Reference< browse::XBrowseNode > rootNode; - Reference< XComponentContext > xCtx( - comphelper::getProcessComponentContext() ); try { - Reference< browse::XBrowseNodeFactory > xFac = browse::theBrowseNodeFactory::get( xCtx ); + Reference< browse::XBrowseNodeFactory > xFac = browse::theBrowseNodeFactory::get( m_xContext ); rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) ); } catch( Exception& e ) @@ -731,7 +727,7 @@ void SfxConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent } // add styles - if ( bEventMode && m_xContext.is() ) + if ( bEventMode ) { OUString sStyle(xImp->m_aStrGroupStyles); SvTreeListEntry *pEntry = InsertEntry( sStyle ); diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx index f1e56128f2ea..cb454389ea62 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -375,7 +375,7 @@ IMPL_LINK( SfxMacroTabPage, TimeOut_Impl, Timer*,, void ) } // fill macro list mpImpl->pGroupLB->Init( - css::uno::Reference<css::uno::XComponentContext >(), + comphelper::getProcessComponentContext(), GetFrame(), OUString(), false); if ( pTabDlg ) |