summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-08-31 20:12:55 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-09-01 08:11:18 +0200
commit790b5c3cc3b6627c41696a0cccae88358a6fd1b6 (patch)
tree494916ecfbe68c71fadbef552e7eb1dd270f2b86 /vcl/source/gdi
parentc54c576a5043dc5a0cc01f8c71897373516ae091 (diff)
change ABORT_ON_NON_APPLICATION_FONT_USE to NON_APPLICATION_FONT_USE=...
with =abort to crash and burn if there is font/glyph fallback, and lesser =deny to just restrict to the bundled fonts for the test. Change-Id: I0a8f7046260c24f3bf24ec3a91489924486fb844 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139132 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/impglyphitem.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index 53f9b1d18b9a..7bed1391c0d5 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -363,14 +363,16 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr<const OutputDevice> outputDevice, c
// part being underlined. Doing this for any two segments allows this optimization
// even when the prefix of the string would use a different font.
// TODO: Can those font differences be ignored?
- // Writer layouts tests enable SAL_ABORT_ON_NON_APPLICATION_FONT_USE in order
+ // Writer layouts tests enable SAL_NON_APPLICATION_FONT_USE=abort in order
// to make PrintFontManager::Substitute() abort if font fallback happens. When
// laying out the entire string the chance this happens increases (e.g. testAbi11870
// normally calls this function only for a part of a string, but this optimization
// lays out the entire string and causes a fallback). Since this optimization
// does not change result of this function, simply disable it for those tests.
- static bool bAbortOnFontSubstitute
- = getenv("SAL_ABORT_ON_NON_APPLICATION_FONT_USE") != nullptr;
+ static const bool bAbortOnFontSubstitute = [] {
+ const char* pEnv = getenv("SAL_NON_APPLICATION_FONT_USE");
+ return pEnv && strcmp(pEnv, "abort") == 0;
+ }();
if (mLastSubstringKey.has_value() && !bAbortOnFontSubstitute)
{
sal_Int32 pos = nIndex;