fdo#46808, convert XMultiServiceFactory to XComponentContext

Change-Id: I5ed0b12bf37e7d235fc88182c006a6ed07ef2343
This commit is contained in:
Noel Grandin
2013-05-21 17:38:02 +02:00
parent 7298a2b0c7
commit fe1ac1bf90
25 changed files with 171 additions and 189 deletions

View File

@@ -41,7 +41,7 @@ class DropTargetListener : private ThreadHelpBase
private: private:
/// uno service manager to create necessary services /// uno service manager to create necessary services
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; css::uno::Reference< css::uno::XComponentContext > m_xContext;
/// weakreference to target frame (Don't use a hard reference. Owner can't delete us then!) /// weakreference to target frame (Don't use a hard reference. Owner can't delete us then!)
css::uno::WeakReference< css::frame::XFrame > m_xTargetFrame; css::uno::WeakReference< css::frame::XFrame > m_xTargetFrame;
/// drag/drop info /// drag/drop info
@@ -51,7 +51,7 @@ class DropTargetListener : private ThreadHelpBase
// c++ interface // c++ interface
public: public:
DropTargetListener( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory , DropTargetListener( const css::uno::Reference< css::uno::XComponentContext >& xContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame ); const css::uno::Reference< css::frame::XFrame >& xFrame );
~DropTargetListener( ); ~DropTargetListener( );

View File

@@ -26,7 +26,6 @@
#include <general.h> #include <general.h>
#include <stdtypes.h> #include <stdtypes.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/beans/PropertyExistException.hpp> #include <com/sun/star/beans/PropertyExistException.hpp>
@@ -62,8 +61,6 @@ class FWI_DLLPUBLIC PropertySetHelper : public css::beans::XPropertySet
/* member */ /* member */
protected: protected:
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
PropertySetHelper::TPropInfoHash m_lProps; PropertySetHelper::TPropInfoHash m_lProps;
ListenerHash m_lSimpleChangeListener; ListenerHash m_lSimpleChangeListener;
@@ -83,10 +80,6 @@ class FWI_DLLPUBLIC PropertySetHelper : public css::beans::XPropertySet
//--------------------------------------------------------------------- //---------------------------------------------------------------------
/** initialize new instance of this helper. /** initialize new instance of this helper.
*
* @param xSMGR
* points to an uno service manager, which is used internaly to create own
* needed uno services.
* *
* @param pExternalLock * @param pExternalLock
* this helper must be used as a baseclass ... * this helper must be used as a baseclass ...
@@ -101,8 +94,7 @@ class FWI_DLLPUBLIC PropertySetHelper : public css::beans::XPropertySet
* @param bReleaseLockOnCall * @param bReleaseLockOnCall
* see member m_bReleaseLockOnCall * see member m_bReleaseLockOnCall
*/ */
PropertySetHelper(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , PropertySetHelper( LockHelper* pExternalLock ,
LockHelper* pExternalLock ,
TransactionManager* pExternalTransactionManager , TransactionManager* pExternalTransactionManager ,
sal_Bool bReleaseLockOnCall ); sal_Bool bReleaseLockOnCall );

View File

@@ -26,7 +26,7 @@
#include <general.h> #include <general.h>
#include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Reference.hxx>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
@@ -48,13 +48,13 @@ class TaskCreator : private ThreadHelpBase
// member // member
private: private:
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; css::uno::Reference< css::uno::XComponentContext > m_xContext;
//_______________________ //_______________________
// interface // interface
public: public:
TaskCreator( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ); TaskCreator( const css::uno::Reference< css::uno::XComponentContext >& xContext );
virtual ~TaskCreator( ); virtual ~TaskCreator( );
css::uno::Reference< css::frame::XFrame > createTask( const OUString& sName , css::uno::Reference< css::frame::XFrame > createTask( const OUString& sName ,

View File

@@ -35,7 +35,7 @@
#include <com/sun/star/frame/XDispatchInformationProvider.hpp> #include <com/sun/star/frame/XDispatchInformationProvider.hpp>
#include <com/sun/star/util/URL.hpp> #include <com/sun/star/util/URL.hpp>
#include <com/sun/star/frame/XDispatchResultListener.hpp> #include <com/sun/star/frame/XDispatchResultListener.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/frame/DispatchResultState.hpp> #include <com/sun/star/frame/DispatchResultState.hpp>
#include <cppuhelper/weak.hxx> #include <cppuhelper/weak.hxx>
@@ -89,7 +89,7 @@ class CloseDispatcher : public css::lang::XTypeProvider
/** @short reference to an uno service manager, /** @short reference to an uno service manager,
which can be used to create own needed which can be used to create own needed
uno resources. */ uno resources. */
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; css::uno::Reference< css::uno::XComponentContext > m_xContext;
//--------------------------------------- //---------------------------------------
/** @short reference to the target frame, which should be /** @short reference to the target frame, which should be
@@ -132,7 +132,7 @@ class CloseDispatcher : public css::lang::XTypeProvider
That makes an implementation (e.g. of listener support) That makes an implementation (e.g. of listener support)
much more easier .-) much more easier .-)
@param xSMGR @param rxContext
an un oservice manager, which is needed to create uno resource an un oservice manager, which is needed to create uno resource
internaly. internaly.
@@ -142,9 +142,9 @@ class CloseDispatcher : public css::lang::XTypeProvider
@param sTarget @param sTarget
help us to find the right target for this close operation. help us to find the right target for this close operation.
*/ */
CloseDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , CloseDispatcher(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame , const css::uno::Reference< css::frame::XFrame >& xFrame ,
const OUString& sTarget); const OUString& sTarget);
//--------------------------------------- //---------------------------------------
/** @short does nothing real. */ /** @short does nothing real. */

View File

@@ -48,15 +48,15 @@ class DispatchInformationProvider : public css::frame::XDispatchInformationProv
// member // member
private: private:
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; css::uno::Reference< css::uno::XComponentContext > m_xContext;
css::uno::WeakReference< css::frame::XFrame > m_xFrame; css::uno::WeakReference< css::frame::XFrame > m_xFrame;
//_______________________ //_______________________
// interface // interface
public: public:
DispatchInformationProvider(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , DispatchInformationProvider(const css::uno::Reference< css::uno::XComponentContext >& xContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame); const css::uno::Reference< css::frame::XFrame >& xFrame);
virtual ~DispatchInformationProvider(); virtual ~DispatchInformationProvider();

View File

@@ -90,7 +90,7 @@ class DispatchProvider : // interfaces
/* member */ /* member */
private: private:
/// reference to global service manager to create new services /// reference to global service manager to create new services
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; css::uno::Reference< css::uno::XComponentContext > m_xContext;
/// weakreference to owner frame (Don't use a hard reference. Owner can't delete us then!) /// weakreference to owner frame (Don't use a hard reference. Owner can't delete us then!)
css::uno::WeakReference< css::frame::XFrame > m_xFrame; css::uno::WeakReference< css::frame::XFrame > m_xFrame;
/// different dispatcher to handle special dispatch calls, protocols or URLs (they will be created on demand.) /// different dispatcher to handle special dispatch calls, protocols or URLs (they will be created on demand.)
@@ -103,7 +103,7 @@ class DispatchProvider : // interfaces
FWK_DECLARE_XINTERFACE FWK_DECLARE_XINTERFACE
FWK_DECLARE_XTYPEPROVIDER FWK_DECLARE_XTYPEPROVIDER
DispatchProvider( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory , DispatchProvider( const css::uno::Reference< css::uno::XComponentContext >& xContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame ); const css::uno::Reference< css::frame::XFrame >& xFrame );
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL , virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL ,

View File

@@ -77,16 +77,14 @@ class OFrames : private ThreadHelpBase , // Must be the first of base
@seealso - @seealso -
@param "xFactory" , reference to factory which has created ouer owner(!). We can use these to create new uno-services. @param xOwner , reference to ouer owner. We hold a wekreference to prevent us against cross-references!
@param "xOwner" , reference to ouer owner. We hold a wekreference to prevent us against cross-references! @param pFrameContainer , pointer to shared framecontainer of owner. It's valid only, if weakreference is valid!
@param "pFrameContainer" , pointer to shared framecontainer of owner. It's valid only, if weakreference is valid!
@return - @return -
@onerror - @onerror -
*//*-*****************************************************************************************************/ *//*-*****************************************************************************************************/
OFrames( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory , OFrames( const css::uno::Reference< css::frame::XFrame >& xOwner ,
const css::uno::Reference< css::frame::XFrame >& xOwner ,
FrameContainer* pFrameContainer ); FrameContainer* pFrameContainer );
//--------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------
@@ -297,8 +295,7 @@ class OFrames : private ThreadHelpBase , // Must be the first of base
private: private:
static sal_Bool impldbg_checkParameter_OFramesCtor ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory , static sal_Bool impldbg_checkParameter_OFramesCtor ( const css::uno::Reference< css::frame::XFrame >& xOwner ,
const css::uno::Reference< css::frame::XFrame >& xOwner ,
FrameContainer* pFrameContainer ); FrameContainer* pFrameContainer );
static sal_Bool impldbg_checkParameter_append ( const css::uno::Reference< css::frame::XFrame >& xFrame ); static sal_Bool impldbg_checkParameter_append ( const css::uno::Reference< css::frame::XFrame >& xFrame );
static sal_Bool impldbg_checkParameter_remove ( const css::uno::Reference< css::frame::XFrame >& xFrame ); static sal_Bool impldbg_checkParameter_remove ( const css::uno::Reference< css::frame::XFrame >& xFrame );
@@ -313,7 +310,6 @@ class OFrames : private ThreadHelpBase , // Must be the first of base
private: private:
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// reference to global servicemanager
css::uno::WeakReference< css::frame::XFrame > m_xOwner ; /// reference to owner of this instance (Hold no hard reference!) css::uno::WeakReference< css::frame::XFrame > m_xOwner ; /// reference to owner of this instance (Hold no hard reference!)
FrameContainer* m_pFrameContainer ; /// with owner shared list to hold all direct children of an XFramesSupplier FrameContainer* m_pFrameContainer ; /// with owner shared list to hold all direct children of an XFramesSupplier
sal_Bool m_bRecursiveSearchProtection ; /// flag to protect against recursive searches of frames at parents sal_Bool m_bRecursiveSearchProtection ; /// flag to protect against recursive searches of frames at parents

View File

@@ -129,8 +129,8 @@ class Frame : // interfaces
//--------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------
// constructor / destructor // constructor / destructor
//--------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------
Frame( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); Frame( const css::uno::Reference< css::uno::XComponentContext >& xContext );
virtual ~Frame( ); virtual ~Frame( );
//--------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------
// XInterface, XTypeProvider, XServiceInfo // XInterface, XTypeProvider, XServiceInfo
@@ -365,7 +365,7 @@ class Frame : // interfaces
private: private:
static sal_Bool implcp_ctor ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); static sal_Bool implcp_ctor ( const css::uno::Reference< css::uno::XComponentContext >& xContext );
static sal_Bool implcp_setActiveFrame ( const css::uno::Reference< css::frame::XFrame >& xFrame ); static sal_Bool implcp_setActiveFrame ( const css::uno::Reference< css::frame::XFrame >& xFrame );
static sal_Bool implcp_addFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ); static sal_Bool implcp_addFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener );
static sal_Bool implcp_removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ); static sal_Bool implcp_removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener );
@@ -385,7 +385,7 @@ class Frame : // interfaces
//************************************************************************************************************* //*************************************************************************************************************
private: private:
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// reference to factory, which has create this instance css::uno::Reference< css::uno::XComponentContext > m_xContext ; /// reference to factory, which has create this instance
css::uno::Reference< css::task::XStatusIndicatorFactory > m_xIndicatorFactoryHelper ; /// reference to factory helper to create status indicator objects css::uno::Reference< css::task::XStatusIndicatorFactory > m_xIndicatorFactoryHelper ; /// reference to factory helper to create status indicator objects
css::uno::WeakReference< css::task::XStatusIndicator > m_xIndicatorInterception ; /// points to an external set progress, which should be used instead of the internal one. css::uno::WeakReference< css::task::XStatusIndicator > m_xIndicatorInterception ; /// points to an external set progress, which should be used instead of the internal one.
css::uno::Reference< css::frame::XDispatchProvider > m_xDispatchHelper ; /// helper for XDispatch/Provider and interception interfaces css::uno::Reference< css::frame::XDispatchProvider > m_xDispatchHelper ; /// helper for XDispatch/Provider and interception interfaces
@@ -416,10 +416,10 @@ class Frame : // interfaces
FrameContainer m_aChildFrameContainer ; /// array of child frames FrameContainer m_aChildFrameContainer ; /// array of child frames
inline css::uno::Reference< css::lang::XMultiServiceFactory > impl_getFactory() inline css::uno::Reference< css::uno::XComponentContext > impl_getComponentContext()
{ {
ReadGuard aReadLock( m_aLock ); ReadGuard aReadLock( m_aLock );
return m_xFactory; return m_xContext;
} }
inline OUString impl_getName() inline OUString impl_getName()

View File

@@ -41,10 +41,10 @@
namespace framework namespace framework
{ {
DropTargetListener::DropTargetListener( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory, DropTargetListener::DropTargetListener( const css::uno::Reference< css::uno::XComponentContext >& xContext,
const css::uno::Reference< css::frame::XFrame >& xFrame ) const css::uno::Reference< css::frame::XFrame >& xFrame )
: ThreadHelpBase ( &Application::GetSolarMutex() ) : ThreadHelpBase ( &Application::GetSolarMutex() )
, m_xFactory ( xFactory ) , m_xContext ( xContext )
, m_xTargetFrame ( xFrame ) , m_xTargetFrame ( xFrame )
, m_pFormats ( new DataFlavorExVector ) , m_pFormats ( new DataFlavorExVector )
{ {
@@ -54,8 +54,8 @@ DropTargetListener::DropTargetListener( const css::uno::Reference< css::lang::XM
DropTargetListener::~DropTargetListener() DropTargetListener::~DropTargetListener()
{ {
m_xTargetFrame = css::uno::WeakReference< css::frame::XFrame >(); m_xTargetFrame.clear();
m_xFactory = css::uno::Reference< css::lang::XMultiServiceFactory >(); m_xContext.clear();
delete m_pFormats; delete m_pFormats;
m_pFormats = NULL; m_pFormats = NULL;
} }
@@ -64,8 +64,8 @@ DropTargetListener::~DropTargetListener()
void SAL_CALL DropTargetListener::disposing( const css::lang::EventObject& ) throw( css::uno::RuntimeException ) void SAL_CALL DropTargetListener::disposing( const css::lang::EventObject& ) throw( css::uno::RuntimeException )
{ {
m_xTargetFrame = css::uno::WeakReference< css::frame::XFrame >(); m_xTargetFrame.clear();
m_xFactory = css::uno::Reference< css::lang::XMultiServiceFactory >(); m_xContext.clear();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@@ -212,7 +212,7 @@ void DropTargetListener::implts_OpenFile( const String& rFilePath )
/* SAFE { */ /* SAFE { */
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::frame::XFrame > xTargetFrame( m_xTargetFrame.get(), css::uno::UNO_QUERY ); css::uno::Reference< css::frame::XFrame > xTargetFrame( m_xTargetFrame.get(), css::uno::UNO_QUERY );
css::uno::Reference< css::util::XURLTransformer > xParser ( css::util::URLTransformer::create(::comphelper::getComponentContext(m_xFactory)) ); css::uno::Reference< css::util::XURLTransformer > xParser ( css::util::URLTransformer::create(m_xContext) );
aReadLock.unlock(); aReadLock.unlock();
/* } SAFE */ /* } SAFE */
if (xTargetFrame.is() && xParser.is()) if (xTargetFrame.is() && xParser.is())

View File

@@ -37,12 +37,12 @@ namespace framework{
@descr We need a valid uno service manager to create or instanciate new services. @descr We need a valid uno service manager to create or instanciate new services.
All other information to create frames or tasks come in on right interface methods. All other information to create frames or tasks come in on right interface methods.
@param xSMGR @param xContext
points to the valid uno service manager points to the valid uno service manager
*//*-*****************************************************************************************************/ *//*-*****************************************************************************************************/
TaskCreator::TaskCreator( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ) TaskCreator::TaskCreator( const css::uno::Reference< css::uno::XComponentContext >& xContext )
: ThreadHelpBase( ) : ThreadHelpBase( )
, m_xSMGR ( xSMGR ) , m_xContext ( xContext )
{ {
} }
@@ -52,7 +52,7 @@ TaskCreator::TaskCreator( const css::uno::Reference< css::lang::XMultiServiceFac
*//*-*****************************************************************************************************/ *//*-*****************************************************************************************************/
TaskCreator::~TaskCreator() TaskCreator::~TaskCreator()
{ {
m_xSMGR.clear(); m_xContext.clear();
} }
/*-****************************************************************************************************//** /*-****************************************************************************************************//**
@@ -63,7 +63,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
{ {
/* SAFE { */ /* SAFE { */
ReadGuard aReadLock( m_aLock ); ReadGuard aReadLock( m_aLock );
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
/* } SAFE */ /* } SAFE */
@@ -78,7 +78,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
) )
{ {
::comphelper::ConfigurationHelper::readDirectKey( ::comphelper::ConfigurationHelper::readDirectKey(
comphelper::getComponentContext(xSMGR), xContext,
"org.openoffice.Office.TabBrowse", "org.openoffice.Office.TabBrowse",
"TaskCreatorService", "TaskCreatorService",
"ImplementationName", "ImplementationName",
@@ -86,7 +86,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
} }
xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >( xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >(
xSMGR->createInstance(sCreator), css::uno::UNO_QUERY_THROW); xContext->getServiceManager()->createInstanceWithContext(sCreator, xContext), css::uno::UNO_QUERY_THROW);
} }
catch(const css::uno::Exception&) catch(const css::uno::Exception&)
{} {}
@@ -97,13 +97,13 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
// library then these class here ... Why we should not be able to create it ? // library then these class here ... Why we should not be able to create it ?
if ( ! xCreator.is()) if ( ! xCreator.is())
xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >( xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >(
xSMGR->createInstance(IMPLEMENTATIONNAME_FWK_TASKCREATOR), css::uno::UNO_QUERY_THROW); xContext->getServiceManager()->createInstanceWithContext(IMPLEMENTATIONNAME_FWK_TASKCREATOR, xContext), css::uno::UNO_QUERY_THROW);
css::uno::Sequence< css::uno::Any > lArgs(5); css::uno::Sequence< css::uno::Any > lArgs(5);
css::beans::NamedValue aArg ; css::beans::NamedValue aArg ;
aArg.Name = OUString(ARGUMENT_PARENTFRAME); aArg.Name = OUString(ARGUMENT_PARENTFRAME);
aArg.Value <<= css::uno::Reference< css::frame::XFrame >( css::frame::Desktop::create( comphelper::getComponentContext(xSMGR) ), css::uno::UNO_QUERY_THROW); aArg.Value <<= css::uno::Reference< css::frame::XFrame >( css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY_THROW);
lArgs[0] <<= aArg; lArgs[0] <<= aArg;
aArg.Name = OUString(ARGUMENT_CREATETOPWINDOW); aArg.Name = OUString(ARGUMENT_CREATETOPWINDOW);

View File

@@ -72,12 +72,12 @@ DEFINE_XTYPEPROVIDER_4(CloseDispatcher ,
css::frame::XDispatch ) css::frame::XDispatch )
//----------------------------------------------- //-----------------------------------------------
CloseDispatcher::CloseDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , CloseDispatcher::CloseDispatcher(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame , const css::uno::Reference< css::frame::XFrame >& xFrame ,
const OUString& sTarget) const OUString& sTarget)
: ThreadHelpBase (&Application::GetSolarMutex() ) : ThreadHelpBase (&Application::GetSolarMutex() )
, ::cppu::OWeakObject( ) , ::cppu::OWeakObject( )
, m_xSMGR (xSMGR ) , m_xContext (rxContext )
, m_aAsyncCallback (LINK( this, CloseDispatcher, impl_asyncCallback)) , m_aAsyncCallback (LINK( this, CloseDispatcher, impl_asyncCallback))
, m_lStatusListener (m_aLock.getShareableOslMutex() ) , m_lStatusListener (m_aLock.getShareableOslMutex() )
, m_pSysWindow(NULL) , m_pSysWindow(NULL)
@@ -282,7 +282,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback)
// BTW: Make some copies, which are needed later ... // BTW: Make some copies, which are needed later ...
EOperation eOperation = m_eOperation; EOperation eOperation = m_eOperation;
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
css::uno::Reference< css::frame::XFrame > xCloseFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY); css::uno::Reference< css::frame::XFrame > xCloseFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY);
css::uno::Reference< css::frame::XDispatchResultListener > xListener = m_xResultListener; css::uno::Reference< css::frame::XDispatchResultListener > xListener = m_xResultListener;
@@ -301,7 +301,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback)
// Analyze the environment a first time. // Analyze the environment a first time.
// If we found some special cases, we can // If we found some special cases, we can
// make some decisions erliar! // make some decisions erliar!
css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create(comphelper::getComponentContext(xSMGR)), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create(xContext), css::uno::UNO_QUERY_THROW);
FrameListAnalyzer aCheck1(xDesktop, xCloseFrame, FrameListAnalyzer::E_HELP | FrameListAnalyzer::E_BACKINGCOMPONENT); FrameListAnalyzer aCheck1(xDesktop, xCloseFrame, FrameListAnalyzer::E_HELP | FrameListAnalyzer::E_BACKINGCOMPONENT);
// a) If the curent frame (where the close dispatch was requested for) does not have // a) If the curent frame (where the close dispatch was requested for) does not have
@@ -465,11 +465,11 @@ sal_Bool CloseDispatcher::implts_prepareFrameForClosing(const css::uno::Referenc
{ {
// SAFE -> ---------------------------------- // SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
// <- SAFE ---------------------------------- // <- SAFE ----------------------------------
css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create( comphelper::getComponentContext(xSMGR) ), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY_THROW);
FrameListAnalyzer aCheck(xDesktop, xFrame, FrameListAnalyzer::E_ALL); FrameListAnalyzer aCheck(xDesktop, xFrame, FrameListAnalyzer::E_ALL);
sal_Int32 c = aCheck.m_lModelFrames.getLength(); sal_Int32 c = aCheck.m_lModelFrames.getLength();
@@ -533,8 +533,8 @@ sal_Bool CloseDispatcher::implts_establishBackingMode()
{ {
// SAFE -> ---------------------------------- // SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
css::uno::Reference< css::frame::XFrame > xFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY); css::uno::Reference< css::frame::XFrame > xFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY);
aReadLock.unlock(); aReadLock.unlock();
// <- SAFE ---------------------------------- // <- SAFE ----------------------------------
@@ -548,7 +548,7 @@ sal_Bool CloseDispatcher::implts_establishBackingMode()
css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow(); css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow();
css::uno::Reference< css::frame::XController > xStartModule = css::frame::StartModule::createWithParentWindow( css::uno::Reference< css::frame::XController > xStartModule = css::frame::StartModule::createWithParentWindow(
comphelper::getComponentContext(xSMGR), xContainerWindow); xContext, xContainerWindow);
// Attention: You MUST(!) call setComponent() before you call attachFrame(). // Attention: You MUST(!) call setComponent() before you call attachFrame().
css::uno::Reference< css::awt::XWindow > xBackingWin(xStartModule, css::uno::UNO_QUERY); css::uno::Reference< css::awt::XWindow > xBackingWin(xStartModule, css::uno::UNO_QUERY);
@@ -564,11 +564,11 @@ sal_Bool CloseDispatcher::implts_terminateApplication()
{ {
// SAFE -> ---------------------------------- // SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
// <- SAFE ---------------------------------- // <- SAFE ----------------------------------
css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( comphelper::getComponentContext(xSMGR) ); css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext );
return xDesktop->terminate(); return xDesktop->terminate();
} }

View File

@@ -35,10 +35,10 @@ DEFINE_XINTERFACE_1(DispatchInformationProvider ,
DIRECT_INTERFACE(css::frame::XDispatchInformationProvider)) DIRECT_INTERFACE(css::frame::XDispatchInformationProvider))
//_________________________________________________________________________________________________________________ //_________________________________________________________________________________________________________________
DispatchInformationProvider::DispatchInformationProvider(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , DispatchInformationProvider::DispatchInformationProvider(const css::uno::Reference< css::uno::XComponentContext >& xContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame) const css::uno::Reference< css::frame::XFrame >& xFrame)
: ThreadHelpBase(&Application::GetSolarMutex()) : ThreadHelpBase(&Application::GetSolarMutex())
, m_xSMGR (xSMGR ) , m_xContext (xContext )
, m_xFrame (xFrame ) , m_xFrame (xFrame )
{ {
} }
@@ -135,21 +135,22 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvide
{ {
// SAFE -> ---------------------------------- // SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = 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); css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
aReadLock.unlock(); aReadLock.unlock();
// <- SAFE ---------------------------------- // <- SAFE ----------------------------------
if (!xFrame.is()) if (!xFrame.is())
return css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > >(); return css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > >();
CloseDispatcher* pCloser = new CloseDispatcher(xSMGR, xFrame, OUString("_self")); // explicit "_self" ... not "" ... see implementation of close dispatcher itself! CloseDispatcher* pCloser = new CloseDispatcher(xContext, xFrame, OUString("_self")); // explicit "_self" ... not "" ... see implementation of close dispatcher itself!
css::uno::Reference< css::uno::XInterface > xCloser(static_cast< css::frame::XDispatch* >(pCloser), css::uno::UNO_QUERY); css::uno::Reference< css::uno::XInterface > xCloser(static_cast< css::frame::XDispatch* >(pCloser), css::uno::UNO_QUERY);
css::uno::Reference< css::frame::XDispatchInformationProvider > xCloseDispatch(xCloser , css::uno::UNO_QUERY); css::uno::Reference< css::frame::XDispatchInformationProvider > xCloseDispatch(xCloser , css::uno::UNO_QUERY);
css::uno::Reference< css::frame::XDispatchInformationProvider > xController (xFrame->getController() , css::uno::UNO_QUERY); css::uno::Reference< css::frame::XDispatchInformationProvider > xController (xFrame->getController() , css::uno::UNO_QUERY);
css::uno::Reference< css::frame::XDispatchInformationProvider > xAppDispatcher(xSMGR->createInstance(IMPLEMENTATIONNAME_APPDISPATCHPROVIDER), css::uno::UNO_QUERY); css::uno::Reference< css::frame::XDispatchInformationProvider > xAppDispatcher(
css::uno::Reference<css::lang::XMultiServiceFactory>(xContext->getServiceManager(), css::uno::UNO_QUERY_THROW)
->createInstance(IMPLEMENTATIONNAME_APPDISPATCHPROVIDER), css::uno::UNO_QUERY);
css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > lProvider(3); css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > lProvider(3);
lProvider[0] = xController ; lProvider[0] = xController ;
lProvider[1] = xCloseDispatch; lProvider[1] = xCloseDispatch;

View File

@@ -72,18 +72,18 @@ DEFINE_XTYPEPROVIDER_2( DispatchProvider ,
@seealso using at owner @seealso using at owner
@param xFactory @param rxContext
reference to servicemanager to create new services. reference to servicemanager to create new services.
@param xFrame @param xFrame
reference to our owner frame. reference to our owner frame.
*/ */
DispatchProvider::DispatchProvider( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory , DispatchProvider::DispatchProvider( const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame ) const css::uno::Reference< css::frame::XFrame >& xFrame )
// Init baseclasses first // Init baseclasses first
: ThreadHelpBase( &Application::GetSolarMutex() ) : ThreadHelpBase( &Application::GetSolarMutex() )
, OWeakObject ( ) , OWeakObject ( )
// Init member // Init member
, m_xFactory ( xFactory ) , m_xContext ( rxContext )
, m_xFrame ( xFrame ) , m_xFrame ( xFrame )
{ {
} }
@@ -514,7 +514,8 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_searchProt
try try
{ {
xHandler = css::uno::Reference< css::frame::XDispatchProvider >( xHandler = css::uno::Reference< css::frame::XDispatchProvider >(
m_xFactory->createInstance(aHandler.m_sUNOName), css::uno::Reference<css::lang::XMultiServiceFactory>(m_xContext->getServiceManager(), css::uno::UNO_QUERY_THROW)
->createInstance(aHandler.m_sUNOName),
css::uno::UNO_QUERY); css::uno::UNO_QUERY);
} }
catch(const css::uno::Exception&) {} catch(const css::uno::Exception&) {}
@@ -583,7 +584,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
/* SAFE { */ /* SAFE { */
ReadGuard aReadLock( m_aLock ); ReadGuard aReadLock( m_aLock );
css::uno::Reference< css::lang::XMultiServiceFactory > xFactory = m_xFactory; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
/* } SAFE */ /* } SAFE */
@@ -597,7 +598,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
WriteGuard aWriteLock( m_aLock ); WriteGuard aWriteLock( m_aLock );
if ( ! m_xMenuDispatcher.is() ) if ( ! m_xMenuDispatcher.is() )
{ {
MenuDispatcher* pDispatcher = new MenuDispatcher( comphelper::getComponentContext(xFactory), xOwner ); MenuDispatcher* pDispatcher = new MenuDispatcher( xContext, xOwner );
m_xMenuDispatcher = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY ); m_xMenuDispatcher = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
} }
xDispatchHelper = m_xMenuDispatcher; xDispatchHelper = m_xMenuDispatcher;
@@ -608,7 +609,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
case E_CREATEDISPATCHER : case E_CREATEDISPATCHER :
{ {
LoadDispatcher* pDispatcher = new LoadDispatcher(xFactory, xOwner, sTarget, nSearchFlags); LoadDispatcher* pDispatcher = new LoadDispatcher(xContext, xOwner, sTarget, nSearchFlags);
xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY ); xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
} }
break; break;
@@ -618,7 +619,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
css::uno::Reference< css::frame::XFrame > xDesktop( xOwner, css::uno::UNO_QUERY ); css::uno::Reference< css::frame::XFrame > xDesktop( xOwner, css::uno::UNO_QUERY );
if (xDesktop.is()) if (xDesktop.is())
{ {
LoadDispatcher* pDispatcher = new LoadDispatcher(xFactory, xOwner, SPECIALTARGET_BLANK, 0); LoadDispatcher* pDispatcher = new LoadDispatcher(xContext, xOwner, SPECIALTARGET_BLANK, 0);
xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY ); xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
} }
} }
@@ -629,7 +630,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
css::uno::Reference< css::frame::XFrame > xDesktop( xOwner, css::uno::UNO_QUERY ); css::uno::Reference< css::frame::XFrame > xDesktop( xOwner, css::uno::UNO_QUERY );
if (xDesktop.is()) if (xDesktop.is())
{ {
LoadDispatcher* pDispatcher = new LoadDispatcher(xFactory, xOwner, SPECIALTARGET_DEFAULT, 0); LoadDispatcher* pDispatcher = new LoadDispatcher(xContext, xOwner, SPECIALTARGET_DEFAULT, 0);
xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY ); xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
} }
} }
@@ -637,21 +638,21 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
case E_SELFDISPATCHER : case E_SELFDISPATCHER :
{ {
LoadDispatcher* pDispatcher = new LoadDispatcher(xFactory, xOwner, SPECIALTARGET_SELF, 0); LoadDispatcher* pDispatcher = new LoadDispatcher(xContext, xOwner, SPECIALTARGET_SELF, 0);
xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY ); xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
} }
break; break;
case E_CLOSEDISPATCHER : case E_CLOSEDISPATCHER :
{ {
CloseDispatcher* pDispatcher = new CloseDispatcher( xFactory, xOwner, sTarget ); CloseDispatcher* pDispatcher = new CloseDispatcher( xContext, xOwner, sTarget );
xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY ); xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
} }
break; break;
case E_STARTMODULEDISPATCHER : case E_STARTMODULEDISPATCHER :
{ {
StartModuleDispatcher* pDispatcher = new StartModuleDispatcher( comphelper::getComponentContext(xFactory), xOwner, sTarget ); StartModuleDispatcher* pDispatcher = new StartModuleDispatcher( xContext, xOwner, sTarget );
xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY ); xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
} }
break; break;

View File

@@ -25,22 +25,22 @@
namespace framework{ namespace framework{
LoadDispatcher::LoadDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , LoadDispatcher::LoadDispatcher(const css::uno::Reference< css::uno::XComponentContext >& xContext ,
const css::uno::Reference< css::frame::XFrame >& xOwnerFrame , const css::uno::Reference< css::frame::XFrame >& xOwnerFrame ,
const OUString sTargetName , const OUString sTargetName ,
sal_Int32 nSearchFlags) sal_Int32 nSearchFlags)
: ThreadHelpBase( ) : ThreadHelpBase( )
, m_xSMGR (xSMGR ) , m_xContext (xContext )
, m_xOwnerFrame (xOwnerFrame ) , m_xOwnerFrame (xOwnerFrame )
, m_sTarget (sTargetName ) , m_sTarget (sTargetName )
, m_nSearchFlags(nSearchFlags) , m_nSearchFlags(nSearchFlags)
, m_aLoader (xSMGR ) , m_aLoader (xContext )
{ {
} }
LoadDispatcher::~LoadDispatcher() LoadDispatcher::~LoadDispatcher()
{ {
m_xSMGR.clear(); m_xContext.clear();
} }
void SAL_CALL LoadDispatcher::dispatchWithNotification(const css::util::URL& aURL , void SAL_CALL LoadDispatcher::dispatchWithNotification(const css::util::URL& aURL ,

View File

@@ -40,10 +40,10 @@
namespace framework{ namespace framework{
//----------------------------------------------- //-----------------------------------------------
WindowCommandDispatch::WindowCommandDispatch(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , WindowCommandDispatch::WindowCommandDispatch(const css::uno::Reference< css::uno::XComponentContext >& xContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame) const css::uno::Reference< css::frame::XFrame >& xFrame)
: ThreadHelpBase( ) : ThreadHelpBase( )
, m_xSMGR (xSMGR ) , m_xContext (xContext )
, m_xFrame (xFrame ) , m_xFrame (xFrame )
, m_xWindow (xFrame->getContainerWindow()) , m_xWindow (xFrame->getContainerWindow())
{ {
@@ -54,7 +54,7 @@ WindowCommandDispatch::WindowCommandDispatch(const css::uno::Reference< css::lan
WindowCommandDispatch::~WindowCommandDispatch() WindowCommandDispatch::~WindowCommandDispatch()
{ {
impl_stopListening(); impl_stopListening();
m_xSMGR.clear(); m_xContext.clear();
} }
//----------------------------------------------- //-----------------------------------------------
@@ -156,7 +156,7 @@ void WindowCommandDispatch::impl_dispatchCommand(const OUString& sCommand)
// SYNCHRONIZED -> // SYNCHRONIZED ->
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::frame::XDispatchProvider > xProvider(m_xFrame.get(), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::frame::XDispatchProvider > xProvider(m_xFrame.get(), css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
// <- SYNCHRONIZED // <- SYNCHRONIZED
@@ -164,7 +164,7 @@ void WindowCommandDispatch::impl_dispatchCommand(const OUString& sCommand)
if ( ! xProvider.is()) if ( ! xProvider.is())
return; return;
css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::getComponentContext(xSMGR))); css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(xContext));
css::util::URL aCommand; css::util::URL aCommand;
aCommand.Complete = sCommand; aCommand.Complete = sCommand;
xParser->parseStrict(aCommand); xParser->parseStrict(aCommand);

View File

@@ -27,12 +27,10 @@ namespace framework{
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
PropertySetHelper::PropertySetHelper(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , PropertySetHelper::PropertySetHelper( LockHelper* pExternalLock ,
LockHelper* pExternalLock ,
TransactionManager* pExternalTransactionManager , TransactionManager* pExternalTransactionManager ,
sal_Bool bReleaseLockOnCall ) sal_Bool bReleaseLockOnCall )
: m_xSMGR (xSMGR ) : m_lSimpleChangeListener(pExternalLock->getShareableOslMutex())
, m_lSimpleChangeListener(pExternalLock->getShareableOslMutex())
, m_lVetoChangeListener (pExternalLock->getShareableOslMutex()) , m_lVetoChangeListener (pExternalLock->getShareableOslMutex())
, m_bReleaseLockOnCall (bReleaseLockOnCall ) , m_bReleaseLockOnCall (bReleaseLockOnCall )
, m_rLock (*pExternalLock ) , m_rLock (*pExternalLock )

View File

@@ -40,20 +40,18 @@ using namespace ::std ;
//***************************************************************************************************************** //*****************************************************************************************************************
// constructor // constructor
//***************************************************************************************************************** //*****************************************************************************************************************
OFrames::OFrames( const css::uno::Reference< XMultiServiceFactory >& xFactory , OFrames::OFrames( const css::uno::Reference< XFrame >& xOwner ,
const css::uno::Reference< XFrame >& xOwner ,
FrameContainer* pFrameContainer ) FrameContainer* pFrameContainer )
// Init baseclasses first // Init baseclasses first
: ThreadHelpBase ( &Application::GetSolarMutex() ) : ThreadHelpBase ( &Application::GetSolarMutex() )
// Init member // Init member
, m_xFactory ( xFactory )
, m_xOwner ( xOwner ) , m_xOwner ( xOwner )
, m_pFrameContainer ( pFrameContainer ) , m_pFrameContainer ( pFrameContainer )
, m_bRecursiveSearchProtection( sal_False ) , m_bRecursiveSearchProtection( sal_False )
{ {
// Safe impossible cases // Safe impossible cases
// Method is not defined for ALL incoming parameters! // Method is not defined for ALL incoming parameters!
LOG_ASSERT( impldbg_checkParameter_OFramesCtor( xFactory, xOwner, pFrameContainer ), "OFrames::OFrames()\nInvalid parameter detected!\n" ) LOG_ASSERT( impldbg_checkParameter_OFramesCtor( xOwner, pFrameContainer ), "OFrames::OFrames()\nInvalid parameter detected!\n" )
} }
//***************************************************************************************************************** //*****************************************************************************************************************
@@ -395,17 +393,14 @@ void OFrames::impl_appendSequence( Sequence< css::uno::Reference< XFram
// An instance of this class can only work with valid initialization. // An instance of this class can only work with valid initialization.
// We share the mutex with ouer owner class, need a valid factory to instanciate new services and // We share the mutex with ouer owner class, need a valid factory to instanciate new services and
// use the access to ouer owner for some operations. // use the access to ouer owner for some operations.
sal_Bool OFrames::impldbg_checkParameter_OFramesCtor( const css::uno::Reference< XMultiServiceFactory >& xFactory , sal_Bool OFrames::impldbg_checkParameter_OFramesCtor( const css::uno::Reference< XFrame >& xOwner ,
const css::uno::Reference< XFrame >& xOwner ,
FrameContainer* pFrameContainer ) FrameContainer* pFrameContainer )
{ {
// Set default return value. // Set default return value.
sal_Bool bOK = sal_True; sal_Bool bOK = sal_True;
// Check parameter. // Check parameter.
if ( if (
( &xFactory == NULL ) ||
( &xOwner == NULL ) || ( &xOwner == NULL ) ||
( xFactory.is() == sal_False ) ||
( xOwner.is() == sal_False ) || ( xOwner.is() == sal_False ) ||
( pFrameContainer == NULL ) ( pFrameContainer == NULL )
) )

View File

@@ -45,7 +45,7 @@ class LoadDispatcher : private ThreadHelpBase
private: private:
/** @short can be used to create own needed services on demand. */ /** @short can be used to create own needed services on demand. */
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; css::uno::Reference< css::uno::XComponentContext > m_xContext;
/** @short TODO document me */ /** @short TODO document me */
css::uno::WeakReference< css::frame::XFrame > m_xOwnerFrame; css::uno::WeakReference< css::frame::XFrame > m_xOwnerFrame;
@@ -70,7 +70,7 @@ class LoadDispatcher : private ThreadHelpBase
That means: It can be used to load any further requested content into tzhe here(!) That means: It can be used to load any further requested content into tzhe here(!)
specified target frame. specified target frame.
@param xSMGR @param xContext
will be used to create own needed services on demand. will be used to create own needed services on demand.
@param xOwnerFrame @param xOwnerFrame
@@ -83,8 +83,8 @@ class LoadDispatcher : private ThreadHelpBase
@param nSearchFlags @param nSearchFlags
used in case sTargetFrame isnt a special one. used in case sTargetFrame isnt a special one.
*/ */
LoadDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , LoadDispatcher(const css::uno::Reference< css::uno::XComponentContext >& xContext,
const css::uno::Reference< css::frame::XFrame >& xOwnerFrame , const css::uno::Reference< css::frame::XFrame >& xOwnerFrame ,
const OUString sTargetName , const OUString sTargetName ,
sal_Int32 nSearchFlags); sal_Int32 nSearchFlags);

View File

@@ -48,7 +48,7 @@ class WindowCommandDispatch : private ThreadHelpBase
private: private:
/// can be used to create own needed services on demand. /// can be used to create own needed services on demand.
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; css::uno::Reference< css::uno::XComponentContext > m_xContext;
/// knows the frame, where we dispatch our commands as weak reference /// knows the frame, where we dispatch our commands as weak reference
css::uno::WeakReference< css::frame::XFrame > m_xFrame; css::uno::WeakReference< css::frame::XFrame > m_xFrame;
@@ -69,13 +69,13 @@ class WindowCommandDispatch : private ThreadHelpBase
Means: 1 MACDispatch object is bound to 1 Frame/Window pair in which context Means: 1 MACDispatch object is bound to 1 Frame/Window pair in which context
the detected commands will be executed. the detected commands will be executed.
@param xSMGR @param xContext
will be used to create own needed services on demand. will be used to create own needed services on demand.
@param xFrame @param xFrame
used as for new detected commands. used as for new detected commands.
*/ */
WindowCommandDispatch(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , WindowCommandDispatch(const css::uno::Reference< css::uno::XComponentContext >& xContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame); const css::uno::Reference< css::frame::XFrame >& xFrame);
//_______________________________________ //_______________________________________

View File

@@ -110,7 +110,7 @@ private:
/** @short reference to an uno service manager, which must be used /** @short reference to an uno service manager, which must be used
to created on needed services on demand. to created on needed services on demand.
*/ */
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; css::uno::Reference< css::uno::XComponentContext > m_xContext;
/** @short points to the frame, which uses this LoadEnv object /** @short points to the frame, which uses this LoadEnv object
and must be used to start target search there. and must be used to start target search there.
@@ -200,7 +200,7 @@ public:
/** @short initialize a new instance of this load environment. /** @short initialize a new instance of this load environment.
@param xSMGR @param xContext
reference to an uno service manager, which can be used internaly reference to an uno service manager, which can be used internaly
to create on needed services on demand. to create on needed services on demand.
@@ -209,7 +209,7 @@ public:
@throw A RuntimeException in case any internal process indicates, that @throw A RuntimeException in case any internal process indicates, that
the whole runtime cant be used any longer. the whole runtime cant be used any longer.
*/ */
LoadEnv(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) LoadEnv(const css::uno::Reference< css::uno::XComponentContext >& xContext)
throw(LoadEnvException, css::uno::RuntimeException); throw(LoadEnvException, css::uno::RuntimeException);
/** @short deinitialize an instance of this class in the right way. /** @short deinitialize an instance of this class in the right way.
@@ -217,7 +217,7 @@ public:
~LoadEnv(); ~LoadEnv();
static css::uno::Reference< css::lang::XComponent > loadComponentFromURL(const css::uno::Reference< css::frame::XComponentLoader >& xLoader, static css::uno::Reference< css::lang::XComponent > loadComponentFromURL(const css::uno::Reference< css::frame::XComponentLoader >& xLoader,
const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , const css::uno::Reference< css::uno::XComponentContext >& xContext,
const OUString& sURL , const OUString& sURL ,
const OUString& sTarget, const OUString& sTarget,
sal_Int32 nFlags , sal_Int32 nFlags ,

View File

@@ -129,10 +129,10 @@ class LoadEnvListener : private ThreadHelpBase
}; };
LoadEnv::LoadEnv(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) LoadEnv::LoadEnv(const css::uno::Reference< css::uno::XComponentContext >& xContext)
throw(LoadEnvException, css::uno::RuntimeException) throw(LoadEnvException, css::uno::RuntimeException)
: ThreadHelpBase( ) : ThreadHelpBase( )
, m_xSMGR (xSMGR) , m_xContext (xContext)
, m_pQuietInteraction( 0 ) , m_pQuietInteraction( 0 )
{ {
} }
@@ -144,7 +144,7 @@ LoadEnv::~LoadEnv()
css::uno::Reference< css::lang::XComponent > LoadEnv::loadComponentFromURL(const css::uno::Reference< css::frame::XComponentLoader >& xLoader, css::uno::Reference< css::lang::XComponent > LoadEnv::loadComponentFromURL(const css::uno::Reference< css::frame::XComponentLoader >& xLoader,
const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , const css::uno::Reference< css::uno::XComponentContext >& xContext ,
const OUString& sURL , const OUString& sURL ,
const OUString& sTarget, const OUString& sTarget,
sal_Int32 nFlags , sal_Int32 nFlags ,
@@ -157,7 +157,7 @@ css::uno::Reference< css::lang::XComponent > LoadEnv::loadComponentFromURL(const
try try
{ {
LoadEnv aEnv(xSMGR); LoadEnv aEnv(xContext);
aEnv.initializeLoading(sURL, aEnv.initializeLoading(sURL,
lArgs, lArgs,
@@ -268,7 +268,7 @@ void LoadEnv::initializeLoading(const OUString&
// parse it - because some following code require that // parse it - because some following code require that
m_aURL.Complete = sURL; m_aURL.Complete = sURL;
css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::getComponentContext(m_xSMGR))); css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(m_xContext));
xParser->parseStrict(m_aURL); xParser->parseStrict(m_aURL);
// BTW: Split URL and JumpMark ... // BTW: Split URL and JumpMark ...
@@ -294,7 +294,7 @@ void LoadEnv::initializeLoading(const OUString&
( m_lMediaDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_PREVIEW(), sal_False ) == sal_False ); ( m_lMediaDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_PREVIEW(), sal_False ) == sal_False );
initializeUIDefaults( initializeUIDefaults(
comphelper::getComponentContext(m_xSMGR), m_xContext,
m_lMediaDescriptor, m_lMediaDescriptor,
bUIMode, bUIMode,
&m_pQuietInteraction &m_pQuietInteraction
@@ -791,7 +791,7 @@ void LoadEnv::impl_detectTypeAndFilter()
// we can't use as an in/out parameter here. Copy it before and dont forget to // we can't use as an in/out parameter here. Copy it before and dont forget to
// update structure afterwards again! // update structure afterwards again!
css::uno::Sequence< css::beans::PropertyValue > lDescriptor = m_lMediaDescriptor.getAsConstPropertyValueList(); css::uno::Sequence< css::beans::PropertyValue > lDescriptor = m_lMediaDescriptor.getAsConstPropertyValueList();
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
// <- SAFE // <- SAFE
@@ -808,7 +808,7 @@ void LoadEnv::impl_detectTypeAndFilter()
return; return;
} }
css::uno::Reference< css::document::XTypeDetection > xDetect(xSMGR->createInstance(SERVICENAME_TYPEDETECTION), css::uno::UNO_QUERY); css::uno::Reference< css::document::XTypeDetection > xDetect( xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_TYPEDETECTION, xContext), css::uno::UNO_QUERY);
if (xDetect.is()) if (xDetect.is())
sType = xDetect->queryTypeByDescriptor(lDescriptor, sal_True); /*TODO should deep detection be able for enable/disable it from outside? */ sType = xDetect->queryTypeByDescriptor(lDescriptor, sal_True); /*TODO should deep detection be able for enable/disable it from outside? */
@@ -869,7 +869,7 @@ void LoadEnv::impl_detectTypeAndFilter()
sal_Bool bIsOwnTemplate = sal_False; sal_Bool bIsOwnTemplate = sal_False;
if (!sFilter.isEmpty()) if (!sFilter.isEmpty())
{ {
css::uno::Reference< css::container::XNameAccess > xFilterCont(xSMGR->createInstance(SERVICENAME_FILTERFACTORY), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::container::XNameAccess > xFilterCont(xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FILTERFACTORY, xContext), css::uno::UNO_QUERY_THROW);
try try
{ {
::comphelper::SequenceAsHashMap lFilterProps(xFilterCont->getByName(sFilter)); ::comphelper::SequenceAsHashMap lFilterProps(xFilterCont->getByName(sFilter));
@@ -910,7 +910,8 @@ sal_Bool LoadEnv::impl_handleContent()
css::util::URL aURL = m_aURL; css::util::URL aURL = m_aURL;
// get necessary container to query for a handler object // get necessary container to query for a handler object
css::uno::Reference< css::lang::XMultiServiceFactory > xFactory(m_xSMGR->createInstance(SERVICENAME_CONTENTHANDLERFACTORY), css::uno::UNO_QUERY); css::uno::Reference< css::lang::XMultiServiceFactory > xFactory(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_CONTENTHANDLERFACTORY, m_xContext), css::uno::UNO_QUERY);
css::uno::Reference< css::container::XContainerQuery > xQuery (xFactory , css::uno::UNO_QUERY); css::uno::Reference< css::container::XContainerQuery > xQuery (xFactory , css::uno::UNO_QUERY);
aReadLock.unlock(); aReadLock.unlock();
@@ -965,7 +966,7 @@ sal_Bool LoadEnv::impl_furtherDocsAllowed()
{ {
// SAFE -> // SAFE ->
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
// <- SAFE // <- SAFE
@@ -974,7 +975,7 @@ sal_Bool LoadEnv::impl_furtherDocsAllowed()
try try
{ {
css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey( css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
comphelper::getComponentContext(xSMGR), xContext,
OUString("org.openoffice.Office.Common/"), OUString("org.openoffice.Office.Common/"),
OUString("Misc"), OUString("Misc"),
OUString("MaxOpenDocuments"), OUString("MaxOpenDocuments"),
@@ -990,7 +991,7 @@ sal_Bool LoadEnv::impl_furtherDocsAllowed()
aVal >>= nMaxOpenDocuments; aVal >>= nMaxOpenDocuments;
css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::uno::Reference< css::frame::XFramesSupplier > xDesktop(
css::frame::Desktop::create( comphelper::getComponentContext(xSMGR)), css::frame::Desktop::create(xContext),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
FrameListAnalyzer aAnalyzer(xDesktop, FrameListAnalyzer aAnalyzer(xDesktop,
@@ -1193,7 +1194,7 @@ css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader()
{ {
try try
{ {
return m_xSMGR->createInstance(IMPLEMENTATIONNAME_GENERICFRAMELOADER); return m_xContext->getServiceManager()->createInstanceWithContext(IMPLEMENTATIONNAME_GENERICFRAMELOADER, m_xContext);
} }
catch(const css::uno::RuntimeException&) catch(const css::uno::RuntimeException&)
{ throw; } { throw; }
@@ -1210,7 +1211,7 @@ css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader()
throw LoadEnvException(LoadEnvException::ID_INVALID_MEDIADESCRIPTOR); throw LoadEnvException(LoadEnvException::ID_INVALID_MEDIADESCRIPTOR);
// try to locate any interested frame loader // try to locate any interested frame loader
css::uno::Reference< css::lang::XMultiServiceFactory > xLoaderFactory(m_xSMGR->createInstance(SERVICENAME_FRAMELOADERFACTORY), css::uno::UNO_QUERY); css::uno::Reference< css::lang::XMultiServiceFactory > xLoaderFactory(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FRAMELOADERFACTORY, m_xContext), css::uno::UNO_QUERY);
css::uno::Reference< css::container::XContainerQuery > xQuery (xLoaderFactory , css::uno::UNO_QUERY); css::uno::Reference< css::container::XContainerQuery > xQuery (xLoaderFactory , css::uno::UNO_QUERY);
aReadLock.unlock(); aReadLock.unlock();
@@ -1261,14 +1262,14 @@ void LoadEnv::impl_jumpToMark(const css::uno::Reference< css::frame::XFrame >& x
// SAFE -> // SAFE ->
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
// <- SAFE // <- SAFE
css::util::URL aCmd; css::util::URL aCmd;
aCmd.Complete = OUString(".uno:JumpToMark"); aCmd.Complete = OUString(".uno:JumpToMark");
css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::getComponentContext(m_xSMGR))); css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(xContext));
xParser->parseStrict(aCmd); xParser->parseStrict(aCmd);
css::uno::Reference< css::frame::XDispatch > xDispatcher = xProvider->queryDispatch(aCmd, SPECIALTARGET_SELF, 0); css::uno::Reference< css::frame::XDispatch > xDispatcher = xProvider->queryDispatch(aCmd, SPECIALTARGET_SELF, 0);
@@ -1313,7 +1314,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded()
// otherwise - iterate through the tasks of the desktop container // otherwise - iterate through the tasks of the desktop container
// to find out, which of them might contains the requested document // to find out, which of them might contains the requested document
css::uno::Reference< css::frame::XDesktop2 > xSupplier = css::frame::Desktop::create( comphelper::getComponentContext(m_xSMGR) ); css::uno::Reference< css::frame::XDesktop2 > xSupplier = css::frame::Desktop::create( m_xContext );
css::uno::Reference< css::container::XIndexAccess > xTaskList(xSupplier->getFrames() , css::uno::UNO_QUERY); css::uno::Reference< css::container::XIndexAccess > xTaskList(xSupplier->getFrames() , css::uno::UNO_QUERY);
if (!xTaskList.is()) if (!xTaskList.is())
@@ -1454,7 +1455,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchRecycleTarget()
if (m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_HIDDEN(), sal_False) == sal_True) if (m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_HIDDEN(), sal_False) == sal_True)
return css::uno::Reference< css::frame::XFrame >(); return css::uno::Reference< css::frame::XFrame >();
css::uno::Reference< css::frame::XFramesSupplier > xSupplier( css::frame::Desktop::create( comphelper::getComponentContext(m_xSMGR) ), css::uno::UNO_QUERY); css::uno::Reference< css::frame::XFramesSupplier > xSupplier( css::frame::Desktop::create( m_xContext ), css::uno::UNO_QUERY);
FrameListAnalyzer aTasksAnalyzer(xSupplier, css::uno::Reference< css::frame::XFrame >(), FrameListAnalyzer::E_BACKINGCOMPONENT); FrameListAnalyzer aTasksAnalyzer(xSupplier, css::uno::Reference< css::frame::XFrame >(), FrameListAnalyzer::E_BACKINGCOMPONENT);
if (aTasksAnalyzer.m_xBackingComponent.is()) if (aTasksAnalyzer.m_xBackingComponent.is())
{ {
@@ -1696,7 +1697,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X
{ {
// SAFE -> ---------------------------------- // SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR( m_xSMGR.get(), css::uno::UNO_QUERY ); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
// <- SAFE ---------------------------------- // <- SAFE ----------------------------------
@@ -1712,7 +1713,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X
{ {
css::uno::Any const a = css::uno::Any const a =
::comphelper::ConfigurationHelper::readDirectKey( ::comphelper::ConfigurationHelper::readDirectKey(
comphelper::getComponentContext(xSMGR), xContext,
OUString("org.openoffice.Office.Common/View"), OUString("org.openoffice.Office.Common/View"),
OUString("NewDocumentHandling"), OUString("NewDocumentHandling"),
OUString("ForceFocusAndToFront"), OUString("ForceFocusAndToFront"),
@@ -1776,7 +1777,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw
if (sFilter.isEmpty()) if (sFilter.isEmpty())
return; return;
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
// <- SAFE // <- SAFE
@@ -1785,14 +1786,14 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw
{ {
// retrieve the module name from the filter configuration // retrieve the module name from the filter configuration
css::uno::Reference< css::container::XNameAccess > xFilterCfg( css::uno::Reference< css::container::XNameAccess > xFilterCfg(
xSMGR->createInstance(SERVICENAME_FILTERFACTORY), xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FILTERFACTORY, xContext),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
::comphelper::SequenceAsHashMap lProps (xFilterCfg->getByName(sFilter)); ::comphelper::SequenceAsHashMap lProps (xFilterCfg->getByName(sFilter));
OUString sModule = lProps.getUnpackedValueOrDefault(FILTER_PROPNAME_DOCUMENTSERVICE, OUString()); OUString sModule = lProps.getUnpackedValueOrDefault(FILTER_PROPNAME_DOCUMENTSERVICE, OUString());
// get access to the configuration of this office module // get access to the configuration of this office module
css::uno::Reference< css::container::XNameAccess > xModuleCfg(::comphelper::ConfigurationHelper::openConfig( css::uno::Reference< css::container::XNameAccess > xModuleCfg(::comphelper::ConfigurationHelper::openConfig(
comphelper::getComponentContext(xSMGR), xContext,
PACKAGE_SETUP_MODULES, PACKAGE_SETUP_MODULES,
::comphelper::ConfigurationHelper::E_READONLY), ::comphelper::ConfigurationHelper::E_READONLY),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);

View File

@@ -459,7 +459,7 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
m_xFrame = xFrame; m_xFrame = xFrame;
// establish drag&drop mode // establish drag&drop mode
::framework::DropTargetListener* pDropListener = new ::framework::DropTargetListener(m_xSMGR, m_xFrame); ::framework::DropTargetListener* pDropListener = new ::framework::DropTargetListener( comphelper::getComponentContext(m_xSMGR), m_xFrame);
m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >(static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY); m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >(static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY);
css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) ); css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) );

View File

@@ -137,14 +137,14 @@ DEFINE_INIT_SERVICE ( Desktop,
// We hold member as reference ... not as pointer too! // We hold member as reference ... not as pointer too!
// Attention: We share our frame container with this helper. Container is threadsafe himself ... So I think we can do that. // Attention: We share our frame container with this helper. Container is threadsafe himself ... So I think we can do that.
// But look on dispose() for right order of deinitialization. // But look on dispose() for right order of deinitialization.
OFrames* pFramesHelper = new OFrames( m_xFactory, this, &m_aChildTaskContainer ); OFrames* pFramesHelper = new OFrames( this, &m_aChildTaskContainer );
m_xFramesHelper = css::uno::Reference< css::frame::XFrames >( static_cast< ::cppu::OWeakObject* >(pFramesHelper), css::uno::UNO_QUERY ); m_xFramesHelper = css::uno::Reference< css::frame::XFrames >( static_cast< ::cppu::OWeakObject* >(pFramesHelper), css::uno::UNO_QUERY );
//------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------
// Initialize a new dispatchhelper-object to handle dispatches. // Initialize a new dispatchhelper-object to handle dispatches.
// We use these helper as slave for our interceptor helper ... not directly! // We use these helper as slave for our interceptor helper ... not directly!
// But he is event listener on THIS instance! // But he is event listener on THIS instance!
DispatchProvider* pDispatchHelper = new DispatchProvider( m_xFactory, this ); DispatchProvider* pDispatchHelper = new DispatchProvider( comphelper::getComponentContext(m_xFactory), this );
css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( static_cast< ::cppu::OWeakObject* >(pDispatchHelper), css::uno::UNO_QUERY ); css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( static_cast< ::cppu::OWeakObject* >(pDispatchHelper), css::uno::UNO_QUERY );
//------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------
@@ -648,7 +648,7 @@ css::uno::Reference< css::lang::XComponent > SAL_CALL Desktop::loadComponentFrom
aReadLock.unlock(); aReadLock.unlock();
RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, "PERFORMANCE - Desktop::loadComponentFromURL()" ); RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, "PERFORMANCE - Desktop::loadComponentFromURL()" );
return LoadEnv::loadComponentFromURL(xThis, xSMGR, sURL, sTargetFrameName, nSearchFlags, lArguments); return LoadEnv::loadComponentFromURL(xThis, comphelper::getComponentContext(xSMGR), sURL, sTargetFrameName, nSearchFlags, lArguments);
} }
/*-************************************************************************************************************//** /*-************************************************************************************************************//**
@@ -1050,7 +1050,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Desktop::findFrame( const OUS
//----------------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------------
if ( sTargetFrameName==SPECIALTARGET_BLANK ) if ( sTargetFrameName==SPECIALTARGET_BLANK )
{ {
TaskCreator aCreator(xFactory); TaskCreator aCreator( comphelper::getComponentContext(xFactory) );
xTarget = aCreator.createTask(sTargetFrameName,sal_False); xTarget = aCreator.createTask(sTargetFrameName,sal_False);
} }
@@ -1148,7 +1148,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Desktop::findFrame( const OUS
(nSearchFlags & css::frame::FrameSearchFlag::CREATE) (nSearchFlags & css::frame::FrameSearchFlag::CREATE)
) )
{ {
TaskCreator aCreator(xFactory); TaskCreator aCreator( comphelper::getComponentContext(xFactory) );
xTarget = aCreator.createTask(sTargetFrameName,sal_False); xTarget = aCreator.createTask(sTargetFrameName,sal_False);
} }
} }

View File

@@ -146,7 +146,7 @@ DEFINE_XTYPEPROVIDER_21 ( Frame
css::frame::XTitleChangeBroadcaster css::frame::XTitleChangeBroadcaster
) )
DEFINE_XSERVICEINFO_MULTISERVICE ( Frame , DEFINE_XSERVICEINFO_MULTISERVICE_2 ( Frame ,
::cppu::OWeakObject , ::cppu::OWeakObject ,
"com.sun.star.frame.Frame" , "com.sun.star.frame.Frame" ,
OUString("com.sun.star.comp.framework.Frame") OUString("com.sun.star.comp.framework.Frame")
@@ -165,11 +165,11 @@ DEFINE_INIT_SERVICE ( Frame,
// Initialize a new dispatchhelper-object to handle dispatches. // Initialize a new dispatchhelper-object to handle dispatches.
// We use these helper as slave for our interceptor helper ... not directly! // We use these helper as slave for our interceptor helper ... not directly!
// But he is event listener on THIS instance! // But he is event listener on THIS instance!
DispatchProvider* pDispatchHelper = new DispatchProvider( m_xFactory, this ); DispatchProvider* pDispatchHelper = new DispatchProvider( m_xContext, this );
css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( static_cast< ::cppu::OWeakObject* >(pDispatchHelper), css::uno::UNO_QUERY ); css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( static_cast< ::cppu::OWeakObject* >(pDispatchHelper), css::uno::UNO_QUERY );
//------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------
DispatchInformationProvider* pInfoHelper = new DispatchInformationProvider(m_xFactory, this); DispatchInformationProvider* pInfoHelper = new DispatchInformationProvider(m_xContext, this);
m_xDispatchInfoHelper = css::uno::Reference< css::frame::XDispatchInformationProvider >( static_cast< ::cppu::OWeakObject* >(pInfoHelper), css::uno::UNO_QUERY ); m_xDispatchInfoHelper = css::uno::Reference< css::frame::XDispatchInformationProvider >( static_cast< ::cppu::OWeakObject* >(pInfoHelper), css::uno::UNO_QUERY );
//------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------
@@ -185,13 +185,13 @@ DEFINE_INIT_SERVICE ( Frame,
// We hold member as reference ... not as pointer too! // We hold member as reference ... not as pointer too!
// Attention: We share our frame container with this helper. Container is threadsafe himself ... So I think we can do that. // Attention: We share our frame container with this helper. Container is threadsafe himself ... So I think we can do that.
// But look on dispose() for right order of deinitialization. // But look on dispose() for right order of deinitialization.
OFrames* pFramesHelper = new OFrames( m_xFactory, this, &m_aChildFrameContainer ); OFrames* pFramesHelper = new OFrames( this, &m_aChildFrameContainer );
m_xFramesHelper = css::uno::Reference< css::frame::XFrames >( static_cast< ::cppu::OWeakObject* >(pFramesHelper), css::uno::UNO_QUERY ); m_xFramesHelper = css::uno::Reference< css::frame::XFrames >( static_cast< ::cppu::OWeakObject* >(pFramesHelper), css::uno::UNO_QUERY );
//------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------
// Initialize a the drop target listener. // Initialize a the drop target listener.
// We hold member as reference ... not as pointer too! // We hold member as reference ... not as pointer too!
DropTargetListener* pDropListener = new DropTargetListener( m_xFactory, this ); DropTargetListener* pDropListener = new DropTargetListener( m_xContext, this );
m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >( static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY ); m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >( static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY );
// Safe impossible cases // Safe impossible cases
@@ -208,7 +208,7 @@ DEFINE_INIT_SERVICE ( Frame,
//------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------
// Create an initial layout manager // Create an initial layout manager
// Create layout manager and connect it to the newly created frame // Create layout manager and connect it to the newly created frame
m_xLayoutManager = css::uno::Reference< css::frame::XLayoutManager >(m_xFactory->createInstance(SERVICENAME_LAYOUTMANAGER), css::uno::UNO_QUERY); m_xLayoutManager.set(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_LAYOUTMANAGER, m_xContext), css::uno::UNO_QUERY);
//------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------
// set information about all supported properties at the base class helper PropertySetHelper // set information about all supported properties at the base class helper PropertySetHelper
@@ -231,22 +231,21 @@ DEFINE_INIT_SERVICE ( Frame,
@seealso method DEFINE_INIT_SERVICE() @seealso method DEFINE_INIT_SERVICE()
@param "xFactory" is the multi service manager, which create this instance. @param xContext is the multi service manager, which creates this instance.
The value must be different from NULL! The value must be different from NULL!
@return - @return -
@onerror ASSERT in debug version or nothing in relaese version. @onerror ASSERT in debug version or nothing in relaese version.
*//*-*****************************************************************************************************/ *//*-*****************************************************************************************************/
Frame::Frame( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ) Frame::Frame( const css::uno::Reference< css::uno::XComponentContext >& xContext )
: ThreadHelpBase ( &Application::GetSolarMutex() ) : ThreadHelpBase ( &Application::GetSolarMutex() )
, TransactionBase ( ) , TransactionBase ( )
, PropertySetHelper ( xFactory, , PropertySetHelper ( &m_aLock,
&m_aLock,
&m_aTransactionManager, &m_aTransactionManager,
sal_False) // sal_False => dont release shared mutex on calling us! sal_False) // sal_False => dont release shared mutex on calling us!
, ::cppu::OWeakObject ( ) , ::cppu::OWeakObject ( )
// init member // init member
, m_xFactory ( xFactory ) , m_xContext ( xContext )
, m_aListenerContainer ( m_aLock.getShareableOslMutex() ) , m_aListenerContainer ( m_aLock.getShareableOslMutex() )
, m_xParent ( ) , m_xParent ( )
, m_xContainerWindow ( ) , m_xContainerWindow ( )
@@ -264,7 +263,7 @@ Frame::Frame( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFac
, m_aChildFrameContainer ( ) , m_aChildFrameContainer ( )
{ {
// Check incoming parameter to avoid against wrong initialization. // Check incoming parameter to avoid against wrong initialization.
LOG_ASSERT2( implcp_ctor( xFactory ), "Frame::Frame()", "Invalid parameter detected!" ) LOG_ASSERT2( implcp_ctor( xContext ), "Frame::Frame()", "Invalid parameter detected!" )
/* Please have a look on "@attentions" of description before! */ /* Please have a look on "@attentions" of description before! */
} }
@@ -322,10 +321,10 @@ css::uno::Reference< css::lang::XComponent > SAL_CALL Frame::loadComponentFromUR
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::frame::XComponentLoader > xThis(static_cast< css::frame::XComponentLoader* >(this), css::uno::UNO_QUERY); css::uno::Reference< css::frame::XComponentLoader > xThis(static_cast< css::frame::XComponentLoader* >(this), css::uno::UNO_QUERY);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xFactory; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
return LoadEnv::loadComponentFromURL(xThis, xSMGR, sURL, sTargetFrameName, nSearchFlags, lArguments); return LoadEnv::loadComponentFromURL(xThis, xContext, sURL, sTargetFrameName, nSearchFlags, lArguments);
} }
/*-****************************************************************************************************//** /*-****************************************************************************************************//**
@@ -554,8 +553,8 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >&
if (pWindow && pWindow->IsVisible()) if (pWindow && pWindow->IsVisible())
m_bIsHidden = sal_False; m_bIsHidden = sal_False;
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xFactory; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
css::uno::Reference< css::frame::XLayoutManager > xLayoutManager = m_xLayoutManager; css::uno::Reference< css::frame::XLayoutManager > xLayoutManager = m_xLayoutManager;
// Release lock ... because we call some impl methods, which are threadsafe by himself. // Release lock ... because we call some impl methods, which are threadsafe by himself.
// If we hold this lock - we will produce our own deadlock! // If we hold this lock - we will produce our own deadlock!
@@ -568,7 +567,7 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >&
// create progress helper // create progress helper
css::uno::Reference< css::frame::XFrame > xThis (static_cast< css::frame::XFrame* >(this) , css::uno::UNO_QUERY_THROW); css::uno::Reference< css::frame::XFrame > xThis (static_cast< css::frame::XFrame* >(this) , css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::task::XStatusIndicatorFactory > xIndicatorFactory = css::uno::Reference< css::task::XStatusIndicatorFactory > xIndicatorFactory =
css::task::StatusIndicatorFactory::createWithFrame(comphelper::getComponentContext(xSMGR), xThis, sal_False/*DisableReschedule*/, sal_True/*AllowParentShow*/ ); css::task::StatusIndicatorFactory::createWithFrame(xContext, xThis, sal_False/*DisableReschedule*/, sal_True/*AllowParentShow*/ );
// SAFE -> ---------------------------------- // SAFE -> ----------------------------------
aWriteLock.lock(); aWriteLock.lock();
@@ -582,10 +581,10 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >&
impl_enablePropertySet(); impl_enablePropertySet();
m_pWindowCommandDispatch = new WindowCommandDispatch(xSMGR, this); m_pWindowCommandDispatch = new WindowCommandDispatch(xContext, this);
// Initialize title functionality // Initialize title functionality
TitleHelper* pTitleHelper = new TitleHelper( comphelper::getComponentContext(xSMGR) ); TitleHelper* pTitleHelper = new TitleHelper( xContext );
m_xTitleHelper = css::uno::Reference< css::frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pTitleHelper), css::uno::UNO_QUERY_THROW); m_xTitleHelper = css::uno::Reference< css::frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pTitleHelper), css::uno::UNO_QUERY_THROW);
pTitleHelper->setOwner(xThis); pTitleHelper->setOwner(xThis);
} }
@@ -769,7 +768,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const OUStr
/* SAFE { */ /* SAFE { */
ReadGuard aReadLock( m_aLock ); ReadGuard aReadLock( m_aLock );
css::uno::Reference< css::frame::XFrame > xParent ( m_xParent, css::uno::UNO_QUERY ); css::uno::Reference< css::frame::XFrame > xParent ( m_xParent, css::uno::UNO_QUERY );
css::uno::Reference< css::lang::XMultiServiceFactory > xFactory = m_xFactory; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
sal_Bool bIsTopFrame = m_bIsFrameTop; sal_Bool bIsTopFrame = m_bIsFrameTop;
sal_Bool bIsTopWindow = WindowHelper::isTopWindow(m_xContainerWindow); sal_Bool bIsTopWindow = WindowHelper::isTopWindow(m_xContainerWindow);
aReadLock.unlock(); aReadLock.unlock();
@@ -782,7 +781,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const OUStr
//----------------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------------
if ( sTargetFrameName==SPECIALTARGET_BLANK ) if ( sTargetFrameName==SPECIALTARGET_BLANK )
{ {
TaskCreator aCreator(xFactory); TaskCreator aCreator(xContext);
xTarget = aCreator.createTask(sTargetFrameName,sal_False); xTarget = aCreator.createTask(sTargetFrameName,sal_False);
} }
@@ -989,7 +988,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const OUStr
(nSearchFlags & css::frame::FrameSearchFlag::CREATE) (nSearchFlags & css::frame::FrameSearchFlag::CREATE)
) )
{ {
TaskCreator aCreator(xFactory); TaskCreator aCreator(xContext);
xTarget = aCreator.createTask(sTargetFrameName,sal_False); xTarget = aCreator.createTask(sTargetFrameName,sal_False);
} }
} }
@@ -1936,7 +1935,7 @@ void SAL_CALL Frame::dispose() throw( css::uno::RuntimeException )
// Release some other references. // Release some other references.
// This calls should be easy ... I hope it :-) // This calls should be easy ... I hope it :-)
m_xDispatchHelper.clear(); m_xDispatchHelper.clear();
m_xFactory.clear(); m_xContext.clear();
m_xDropTargetListener.clear(); m_xDropTargetListener.clear();
m_xDispatchRecorderSupplier.clear(); m_xDispatchRecorderSupplier.clear();
m_xLayoutManager.clear(); m_xLayoutManager.clear();
@@ -2347,13 +2346,13 @@ void SAL_CALL Frame::windowClosing( const css::lang::EventObject& ) throw( css::
/* SAFE */ /* SAFE */
ReadGuard aReadLock( m_aLock ); ReadGuard aReadLock( m_aLock );
css::uno::Reference< css::lang::XMultiServiceFactory > xFactory = m_xFactory; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock(); aReadLock.unlock();
/* SAFE */ /* SAFE */
css::util::URL aURL; css::util::URL aURL;
aURL.Complete = DECLARE_ASCII(".uno:CloseFrame"); aURL.Complete = DECLARE_ASCII(".uno:CloseFrame");
css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::getComponentContext(xFactory))); css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(xContext));
xParser->parseStrict(aURL); xParser->parseStrict(aURL);
css::uno::Reference< css::frame::XDispatch > xCloser = queryDispatch(aURL, SPECIALTARGET_SELF, 0); css::uno::Reference< css::frame::XDispatch > xCloser = queryDispatch(aURL, SPECIALTARGET_SELF, 0);
@@ -2394,7 +2393,7 @@ void SAL_CALL Frame::windowShown( const css::lang::EventObject& ) throw(css::uno
/* SAFE { */ /* SAFE { */
ReadGuard aReadLock(m_aLock); ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::frame::XDesktop > xDesktopCheck( m_xParent, css::uno::UNO_QUERY ); css::uno::Reference< css::frame::XDesktop > xDesktopCheck( m_xParent, css::uno::UNO_QUERY );
css::uno::Reference< css::lang::XMultiServiceFactory > xFactory = m_xFactory; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
m_bIsHidden = sal_False; m_bIsHidden = sal_False;
aReadLock.unlock(); aReadLock.unlock();
/* } SAFE */ /* } SAFE */
@@ -2413,7 +2412,7 @@ void SAL_CALL Frame::windowShown( const css::lang::EventObject& ) throw(css::uno
if (bMustBeTriggered) if (bMustBeTriggered)
{ {
css::uno::Reference< css::task::XJobExecutor > xExecutor css::uno::Reference< css::task::XJobExecutor > xExecutor
= css::task::JobExecutor::create( comphelper::getComponentContext(xFactory) ); = css::task::JobExecutor::create( xContext );
xExecutor->trigger( DECLARE_ASCII("onFirstVisibleTask") ); xExecutor->trigger( DECLARE_ASCII("onFirstVisibleTask") );
} }
} }
@@ -2935,7 +2934,7 @@ void Frame::implts_startWindowListening()
// Make snapshot of necessary member! // Make snapshot of necessary member!
ReadGuard aReadLock( m_aLock ); ReadGuard aReadLock( m_aLock );
css::uno::Reference< css::awt::XWindow > xContainerWindow = m_xContainerWindow ; css::uno::Reference< css::awt::XWindow > xContainerWindow = m_xContainerWindow ;
css::uno::Reference< css::lang::XMultiServiceFactory > xFactory = m_xFactory ; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > xDragDropListener = m_xDropTargetListener; css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > xDragDropListener = m_xDropTargetListener;
css::uno::Reference< css::awt::XWindowListener > xWindowListener ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); css::uno::Reference< css::awt::XWindowListener > xWindowListener ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY );
css::uno::Reference< css::awt::XFocusListener > xFocusListener ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); css::uno::Reference< css::awt::XFocusListener > xFocusListener ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY );
@@ -2953,7 +2952,7 @@ void Frame::implts_startWindowListening()
{ {
xTopWindow->addTopWindowListener( xTopWindowListener ); xTopWindow->addTopWindowListener( xTopWindowListener );
css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xFactory) ); css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( xContext );
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget( xContainerWindow ); css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget( xContainerWindow );
if( xDropTarget.is() == sal_True ) if( xDropTarget.is() == sal_True )
{ {
@@ -2975,7 +2974,7 @@ void Frame::implts_stopWindowListening()
// Make snapshot of necessary member! // Make snapshot of necessary member!
ReadGuard aReadLock( m_aLock ); ReadGuard aReadLock( m_aLock );
css::uno::Reference< css::awt::XWindow > xContainerWindow = m_xContainerWindow ; css::uno::Reference< css::awt::XWindow > xContainerWindow = m_xContainerWindow ;
css::uno::Reference< css::lang::XMultiServiceFactory > xFactory = m_xFactory ; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext ;
css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > xDragDropListener = m_xDropTargetListener; css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > xDragDropListener = m_xDropTargetListener;
css::uno::Reference< css::awt::XWindowListener > xWindowListener ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); css::uno::Reference< css::awt::XWindowListener > xWindowListener ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY );
css::uno::Reference< css::awt::XFocusListener > xFocusListener ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); css::uno::Reference< css::awt::XFocusListener > xFocusListener ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY );
@@ -2993,7 +2992,7 @@ void Frame::implts_stopWindowListening()
{ {
xTopWindow->removeTopWindowListener( xTopWindowListener ); xTopWindow->removeTopWindowListener( xTopWindowListener );
css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xFactory) ); css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( xContext );
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget( xContainerWindow ); css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget( xContainerWindow );
if( xDropTarget.is() == sal_True ) if( xDropTarget.is() == sal_True )
{ {
@@ -3178,11 +3177,11 @@ void Frame::impl_checkMenuCloser()
//***************************************************************************************************************** //*****************************************************************************************************************
// We don't accept null pointer or references! // We don't accept null pointer or references!
sal_Bool Frame::implcp_ctor( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ) sal_Bool Frame::implcp_ctor( const css::uno::Reference< css::uno::XComponentContext >& xContext )
{ {
return ( return (
( &xFactory == NULL ) || ( &xContext == NULL ) ||
( xFactory.is() == sal_False ) ( xContext.is() == sal_False )
); );
} }

View File

@@ -80,8 +80,7 @@ TabWindowService::TabWindowService( const css::uno::Reference< css::lang::XMulti
// baseclasses and then members. And we need the mutex for other baseclasses !!! // baseclasses and then members. And we need the mutex for other baseclasses !!!
: ThreadHelpBase ( &Application::GetSolarMutex() ) : ThreadHelpBase ( &Application::GetSolarMutex() )
, TransactionBase ( ) , TransactionBase ( )
, PropertySetHelper ( xFactory , , PropertySetHelper ( &m_aLock ,
&m_aLock ,
&m_aTransactionManager , &m_aTransactionManager ,
sal_False ) // sal_False => dont release shared mutex on calling us! sal_False ) // sal_False => dont release shared mutex on calling us!
, OWeakObject ( ) , OWeakObject ( )