Kaydet (Commit) 5835d8d2 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert some XMultiServiceFactory to XComponentContext

Change-Id: Ia55bb7af6e5d1c76f3cf8001ea53892e1e1bdac0
üst 052de9c1
......@@ -70,7 +70,7 @@ class PersistentWindowState : // interfaces
private:
/// may we need an uno service manager to create own services
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
/// reference to the frame which was created by the office himself
css::uno::WeakReference< css::frame::XFrame > m_xFrame;
......@@ -85,7 +85,7 @@ class PersistentWindowState : // interfaces
//____________________________
// ctor/dtor
PersistentWindowState(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
PersistentWindowState(const css::uno::Reference< css::uno::XComponentContext >& xContext);
virtual ~PersistentWindowState( );
//____________________________
......
......@@ -61,9 +61,9 @@ DEFINE_XTYPEPROVIDER_4(PersistentWindowState ,
css::lang::XEventListener )
//*****************************************************************************************************************
PersistentWindowState::PersistentWindowState(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
PersistentWindowState::PersistentWindowState(const css::uno::Reference< css::uno::XComponentContext >& xContext)
: ThreadHelpBase (&Application::GetSolarMutex())
, m_xSMGR (xSMGR )
, m_xContext (xContext )
, m_bWindowStateAlreadySet(sal_False )
{
}
......@@ -110,7 +110,7 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
{
// SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getComponentContext(m_xSMGR);
css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
sal_Bool bRestoreWindowState = !m_bWindowStateAlreadySet;
aReadLock.unlock();
......
......@@ -311,7 +311,7 @@ void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Re
// We must create a special listener service and couple it with the new created task frame.
// He will restore or save the window state of it ...
// See used classes for further information too.
PersistentWindowState* pPersistentStateHandler = new PersistentWindowState(xSMGR);
PersistentWindowState* pPersistentStateHandler = new PersistentWindowState( comphelper::getComponentContext(xSMGR));
css::uno::Reference< css::lang::XInitialization > xInit(static_cast< ::cppu::OWeakObject* >(pPersistentStateHandler), css::uno::UNO_QUERY_THROW);
css::uno::Sequence< css::uno::Any > lInitData(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment