summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-09-07 15:14:55 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-27 10:30:42 +0200
commitcd693ff598bbabba66d8ca353a32bcbd81a5b12b (patch)
tree525e9fe8fdd44e6ccba4f61e999aeb1332d2b896 /ucb
parent526e007bb6340e2c4a2cb96f5612ba268fcd5583 (diff)
fdo#46808, Adapt frame::GlobalEventBroadcaster UNO service to new style
Create a merged XGlobalEventBroadcaster interface for this service to implement. Which is backwards-compatible, but does not require creating a new service. Also add two interfaces to the IDL, which the service already implemented, and existing client code already used. Change-Id: Ib7a9a30c0e50146ef621f3fe5227f8aad3190516
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/tdoc/tdoc_docmgr.cxx18
-rw-r--r--ucb/source/ucp/tdoc/tdoc_docmgr.hxx6
-rw-r--r--ucb/source/ucp/tdoc/tdoc_provider.cxx3
3 files changed, 12 insertions, 15 deletions
diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
index 87532955d52a..c4e4bd6b67b2 100644
--- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
@@ -39,12 +39,12 @@
#include "comphelper/documentinfo.hxx"
#include "comphelper/namedvaluecollection.hxx"
-#include "comphelper/processfactory.hxx"
#include "com/sun/star/awt/XTopWindow.hpp"
#include "com/sun/star/beans/XPropertySet.hpp"
#include "com/sun/star/container/XEnumerationAccess.hpp"
#include "com/sun/star/document/XStorageBasedDocument.hpp"
+#include "com/sun/star/frame/GlobalEventBroadcaster.hpp"
#include "com/sun/star/frame/XStorable.hpp"
#include "com/sun/star/frame/ModuleManager.hpp"
#include "com/sun/star/lang/DisposedException.hpp"
@@ -112,10 +112,10 @@ void SAL_CALL OfficeDocumentsManager::OfficeDocumentsCloseListener::disposing(
//=========================================================================
OfficeDocumentsManager::OfficeDocumentsManager(
- const uno::Reference< lang::XMultiServiceFactory > & xSMgr,
+ const uno::Reference< uno::XComponentContext > & rxContext,
OfficeDocumentsEventListener * pDocEventListener )
-: m_xSMgr( xSMgr ),
- m_xDocEvtNotifier( createDocumentEventNotifier( xSMgr ) ),
+: m_xContext( rxContext ),
+ m_xDocEvtNotifier( createDocumentEventNotifier( rxContext ) ),
m_pDocEventListener( pDocEventListener ),
m_xDocCloseListener( new OfficeDocumentsCloseListener( this ) )
{
@@ -460,15 +460,12 @@ void SAL_CALL OfficeDocumentsManager::disposing(
// static
uno::Reference< document::XEventBroadcaster >
OfficeDocumentsManager::createDocumentEventNotifier(
- const uno::Reference< lang::XMultiServiceFactory >& rXSMgr )
+ const uno::Reference< uno::XComponentContext >& rxContext )
{
uno::Reference< uno::XInterface > xIfc;
try
{
- xIfc = rXSMgr->createInstance(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.frame.GlobalEventBroadcaster" ) ) );
+ xIfc = frame::GlobalEventBroadcaster::create(rxContext);
}
catch ( uno::Exception const & )
{
@@ -702,8 +699,7 @@ bool OfficeDocumentsManager::isBasicIDE(
{
try
{
- m_xModuleMgr = frame::ModuleManager::create(
- comphelper::getComponentContext(m_xSMgr));
+ m_xModuleMgr = frame::ModuleManager::create( m_xContext );
}
catch ( uno::Exception const & )
{
diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.hxx b/ucb/source/ucp/tdoc/tdoc_docmgr.hxx
index ff1a07e885fe..3ba30a4a7e91 100644
--- a/ucb/source/ucp/tdoc/tdoc_docmgr.hxx
+++ b/ucb/source/ucp/tdoc/tdoc_docmgr.hxx
@@ -123,7 +123,7 @@ namespace tdoc_ucp {
public:
OfficeDocumentsManager(
const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > & xSMgr,
+ com::sun::star::uno::XComponentContext > & rxContext,
OfficeDocumentsEventListener * pDocEventListener );
virtual ~OfficeDocumentsManager();
@@ -162,7 +162,7 @@ namespace tdoc_ucp {
com::sun::star::document::XEventBroadcaster >
createDocumentEventNotifier(
const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
+ com::sun::star::uno::XComponentContext >& rxContext );
void buildDocumentsList();
@@ -193,7 +193,7 @@ namespace tdoc_ucp {
osl::Mutex m_aMtx;
com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ com::sun::star::uno::XComponentContext > m_xContext;
com::sun::star::uno::Reference<
com::sun::star::document::XEventBroadcaster > m_xDocEvtNotifier;
com::sun::star::uno::Reference<
diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx
index be5a4f1920fb..b2f06d575477 100644
--- a/ucb/source/ucp/tdoc/tdoc_provider.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx
@@ -38,6 +38,7 @@
#include "com/sun/star/container/XNameAccess.hpp"
#include "com/sun/star/embed/XStorage.hpp"
+#include "comphelper/componentcontext.hxx"
#include "ucbhelper/contentidentifier.hxx"
#include "tdoc_provider.hxx"
@@ -60,7 +61,7 @@ using namespace tdoc_ucp;
ContentProvider::ContentProvider(
const uno::Reference< lang::XMultiServiceFactory >& xSMgr )
: ::ucbhelper::ContentProviderImplHelper( xSMgr ),
- m_xDocsMgr( new OfficeDocumentsManager( xSMgr, this ) ),
+ m_xDocsMgr( new OfficeDocumentsManager( comphelper::ComponentContext(xSMgr).getUNOContext(), this ) ),
m_xStgElemFac( new StorageElementFactory( xSMgr, m_xDocsMgr ) )
{
}