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>
This commit is contained in:
Chris Sherlock 2014-05-17 00:39:58 +10:00
parent bc7e0967be
commit f89296db59
4 changed files with 60 additions and 9 deletions

View file

@ -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,\

39
vcl/Executable_svdemo.mk Normal file
View file

@ -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:

View file

@ -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,\

View file

@ -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 );
comphelper::setProcessServiceFactory( xMS );
if( !xServiceManager.is() )
{
fprintf( stderr, "Failed to bootstrap\n" );
exit( 1 );
}
comphelper::setProcessServiceFactory( xServiceManager );
InitVCL();
::Main();