From f89296db5959cf009668f8aad85cfd860b9252ee Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Sat, 17 May 2014 00:39:58 +1000 Subject: [PATCH] vcl: fixup svdemo Change-Id: Ifb7cc12da349fcbcd1d3dc25b64cd2bf3fd7e819 Reviewed-on: https://gerrit.libreoffice.org/9378 Tested-by: LibreOffice gerrit bot Reviewed-by: Chris Sherlock --- Repository.mk | 1 + vcl/Executable_svdemo.mk | 39 +++++++++++++++++++++++++++++++++++++++ vcl/Module_vcl.mk | 7 ++++--- vcl/workben/svdem.cxx | 22 ++++++++++++++++------ 4 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 vcl/Executable_svdemo.mk diff --git a/Repository.mk b/Repository.mk index abdbd630021d..318654b4d70b 100644 --- a/Repository.mk +++ b/Repository.mk @@ -118,6 +118,7 @@ $(eval $(call gb_Helper_register_executables,OOO, \ unopkg \ unopkg_com \ ) \ + svdemo \ )) $(eval $(call gb_Helper_register_executables_for_install,UREBIN,ure,\ diff --git a/vcl/Executable_svdemo.mk b/vcl/Executable_svdemo.mk new file mode 100644 index 000000000000..893712913df4 --- /dev/null +++ b/vcl/Executable_svdemo.mk @@ -0,0 +1,39 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Executable_Executable,svdemo)) + +$(eval $(call gb_Executable_use_api,svdemo,\ + offapi \ + udkapi \ +)) + +$(eval $(call gb_Executable_use_external,svdemo,boost_headers)) + +$(eval $(call gb_Executable_set_include,svdemo,\ + $$(INCLUDE) \ + -I$(SRCDIR)/vcl/inc \ + -I$(SRCDIR)/solenv/inc \ +)) + +$(eval $(call gb_Executable_use_libraries,svdemo,\ + tl \ + sal \ + vcl \ + cppu \ + cppuhelper \ + comphelper \ +)) + +$(eval $(call gb_Executable_add_exception_objects,svdemo,\ + vcl/workben/svdem \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index 254fe0d9e96e..dc8130d97432 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -23,9 +23,10 @@ $(eval $(call gb_Module_add_targets,vcl,\ CustomTarget_afm_hash \ Library_vcl \ $(if $(filter DESKTOP,$(BUILD_TYPE)), \ - StaticLibrary_vclmain \ - Executable_ui-previewer) \ - Library_vclopengl \ + StaticLibrary_vclmain \ + Executable_ui-previewer) \ + Executable_svdemo \ + Library_vclopengl \ )) $(eval $(call gb_Module_add_l10n_targets,vcl,\ diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx index 8bfc84bcf3b3..1e6f681c43b9 100644 --- a/vcl/workben/svdem.cxx +++ b/vcl/workben/svdem.cxx @@ -19,19 +19,23 @@ #include #include + +#include +#include + #include +#include #include #include #include #include -#include -#include -#include +#include using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; +using namespace cppu; // Forward declaration void Main(); @@ -40,10 +44,16 @@ SAL_IMPLEMENT_MAIN() { tools::extendApplicationEnvironment(); - Reference< XMultiServiceFactory > xMS; - xMS = cppu::createRegistryServiceFactory( "types.rdb", "applicat.rdb", true ); + Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext(); + Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY ); - comphelper::setProcessServiceFactory( xMS ); + if( !xServiceManager.is() ) + { + fprintf( stderr, "Failed to bootstrap\n" ); + exit( 1 ); + } + + comphelper::setProcessServiceFactory( xServiceManager ); InitVCL(); ::Main();