From cd693ff598bbabba66d8ca353a32bcbd81a5b12b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 7 Sep 2012 15:14:55 +0200 Subject: 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 --- cui/source/customize/eventdlg.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'cui/source/customize') 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 #include #include +#include #include #include @@ -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 ); } // ----------------------------------------------------------------------- -- cgit v1.2.3