summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-04-28 14:57:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2023-04-28 21:23:25 +0200
commit2b7773ebb8e8e1662adc4f90ae90f4f746254169 (patch)
tree8f81cc1f3e5a906aa59681b9f3e8dca3899d15c1 /vcl/source
parentf701edb6f72e50fae5857a81081d3503e5363b8f (diff)
survive exporting to pdf without config for fuzzing
Change-Id: I229f25a8a15b21257756ecfa008b9e99681003c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151172 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx7
-rw-r--r--vcl/source/window/settings.cxx22
2 files changed, 17 insertions, 12 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 98a1221676f2..ce70dedc8b21 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -51,6 +51,7 @@
#include <rtl/digest.h>
#include <rtl/uri.hxx>
#include <rtl/ustrbuf.hxx>
+#include <svl/cryptosign.hxx>
#include <sal/log.hxx>
#include <svl/urihelper.hxx>
#include <tools/fract.hxx>
@@ -58,7 +59,7 @@
#include <tools/helpers.hxx>
#include <tools/urlobj.hxx>
#include <tools/zcodec.hxx>
-#include <svl/cryptosign.hxx>
+#include <unotools/configmgr.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/canvastools.hxx>
#include <vcl/cvtgrf.hxx>
@@ -1201,8 +1202,8 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext,
m_nCurrentStructElement( 0 ),
m_bEmitStructure( true ),
m_nNextFID( 1 ),
- m_aPDFBmpCache(
- officecfg::Office::Common::VCL::PDFExportImageCacheSize::get() ),
+ m_aPDFBmpCache(utl::ConfigManager::IsFuzzing() ? 15 :
+ officecfg::Office::Common::VCL::PDFExportImageCacheSize::get()),
m_nCurrentPage( -1 ),
m_nCatalogObject(0),
m_nSignatureObject( -1 ),
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);
+ }
}
}