diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-07 15:14:55 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-27 10:30:42 +0200 |
commit | cd693ff598bbabba66d8ca353a32bcbd81a5b12b (patch) | |
tree | 525e9fe8fdd44e6ccba4f61e999aeb1332d2b896 /cui/source/customize/eventdlg.cxx | |
parent | 526e007bb6340e2c4a2cb96f5612ba268fcd5583 (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 'cui/source/customize/eventdlg.cxx')
-rw-r--r-- | cui/source/customize/eventdlg.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index 8887adc4bbec..55381f5cefe1 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -29,6 +29,7 @@ #include <svtools/svmedit.hxx> #include <tools/diagnose_ex.h> #include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/frame/GlobalEventBroadcaster.hpp> #include <com/sun/star/frame/XModuleManager.hpp> #include <comphelper/processfactory.hxx> @@ -91,20 +92,15 @@ SvxEventConfigPage::SvxEventConfigPage( Window *pParent, const SfxItemSet& rSet, uno::Reference< document::XEventsSupplier > xSupplier; xSupplier = uno::Reference< document::XEventsSupplier > ( - ::comphelper::getProcessServiceFactory()->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.frame.GlobalEventBroadcaster" )) ), - uno::UNO_QUERY ); + frame::GlobalEventBroadcaster::create(::comphelper::getProcessComponentContext()), + uno::UNO_QUERY_THROW ); sal_uInt16 nPos(0); - if ( xSupplier.is() ) - { - m_xAppEvents = xSupplier->getEvents(); - nPos = aSaveInListBox.InsertEntry( - utl::ConfigManager::getProductName() ); - aSaveInListBox.SetEntryData( nPos, new bool(true) ); - aSaveInListBox.SelectEntryPos( nPos, sal_True ); - } + m_xAppEvents = xSupplier->getEvents(); + nPos = aSaveInListBox.InsertEntry( + utl::ConfigManager::getProductName() ); + aSaveInListBox.SetEntryData( nPos, new bool(true) ); + aSaveInListBox.SelectEntryPos( nPos, sal_True ); } // ----------------------------------------------------------------------- |