summaryrefslogtreecommitdiff
path: root/filter/source/config/cache
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 /filter/source/config/cache
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 'filter/source/config/cache')
-rw-r--r--filter/source/config/cache/filtercache.cxx3
-rw-r--r--filter/source/config/cache/lateinitlistener.cxx7
-rw-r--r--filter/source/config/cache/lateinitlistener.hxx10
3 files changed, 9 insertions, 11 deletions
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index 36f97e5cfc43..b7c3474259a7 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/document/CorruptedFilterConfigurationException.hpp>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/sequenceasvector.hxx>
#include <comphelper/locale.hxx>
#include <comphelper/processfactory.hxx>
@@ -249,7 +250,7 @@ void FilterCache::load(EFillState eRequired,
// and starts a thread, which calls loadAll() at this filter cache.
// Note: Its not a leak to create this listener with new here.
// It kills itself after working!
- /* LateInitListener* pLateInit = */ new LateInitListener(m_xSMGR);
+ /* LateInitListener* pLateInit = */ new LateInitListener(comphelper::ComponentContext(m_xSMGR).getUNOContext());
}
// ------------------------------------------
diff --git a/filter/source/config/cache/lateinitlistener.cxx b/filter/source/config/cache/lateinitlistener.cxx
index 21c4c808efa4..517b1f27e299 100644
--- a/filter/source/config/cache/lateinitlistener.cxx
+++ b/filter/source/config/cache/lateinitlistener.cxx
@@ -34,6 +34,8 @@
#include "lateinitlistener.hxx"
#include "lateinitthread.hxx"
+#include <com/sun/star/frame/GlobalEventBroadcaster.hpp>
+
namespace filter{
namespace config{
@@ -43,9 +45,8 @@ namespace css = ::com::sun::star;
-LateInitListener::LateInitListener(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+LateInitListener::LateInitListener(const css::uno::Reference< css::uno::XComponentContext >& rxContext)
: BaseLock( )
- , m_xSMGR (xSMGR)
{
// important to do so ...
// Otherwise the temp. reference to ourselves
@@ -53,7 +54,7 @@ LateInitListener::LateInitListener(const css::uno::Reference< css::lang::XMultiS
osl_atomic_increment( &m_refCount );
m_xBroadcaster = css::uno::Reference< css::document::XEventBroadcaster >(
- m_xSMGR->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.GlobalEventBroadcaster" ))),
+ css::frame::GlobalEventBroadcaster::create(rxContext),
css::uno::UNO_QUERY_THROW);
m_xBroadcaster->addEventListener(static_cast< css::document::XEventListener* >(this));
diff --git a/filter/source/config/cache/lateinitlistener.hxx b/filter/source/config/cache/lateinitlistener.hxx
index 2549dfbdc9f1..b2e49eb0c707 100644
--- a/filter/source/config/cache/lateinitlistener.hxx
+++ b/filter/source/config/cache/lateinitlistener.hxx
@@ -52,10 +52,6 @@ class LateInitListener : public BaseLock // must be the first one to guarantee r
private:
- /** @short reference to an uno service manager, which can be used
- to create own needed services. */
- css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
-
/** @short reference to the global event broadcaster, which is usde to find
out, when the first office document was opened successfully. */
css::uno::Reference< css::document::XEventBroadcaster > m_xBroadcaster;
@@ -75,11 +71,11 @@ class LateInitListener : public BaseLock // must be the first one to guarantee r
on the global event broadcaster to get the information, when
loading of the first document was finished.
- @param xSMGR
- reference to a service manager, which can be used to create
+ @param rxContext
+ reference to a component context, which can be used to create
own needed uno services.
*/
- LateInitListener(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
+ LateInitListener(const css::uno::Reference< css::uno::XComponentContext >& rxContext);
//---------------------------------------