summaryrefslogtreecommitdiff
path: root/framework/source/helper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-16 14:05:41 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-24 11:29:53 +0200
commite8aa70b5d44a6cbedacfe0e5d1b1da2c76a3c588 (patch)
tree2cb20208eb30391718b57c6302d3dcd6b2e99673 /framework/source/helper
parent3688466ab127d7801b4cb752ee6205cc04acb2f7 (diff)
fdo#46808, convert comphelper::ConfigurationHelper to XComponentContext
Convert the helper methods to take an XComponentContext parameter, instead of XMultiServiceFactory. Change-Id: I9f0098af37b91f107d8799f14caa04756eac82b1
Diffstat (limited to 'framework/source/helper')
-rw-r--r--framework/source/helper/persistentwindowstate.cxx22
-rw-r--r--framework/source/helper/statusindicatorfactory.cxx2
2 files changed, 12 insertions, 12 deletions
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx
index 1733b922f407..26d6c2d121fe 100644
--- a/framework/source/helper/persistentwindowstate.cxx
+++ b/framework/source/helper/persistentwindowstate.cxx
@@ -119,7 +119,7 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
{
// SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock);
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR ;
+ css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getComponentContext(m_xSMGR);
css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
sal_Bool bRestoreWindowState = !m_bWindowStateAlreadySet;
aReadLock.unlock();
@@ -135,7 +135,7 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
return;
// unknown module -> no configuration available!
- ::rtl::OUString sModuleName = PersistentWindowState::implst_identifyModule(comphelper::getComponentContext(xSMGR), xFrame);
+ ::rtl::OUString sModuleName = PersistentWindowState::implst_identifyModule(xContext, xFrame);
if (sModuleName.isEmpty())
return;
@@ -145,7 +145,7 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
{
if (bRestoreWindowState)
{
- ::rtl::OUString sWindowState = PersistentWindowState::implst_getWindowStateFromConfig(xSMGR, sModuleName);
+ ::rtl::OUString sWindowState = PersistentWindowState::implst_getWindowStateFromConfig(xContext, sModuleName);
PersistentWindowState::implst_setWindowStateOnWindow(xWindow,sWindowState);
// SAFE -> ----------------------------------
WriteGuard aWriteLock(m_aLock);
@@ -166,7 +166,7 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
case css::frame::FrameAction_COMPONENT_DETACHING :
{
::rtl::OUString sWindowState = PersistentWindowState::implst_getWindowStateFromWindow(xWindow);
- PersistentWindowState::implst_setWindowStateOnConfig(xSMGR, sModuleName, sWindowState);
+ PersistentWindowState::implst_setWindowStateOnConfig(xContext, sModuleName, sWindowState);
}
break;
default:
@@ -203,8 +203,8 @@ void SAL_CALL PersistentWindowState::disposing(const css::lang::EventObject&)
}
//*****************************************************************************************************************
-::rtl::OUString PersistentWindowState::implst_getWindowStateFromConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
- const ::rtl::OUString& sModuleName)
+::rtl::OUString PersistentWindowState::implst_getWindowStateFromConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const ::rtl::OUString& sModuleName)
{
::rtl::OUString sWindowState;
@@ -219,7 +219,7 @@ void SAL_CALL PersistentWindowState::disposing(const css::lang::EventObject&)
try
{
- ::comphelper::ConfigurationHelper::readDirectKey(xSMGR,
+ ::comphelper::ConfigurationHelper::readDirectKey(rxContext,
sPackage,
sRelPath,
sKey,
@@ -234,9 +234,9 @@ void SAL_CALL PersistentWindowState::disposing(const css::lang::EventObject&)
}
//*****************************************************************************************************************
-void PersistentWindowState::implst_setWindowStateOnConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
- const ::rtl::OUString& sModuleName ,
- const ::rtl::OUString& sWindowState)
+void PersistentWindowState::implst_setWindowStateOnConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const ::rtl::OUString& sModuleName ,
+ const ::rtl::OUString& sWindowState)
{
::rtl::OUStringBuffer sRelPathBuf(256);
sRelPathBuf.appendAscii("Office/Factories/*[\"");
@@ -249,7 +249,7 @@ void PersistentWindowState::implst_setWindowStateOnConfig(const css::uno::Refere
try
{
- ::comphelper::ConfigurationHelper::writeDirectKey(xSMGR,
+ ::comphelper::ConfigurationHelper::writeDirectKey(rxContext,
sPackage,
sRelPath,
sKey,
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index d5ce6042a1be..5a1ba9d822a9 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -420,7 +420,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
{
bool bForceFrontAndFocus(false);
::comphelper::ConfigurationHelper::readDirectKey(
- xSMGR,
+ comphelper::getComponentContext(xSMGR),
::rtl::OUString("org.openoffice.Office.Common/View"),
::rtl::OUString("NewDocumentHandling"),
::rtl::OUString("ForceFocusAndToFront"),