summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-29 17:20:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-29 18:18:28 +0200
commitc2ca6fabd1afc3fc07001721c2069d3c8db7000a (patch)
tree350741d6d19564bcaf00506bd7d22b4c644e0fdc /cui/source
parentf05d7abf93bbcf443cb0b5759ca19992e2fa85a3 (diff)
Use comphelper::getComponentContext
...and some further clean up. Change-Id: Id294c0f38fe0041646fc86cacbd2e19734c746a9
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/customize/cfg.cxx10
-rw-r--r--cui/source/customize/cfgutil.cxx6
-rw-r--r--cui/source/dialogs/scriptdlg.cxx9
-rw-r--r--cui/source/options/treeopt.cxx11
4 files changed, 10 insertions, 26 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index f7dc04eae4c4..5b9b3170f65e 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -888,15 +888,9 @@ SaveInData::SaveInData(
bDocConfig( isDocConfig ),
bReadOnly( sal_False ),
m_xCfgMgr( xCfgMgr ),
- m_xParentCfgMgr( xParentCfgMgr )
+ m_xParentCfgMgr( xParentCfgMgr ),
+ m_xComponentContext( comphelper::getProcessComponentContext() )
{
- uno::Reference< beans::XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
-
- xProps->getPropertyValue(
- OUString("DefaultContext" ))
- >>= m_xComponentContext;
-
m_aSeparatorSeq.realloc( 1 );
m_aSeparatorSeq[0].Name = OUString( ITEM_DESCRIPTOR_TYPE );
m_aSeparatorSeq[0].Value <<= css::ui::ItemType::SEPARATOR_LINE;
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 405c6fa83e10..4d2be18383e7 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -596,12 +596,10 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMul
OSL_TRACE("** ** About to initialise SF Scripts");
// Add Scripting Framework entries
Reference< browse::XBrowseNode > rootNode;
- Reference< XComponentContext > xCtx;
+ Reference< XComponentContext > xCtx(
+ comphelper::getProcessComponentContext() );
try
{
- Reference < beans::XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- xCtx.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW );
Reference< browse::XBrowseNodeFactory > xFac( xCtx->getValueByName(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ) ), UNO_QUERY_THROW );
rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) );
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 2c7b1544dd74..e91e53fb67d3 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -164,7 +164,8 @@ void SFTreeListBox::Init( const ::rtl::OUString& language )
deleteAllTree();
Reference< browse::XBrowseNode > rootNode;
- Reference< XComponentContext > xCtx;
+ Reference< XComponentContext > xCtx(
+ comphelper::getProcessComponentContext() );
Sequence< Reference< browse::XBrowseNode > > children;
@@ -175,12 +176,6 @@ void SFTreeListBox::Init( const ::rtl::OUString& language )
try
{
- Reference < beans::XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
-
- xCtx.set( xProps->getPropertyValue( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("DefaultContext" ))), UNO_QUERY_THROW );
-
Reference< browse::XBrowseNodeFactory > xFac(
xCtx->getValueByName( singleton ), UNO_QUERY_THROW );
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 19c6a5070690..57189590616b 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -835,13 +835,10 @@ void OfaTreeOptionsDialog::ActivateLastSelection()
if ( bMustExpand )
{
- Reference< XComponentContext > xContext;
- Reference< XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
- xProps->getPropertyValue(
- ::rtl::OUString( "DefaultContext" ) ) >>= xContext;
- if ( xContext.is() )
- m_xMacroExpander = Reference< com::sun::star::util::XMacroExpander >(
- xContext->getValueByName( ::rtl::OUString( "/singletons/com.sun.star.util.theMacroExpander" ) ), UNO_QUERY );
+ Reference< XComponentContext > xContext(
+ comphelper::getProcessComponentContext() );
+ m_xMacroExpander = Reference< com::sun::star::util::XMacroExpander >(
+ xContext->getValueByName( ::rtl::OUString( "/singletons/com.sun.star.util.theMacroExpander" ) ), UNO_QUERY );
}
SvLBoxEntry* pTemp = aTreeLB.First();