summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--solenv/gbuild/CppunitTest.mk12
-rw-r--r--sw/CppunitTest_sw_core_layout.mk4
-rw-r--r--sw/layoutwriter_setup.mk4
-rw-r--r--vcl/CppunitTest_vcl_cjk.mk4
-rw-r--r--vcl/CppunitTest_vcl_pdfexport.mk4
-rw-r--r--vcl/unx/generic/fontmanager/fontconfig.cxx3
6 files changed, 16 insertions, 15 deletions
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index fbfc3f30aacb..b16e3d0e5417 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -132,6 +132,9 @@ else
$(if $(gb_CppunitTest__vcl_no_svp), \
$(filter-out SAL_USE_VCLPLUGIN=svp,$(gb_TEST_ENV_VARS)),$(gb_TEST_ENV_VARS)) \
$(EXTRA_ENV_VARS) \
+ $(if $(filter allow,$(NON_APPLICATION_FONT_USE)),, \
+ $(if $(filter abort,$(NON_APPLICATION_FONT_USE)),SAL_NON_APPLICATION_FONT_USE=abort, \
+ $(if $(filter deny,$(NON_APPLICATION_FONT_USE)),SAL_NON_APPLICATION_FONT_USE=deny))) \
$(if $(filter gdb,$(gb_CppunitTest_GDBTRACE)),,$(gb_CppunitTest_CPPTESTPRECOMMAND)) \
$(if $(G_SLICE),G_SLICE=$(G_SLICE)) \
$(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) \
@@ -198,6 +201,7 @@ $(call gb_CppunitTest_get_target,$(1)) : UNO_SERVICES :=
$(call gb_CppunitTest_get_target,$(1)) : UNO_TYPES :=
$(call gb_CppunitTest_get_target,$(1)) : HEADLESS := --headless
$(call gb_CppunitTest_get_target,$(1)) : EXTRA_ENV_VARS :=
+$(call gb_CppunitTest_get_target,$(1)) : NON_APPLICATION_FONT_USE :=
$$(eval $$(call gb_Module_register_target,$(call gb_CppunitTest_get_target,$(1)),$(call gb_CppunitTest_get_clean_target,$(1))))
$(call gb_Helper_make_userfriendly_targets,$(1),CppunitTest)
@@ -383,11 +387,17 @@ $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Executable_get_target,$(2))
endef
+# One of allow, deny, abort:
+define gb_CppunitTest_set_non_application_font_use
+$(call gb_CppunitTest_get_target,$(1)) : NON_APPLICATION_FONT_USE += $(2)
+
+endef
+
define gb_CppunitTest_use_more_fonts
ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),)
$(call gb_CppunitTest_get_target,$(1)) : \
$(foreach font,$(gb_Package_MODULE_ooo_fonts),$(call gb_Package_get_target,$(font)))
-$(call gb_CppunitTest_get_target,$(1)) : EXTRA_ENV_VARS := SAL_NON_APPLICATION_FONT_USE=deny
+$(call gb_CppunitTest_set_non_application_font_use,$(1),deny)
endif
endef
diff --git a/sw/CppunitTest_sw_core_layout.mk b/sw/CppunitTest_sw_core_layout.mk
index 8d8458ea8c4e..9392d81adc59 100644
--- a/sw/CppunitTest_sw_core_layout.mk
+++ b/sw/CppunitTest_sw_core_layout.mk
@@ -72,9 +72,7 @@ $(eval $(call gb_CppunitTest_use_uiconfigs,sw_core_layout, \
))
# assert if font/glyph fallback occurs
-$(call gb_CppunitTest_get_target,sw_core_layout): \
- EXTRA_ENV_VARS := \
- SAL_NON_APPLICATION_FONT_USE=abort
+$(eval $(call gb_CppunitTest_set_non_application_font_use,sw_core_layout,abort))
$(eval $(call gb_CppunitTest_use_more_fonts,sw_core_layout))
diff --git a/sw/layoutwriter_setup.mk b/sw/layoutwriter_setup.mk
index 683ca04f4a9f..bcbcee62083b 100644
--- a/sw/layoutwriter_setup.mk
+++ b/sw/layoutwriter_setup.mk
@@ -83,9 +83,7 @@ $(call gb_CppunitTest_get_target,sw_layoutwriter$(1)): \
$(call gb_Library_get_target,textconv_dict)
# assert if font/glyph fallback occurs
-$(call gb_CppunitTest_get_target,sw_layoutwriter$(1)): \
- EXTRA_ENV_VARS := \
- SAL_NON_APPLICATION_FONT_USE=abort
+$(eval $(call gb_CppunitTest_set_non_application_font_use,sw_layoutwriter$(1),abort))
$(eval $(call gb_CppunitTest_use_more_fonts,sw_layoutwriter$(1)))
diff --git a/vcl/CppunitTest_vcl_cjk.mk b/vcl/CppunitTest_vcl_cjk.mk
index 8da3e5da4019..ea2d70a35cd6 100644
--- a/vcl/CppunitTest_vcl_cjk.mk
+++ b/vcl/CppunitTest_vcl_cjk.mk
@@ -64,8 +64,6 @@ $(eval $(call gb_CppunitTest_use_more_fonts,vcl_cjk))
# we don't have any bundled cjk fonts, so allow use of
# system fonts for the cjk tests, tests have to survive
# unavailable fonts
-$(call gb_CppunitTest_get_target,vcl_cjk): \
- EXTRA_ENV_VARS := \
- SAL_NON_APPLICATION_FONT_USE=allow
+$(eval $(call gb_CppunitTest_set_non_application_font_use,vcl_cjk,allow))
# vim: set noet sw=4 ts=4:
diff --git a/vcl/CppunitTest_vcl_pdfexport.mk b/vcl/CppunitTest_vcl_pdfexport.mk
index b43d14ee9857..533164c881d5 100644
--- a/vcl/CppunitTest_vcl_pdfexport.mk
+++ b/vcl/CppunitTest_vcl_pdfexport.mk
@@ -44,9 +44,7 @@ $(eval $(call gb_CppunitTest_use_rdb,vcl_pdfexport,services))
$(eval $(call gb_CppunitTest_use_configuration,vcl_pdfexport))
# assert if font/glyph fallback occurs
-$(call gb_CppunitTest_get_target,vcl_pdfexport): \
- EXTRA_ENV_VARS := \
- SAL_NON_APPLICATION_FONT_USE=abort
+$(eval $(call gb_CppunitTest_set_non_application_font_use,vcl_pdfexport,abort))
$(eval $(call gb_CppunitTest_use_more_fonts,vcl_pdfexport))
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx
index 712256131cd2..318c69ff8434 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -309,8 +309,7 @@ FcFontSet* FontCfgWrapper::getFontSet()
bool bRestrictFontSetToApplicationFonts = false;
#if HAVE_MORE_FONTS
bRestrictFontSetToApplicationFonts = [] {
- const char* pEnv = getenv("SAL_NON_APPLICATION_FONT_USE");
- return pEnv && strcmp(pEnv, "allow") != 0;
+ return getenv("SAL_NON_APPLICATION_FONT_USE") != nullptr;
}();
#endif
if (!bRestrictFontSetToApplicationFonts)