From c0d5da912302ed14469ba3ed0900d346122d34b0 Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Sun, 18 May 2014 16:07:08 +1000 Subject: [PATCH] vcl: fix svptest Change-Id: Ibaec6e027aa9fd61824ff6b4f1f71b69d217dfdc --- Repository.mk | 1 + vcl/Module_vcl.mk | 1 + vcl/workben/svptest.cxx | 19 ++++++++++++------- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Repository.mk b/Repository.mk index db18c1098208..15288f78ca68 100644 --- a/Repository.mk +++ b/Repository.mk @@ -120,6 +120,7 @@ $(eval $(call gb_Helper_register_executables,OOO, \ ) \ $(if $(filter-out ANDROID IOS,$(OS)), \ svdemo \ + svptest \ vcldemo) \ )) diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index 641d06163fb7..a38d0764f612 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -27,6 +27,7 @@ $(eval $(call gb_Module_add_targets,vcl,\ Executable_ui-previewer) \ $(if $(filter-out ANDROID IOS,$(OS)), \ Executable_svdemo \ + Executable_svptest \ Executable_vcldemo) \ Library_vclopengl \ )) diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 0078e7bbfc45..134a4fd097ee 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -19,7 +19,12 @@ #include #include + +#include +#include + #include +#include #include #include @@ -34,12 +39,9 @@ #include -#include -#include -#include - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; +using namespace cppu; // Forward declaration void Main(); @@ -48,10 +50,13 @@ SAL_IMPLEMENT_MAIN() { tools::extendApplicationEnvironment(); - Reference< XMultiServiceFactory > xMS; - xMS = cppu::createRegistryServiceFactory( OUString( "types.rdb" ), OUString( "applicat.rdb" ), true ); + Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext(); + Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY ); - comphelper::setProcessServiceFactory( xMS ); + if( !xServiceManager.is() ) + Application::Abort( "Failed to bootstrap" ); + + comphelper::setProcessServiceFactory( xServiceManager ); InitVCL(); ::Main();