Kaydet (Commit) 9b63e4e6 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Stephan Bergmann

fdo#46808, use service constructor for frame::DispatchRecorderSupplier

üst ec4a5ba7
......@@ -49,7 +49,6 @@ namespace framework{
#define SERVICENAME_CONTENTHANDLERFACTORY DECLARE_ASCII("com.sun.star.frame.ContentHandlerFactory" )
#define SERVICENAME_STATUSINDICATORFACTORY DECLARE_ASCII("com.sun.star.task.StatusIndicatorFactory" )
#define SERVICENAME_JOB DECLARE_ASCII("com.sun.star.task.Job" )
#define SERVICENAME_DISPATCHRECORDERSUPPLIER DECLARE_ASCII("com.sun.star.frame.DispatchRecorderSupplier" )
#define SERVICENAME_DISPATCHRECORDER DECLARE_ASCII("com.sun.star.frame.DispatchRecorder" )
#define SERVICENAME_PROTOCOLHANDLER DECLARE_ASCII("com.sun.star.frame.ProtocolHandler" )
#define SERVICENAME_PATHSETTINGS DECLARE_ASCII("com.sun.star.util.PathSettings" )
......
......@@ -47,7 +47,7 @@ DEFINE_XTYPEPROVIDER_3(
DEFINE_XSERVICEINFO_MULTISERVICE(
DispatchRecorderSupplier,
::cppu::OWeakObject,
SERVICENAME_DISPATCHRECORDERSUPPLIER,
DECLARE_ASCII("com.sun.star.frame.DispatchRecorderSupplier"),
IMPLEMENTATIONNAME_DISPATCHRECORDERSUPPLIER)
DEFINE_INIT_SERVICE(
......
......@@ -23,6 +23,7 @@
#include <sfx2/infobar.hxx>
#include <sfx2/viewfrm.hxx>
#include <com/sun/star/document/MacroExecMode.hpp>
#include <com/sun/star/frame/DispatchRecorderSupplier.hpp>
#include <com/sun/star/frame/XLoadable.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
......@@ -2833,14 +2834,14 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xFactory(
::comphelper::getProcessServiceFactory(),
com::sun::star::uno::UNO_QUERY);
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext(
::comphelper::getProcessComponentContext());
xRecorder = com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder >(
xFactory->createInstance(rtl::OUString("com.sun.star.frame.DispatchRecorder")),
com::sun::star::uno::UNO_QUERY);
xSupplier = com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorderSupplier >(
xFactory->createInstance(rtl::OUString("com.sun.star.frame.DispatchRecorderSupplier")),
com::sun::star::uno::UNO_QUERY);
xSupplier = com::sun::star::frame::DispatchRecorderSupplier::create( xContext );
xSupplier->setDispatchRecorder(xRecorder);
xRecorder->startRecording(xFrame);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment