From 2b7773ebb8e8e1662adc4f90ae90f4f746254169 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 28 Apr 2023 14:57:53 +0100 Subject: survive exporting to pdf without config for fuzzing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I229f25a8a15b21257756ecfa008b9e99681003c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151172 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/window/settings.cxx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'vcl/source/window/settings.cxx') diff --git a/vcl/source/window/settings.cxx b/vcl/source/window/settings.cxx index 378ba1c6004d..329b63038f7a 100644 --- a/vcl/source/window/settings.cxx +++ b/vcl/source/window/settings.cxx @@ -226,17 +226,21 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, bool bCallHdl ) c aFont.SetFontHeight( defFontheight ); aStyleSettings.SetGroupFont( aFont ); - static const char* pEnvHC = getenv( "SAL_FORCE_HC" ); - const bool bForceHCMode = pEnvHC && *pEnvHC; - if (bForceHCMode) - aStyleSettings.SetHighContrastMode( true ); - else + static const bool bFuzzing = utl::ConfigManager::IsFuzzing(); + if (!bFuzzing) { - sal_Int32 nHighContrastMode = officecfg::Office::Common::Accessibility::HighContrast::get(); - if (nHighContrastMode != 0) // 0 Automatic, 1 Disable, 2 Enable + static const char* pEnvHC = getenv( "SAL_FORCE_HC" ); + const bool bForceHCMode = pEnvHC && *pEnvHC; + if (bForceHCMode) + aStyleSettings.SetHighContrastMode( true ); + else { - const bool bEnable = nHighContrastMode == 2; - aStyleSettings.SetHighContrastMode(bEnable); + sal_Int32 nHighContrastMode = officecfg::Office::Common::Accessibility::HighContrast::get(); + if (nHighContrastMode != 0) // 0 Automatic, 1 Disable, 2 Enable + { + const bool bEnable = nHighContrastMode == 2; + aStyleSettings.SetHighContrastMode(bEnable); + } } } -- cgit