Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
7a90f774
Kaydet (Commit)
7a90f774
authored
Haz 04, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Missing new files from previous commit
Change-Id: Ic8d7c13602c8831e411181c802eb825124578b19
üst
369d9593
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
127 additions
and
0 deletions
+127
-0
Library_vclbootstrapprotector.mk
test/Library_vclbootstrapprotector.mk
+34
-0
vclbootstrapprotector.cxx
test/source/vclbootstrapprotector.cxx
+93
-0
No files found.
test/Library_vclbootstrapprotector.mk
0 → 100644
Dosyayı görüntüle @
7a90f774
# -*- 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_Library_Library,vclbootstrapprotector))
$(eval $(call gb_Library_add_exception_objects,vclbootstrapprotector, \
test/source/vclbootstrapprotector \
))
$(eval $(call gb_Library_use_externals,vclbootstrapprotector, \
boost_headers \
cppunit \
))
$(eval $(call gb_Library_use_libraries,vclbootstrapprotector, \
comphelper \
cppu \
i18nlangtag \
sal \
tl \
utl \
vcl \
$(gb_UWINAPI) \
))
$(eval $(call gb_Library_use_sdk_api,vclbootstrapprotector))
# vim: set noet sw=4 ts=4:
test/source/vclbootstrapprotector.cxx
0 → 100644
Dosyayı görüntüle @
7a90f774
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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/.
*/
#include <sal/config.h>
#include <boost/noncopyable.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/util/XFlushable.hpp>
#include <comphelper/processfactory.hxx>
#include <cppunit/Protector.h>
#include <cppunittester/protectorfactory.hxx>
#include <i18nlangtag/lang.h>
#include <i18nlangtag/languagetag.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <sal/types.h>
#include <tools/resmgr.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/syslocaleoptions.hxx>
#include <vcl/svapp.hxx>
namespace
{
class
Protector
:
public
CppUnit
::
Protector
,
private
boost
::
noncopyable
{
public
:
Protector
()
{
// Force locale (and resource files loaded) to en-US:
ResMgr
::
SetDefaultLocale
(
LanguageTag
(
"en-US"
));
SvtSysLocaleOptions
localOptions
;
localOptions
.
SetLocaleConfigString
(
"en-US"
);
localOptions
.
SetUILocaleConfigString
(
"en-US"
);
MsLangId
::
setConfiguredSystemUILanguage
(
LANGUAGE_ENGLISH_US
);
LanguageTag
::
setConfiguredSystemLanguage
(
LANGUAGE_ENGLISH_US
);
InitVCL
();
if
(
Application
::
IsHeadlessModeRequested
())
{
Application
::
EnableHeadlessMode
(
true
);
}
Application
::
setDeInitHook
(
STATIC_LINK
(
this
,
Protector
,
deinitHook
));
}
private
:
virtual
~
Protector
()
{
DeInitVCL
();
}
virtual
bool
protect
(
CppUnit
::
Functor
const
&
functor
,
CppUnit
::
ProtectorContext
const
&
)
SAL_OVERRIDE
{
return
functor
();
}
DECL_STATIC_LINK
(
Protector
,
deinitHook
,
void
*
);
};
// HACK so that defaultBootstrap_InitialComponentContext (in
// unobootstrapprotector) is called before InitVCL (above), but component
// context is disposed (redundantly again in unobootstrapprotector) from within
// DeInitVCL (cf. Desktop::DeInit, desktop/source/app/app.cxx):
IMPL_STATIC_LINK_NOINSTANCE
(
Protector
,
deinitHook
,
void
*
,
EMPTYARG
)
{
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
context
;
try
{
context
=
comphelper
::
getProcessComponentContext
();
}
catch
(
css
::
uno
::
RuntimeException
&
)
{}
if
(
context
.
is
())
{
css
::
uno
::
Reference
<
css
::
lang
::
XMultiServiceFactory
>
config
;
try
{
config
=
css
::
configuration
::
theDefaultProvider
::
get
(
context
);
}
catch
(
css
::
uno
::
DeploymentException
&
)
{}
if
(
config
.
is
())
{
utl
::
ConfigManager
::
storeConfigItems
();
css
::
uno
::
Reference
<
css
::
util
::
XFlushable
>
(
config
,
css
::
uno
::
UNO_QUERY_THROW
)
->
flush
();
}
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
(
context
,
css
::
uno
::
UNO_QUERY_THROW
)
->
dispose
();
comphelper
::
setProcessServiceFactory
(
0
);
}
return
0
;
}
}
extern
"C"
SAL_DLLPUBLIC_EXPORT
CppUnit
::
Protector
*
SAL_CALL
vclbootstrapprotector
()
{
return
new
Protector
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment