[Libreoffice-commits] core.git: Repository.mk vcl/Executable_svdemo.mk vcl/Module_vcl.mk vcl/workben

Chris Sherlock chris.sherlock79 at gmail.com
Sat May 17 00:14:55 PDT 2014


 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(-)

New commits:
commit f89296db5959cf009668f8aad85cfd860b9252ee
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Sat May 17 00:39:58 2014 +1000

    vcl: fixup svdemo
    
    Change-Id: Ifb7cc12da349fcbcd1d3dc25b64cd2bf3fd7e819
    Reviewed-on: https://gerrit.libreoffice.org/9378
    Tested-by: LibreOffice gerrit bot <gerrit at libreoffice.org>
    Reviewed-by: Chris Sherlock <chris.sherlock79 at gmail.com>

diff --git a/Repository.mk b/Repository.mk
index abdbd63..318654b 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 0000000..8937129
--- /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 254fe0d..dc8130d 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 8bfc84b..1e6f681 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();


More information about the Libreoffice-commits mailing list