summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-05-17 00:39:58 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-05-17 07:14:25 +0000
commitf89296db5959cf009668f8aad85cfd860b9252ee (patch)
tree1e8a03414713d1df78df57935ff64eadf56b218b
parentbc7e0967be52f5eb7948fbb1c30edc7dd5acc18d (diff)
vcl: fixup svdemo
Change-Id: Ifb7cc12da349fcbcd1d3dc25b64cd2bf3fd7e819 Reviewed-on: https://gerrit.libreoffice.org/9378 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
-rw-r--r--Repository.mk1
-rw-r--r--vcl/Executable_svdemo.mk39
-rw-r--r--vcl/Module_vcl.mk7
-rw-r--r--vcl/workben/svdem.cxx22
4 files changed, 60 insertions, 9 deletions
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 <sal/main.h>
#include <tools/extendapplicationenvironment.hxx>
+
+#include <cppuhelper/bootstrap.hxx>
+#include <comphelper/processfactory.hxx>
+
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <vcl/event.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/msgbox.hxx>
-#include <comphelper/processfactory.hxx>
-#include <cppuhelper/servicefactory.hxx>
-#include <cppuhelper/bootstrap.hxx>
+#include <cstdio>
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 );
+
+ if( !xServiceManager.is() )
+ {
+ fprintf( stderr, "Failed to bootstrap\n" );
+ exit( 1 );
+ }
- comphelper::setProcessServiceFactory( xMS );
+ comphelper::setProcessServiceFactory( xServiceManager );
InitVCL();
::Main();