diff options
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 22 | ||||
-rw-r--r-- | framework/source/fwe/helper/titlehelper.cxx | 13 | ||||
-rw-r--r-- | framework/source/services/modulemanager.cxx | 21 | ||||
-rw-r--r-- | sfx2/source/appl/workwin.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/view/classificationhelper.cxx | 3 | ||||
-rw-r--r-- | svtools/source/config/optionsdrawinglayer.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/bastyp/SwSmartTagMgr.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/txtnode/OnlineAccessibilityCheck.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/view/printdata.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view.cxx | 28 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 3 | ||||
-rw-r--r-- | unotools/source/config/securityoptions.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 7 | ||||
-rw-r--r-- | vcl/source/window/settings.cxx | 22 |
15 files changed, 99 insertions, 57 deletions
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 3edcd1976c4f..54dd54f7590e 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -479,15 +479,19 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& aContext.DocumentInfo.Keywords = ::comphelper::string::convertCommaSeparated(xDocumentProps->getKeywords()); } } - // getting the string for the producer - OUString aProducerOverride = officecfg::Office::Common::Save::Document::GeneratorOverride::get(); - if( !aProducerOverride.isEmpty()) - aContext.DocumentInfo.Producer = aProducerOverride; - else - aContext.DocumentInfo.Producer = - utl::ConfigManager::getProductName() + - " " + - utl::ConfigManager::getProductVersion(); + + if (!utl::ConfigManager::IsFuzzing()) + { + // getting the string for the producer + OUString aProducerOverride = officecfg::Office::Common::Save::Document::GeneratorOverride::get(); + if (!aProducerOverride.isEmpty()) + aContext.DocumentInfo.Producer = aProducerOverride; + else + aContext.DocumentInfo.Producer = + utl::ConfigManager::getProductName() + + " " + + utl::ConfigManager::getProductVersion(); + } aContext.DocumentInfo.Creator = aCreator; diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx index e0983d9e5549..be779736e0f7 100644 --- a/framework/source/fwe/helper/titlehelper.cxx +++ b/framework/source/fwe/helper/titlehelper.cxx @@ -496,11 +496,14 @@ void TitleHelper::impl_updateTitleForFrame (const css::uno::Reference< css::fram impl_appendComponentTitle (sTitle, xComponent); #ifndef MACOSX - // fdo#70376: We want the window title to contain just the - // document name (from the above "component title"). - impl_appendProductName (sTitle); - impl_appendModuleName (sTitle); - impl_appendDebugVersion (sTitle); + if (!utl::ConfigManager::IsFuzzing()) + { + // fdo#70376: We want the window title to contain just the + // document name (from the above "component title"). + impl_appendProductName (sTitle); + impl_appendModuleName (sTitle); + impl_appendDebugVersion (sTitle); + } #endif impl_appendSafeMode (sTitle); diff --git a/framework/source/services/modulemanager.cxx b/framework/source/services/modulemanager.cxx index 475084c4cd5c..ce48cfd44123 100644 --- a/framework/source/services/modulemanager.cxx +++ b/framework/source/services/modulemanager.cxx @@ -36,6 +36,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <comphelper/sequence.hxx> #include <comphelper/enumhelper.hxx> +#include <unotools/configmgr.hxx> #include <utility> namespace { @@ -127,10 +128,13 @@ private: ModuleManager::ModuleManager(css::uno::Reference< css::uno::XComponentContext > xContext) : m_xContext(std::move(xContext)) { - m_xCFG.set( comphelper::ConfigurationHelper::openConfig( - m_xContext, "/org.openoffice.Setup/Office/Factories", - comphelper::EConfigurationModes::ReadOnly ), - css::uno::UNO_QUERY_THROW ); + if (!utl::ConfigManager::IsFuzzing()) + { + m_xCFG.set( comphelper::ConfigurationHelper::openConfig( + m_xContext, "/org.openoffice.Setup/Office/Factories", + comphelper::EConfigurationModes::ReadOnly ), + css::uno::UNO_QUERY_THROW ); + } } OUString ModuleManager::getImplementationName() @@ -244,7 +248,8 @@ css::uno::Any SAL_CALL ModuleManager::getByName(const OUString& sName) { // get access to the element css::uno::Reference< css::container::XNameAccess > xModule; - m_xCFG->getByName(sName) >>= xModule; + if (m_xCFG) + m_xCFG->getByName(sName) >>= xModule; if (!xModule.is()) { throw css::uno::RuntimeException( @@ -267,12 +272,12 @@ css::uno::Any SAL_CALL ModuleManager::getByName(const OUString& sName) css::uno::Sequence< OUString > SAL_CALL ModuleManager::getElementNames() { - return m_xCFG->getElementNames(); + return m_xCFG ? m_xCFG->getElementNames() : css::uno::Sequence<OUString>(); } sal_Bool SAL_CALL ModuleManager::hasByName(const OUString& sName) { - return m_xCFG->hasByName(sName); + return m_xCFG && m_xCFG->hasByName(sName); } css::uno::Type SAL_CALL ModuleManager::getElementType() @@ -282,7 +287,7 @@ css::uno::Type SAL_CALL ModuleManager::getElementType() sal_Bool SAL_CALL ModuleManager::hasElements() { - return m_xCFG->hasElements(); + return m_xCFG && m_xCFG->hasElements(); } css::uno::Reference< css::container::XEnumeration > SAL_CALL ModuleManager::createSubSetEnumerationByQuery(const OUString&) diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index fb3955ee2c5c..0e9308da6c63 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -41,6 +41,7 @@ #include <svl/eitem.hxx> #include <tools/svborder.hxx> #include <tools/debug.hxx> +#include <unotools/configmgr.hxx> #include <unotools/moduleoptions.hxx> #include <com/sun/star/ui/XUIElement.hpp> #include <com/sun/star/frame/LayoutManagerEvents.hpp> @@ -1162,6 +1163,9 @@ css::uno::Reference< css::frame::XFrame > SfxWorkWindow::GetFrameInterface() void SfxWorkWindow::UpdateObjectBars_Impl2() { + if (utl::ConfigManager::IsFuzzing()) + return; + // Lock SplitWindows (which means suppressing the Resize-Reaction of the // DockingWindows) for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index 967360e341e7..3ec824a4b034 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -26,6 +26,7 @@ #include <i18nlangtag/languagetag.hxx> #include <sfx2/infobar.hxx> #include <comphelper/processfactory.hxx> +#include <unotools/configmgr.hxx> #include <unotools/pathoptions.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/streamwrap.hxx> @@ -940,6 +941,8 @@ const OUString& SfxClassificationHelper::PROP_PREFIX_INTELLECTUALPROPERTY() SfxClassificationPolicyType SfxClassificationHelper::getPolicyType() { + if (utl::ConfigManager::IsFuzzing()) + return SfxClassificationPolicyType::IntellectualProperty; sal_Int32 nPolicyTypeNumber = officecfg::Office::Common::Classification::Policy::get(); auto eType = static_cast<SfxClassificationPolicyType>(nPolicyTypeNumber); return eType; diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx index a4ec26ad921d..227b9ef0ad25 100644 --- a/svtools/source/config/optionsdrawinglayer.cxx +++ b/svtools/source/config/optionsdrawinglayer.cxx @@ -22,6 +22,7 @@ #include <vcl/outdev.hxx> #include <vcl/settings.hxx> #include <officecfg/Office/Common.hxx> +#include <unotools/configmgr.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> #include <mutex> @@ -59,33 +60,33 @@ sal_uInt16 GetStripeLength() bool IsOverlayBuffer_Calc() { - return officecfg::Office::Common::Drawinglayer::OverlayBuffer_Calc::get(); + return !utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Drawinglayer::OverlayBuffer_Calc::get(); } bool IsOverlayBuffer_Writer() { - return officecfg::Office::Common::Drawinglayer::OverlayBuffer_Writer::get(); + return !utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Drawinglayer::OverlayBuffer_Writer::get(); } bool IsOverlayBuffer_DrawImpress() { - return officecfg::Office::Common::Drawinglayer::OverlayBuffer_DrawImpress::get(); + return !utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Drawinglayer::OverlayBuffer_DrawImpress::get(); } // #i74769#, #i75172# bool IsPaintBuffer_Calc() { - return officecfg::Office::Common::Drawinglayer::PaintBuffer_Calc::get(); + return !utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Drawinglayer::PaintBuffer_Calc::get(); } bool IsPaintBuffer_Writer() { - return officecfg::Office::Common::Drawinglayer::PaintBuffer_Writer::get(); + return !utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Drawinglayer::PaintBuffer_Writer::get(); } bool IsPaintBuffer_DrawImpress() { - return officecfg::Office::Common::Drawinglayer::PaintBuffer_DrawImpress::get(); + return !utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Drawinglayer::PaintBuffer_DrawImpress::get(); } // #i4219# diff --git a/sw/source/core/bastyp/SwSmartTagMgr.cxx b/sw/source/core/bastyp/SwSmartTagMgr.cxx index cc769d870da7..3a28af822de9 100644 --- a/sw/source/core/bastyp/SwSmartTagMgr.cxx +++ b/sw/source/core/bastyp/SwSmartTagMgr.cxx @@ -21,6 +21,7 @@ #include <docsh.hxx> #include <swmodule.hxx> +#include <unotools/configmgr.hxx> #include <vcl/svapp.hxx> using namespace com::sun::star; @@ -32,7 +33,9 @@ SwSmartTagMgr& SwSmartTagMgr::Get() { if (!spTheSwSmartTagMgr) { - spTheSwSmartTagMgr = new SwSmartTagMgr(SwDocShell::Factory().GetModuleName()); + OUString sModuleName + = !utl::ConfigManager::IsFuzzing() ? SwDocShell::Factory().GetModuleName() : "Writer"; + spTheSwSmartTagMgr = new SwSmartTagMgr(sModuleName); spTheSwSmartTagMgr->Init(u"Writer"); } return *spTheSwSmartTagMgr; diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index db9d05f8c5f9..c4134fbfa2ee 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -122,6 +122,7 @@ #include <svl/style.hxx> #include <ndtxt.hxx> +#include <unotools/configmgr.hxx> #include <vcl/hatch.hxx> using namespace ::editeng; @@ -1752,7 +1753,7 @@ bool DrawFillAttributes( // This must probably be removed again when we will be able to get all Writer visualization // as primitives and Writer prepares all it's stuff in high precision coordinates (also // needs to avoid moving boundaries around to better show overlapping stuff...) - if(SvtOptionsDrawinglayer::IsAntiAliasing()) + if (utl::ConfigManager::IsFuzzing() || SvtOptionsDrawinglayer::IsAntiAliasing()) { // if AAed in principle expand by 0.5 in all directions. Since painting edges of // AAed regions does not add to no transparence (0.5 opacity covered by 0.5 opacity diff --git a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx index 5b190fb96362..20d0ac39c10e 100644 --- a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx +++ b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx @@ -178,7 +178,8 @@ void OnlineAccessibilityCheck::initialCheck() void OnlineAccessibilityCheck::updateCheckerActivity() { bool bOnlineCheckStatus - = officecfg::Office::Common::Accessibility::OnlineAccessibilityCheck::get(); + = !utl::ConfigManager::IsFuzzing() + && officecfg::Office::Common::Accessibility::OnlineAccessibilityCheck::get(); if (bOnlineCheckStatus != m_bOnlineCheckStatus) { diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 490d647d12e0..a63867f096bd 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -30,6 +30,7 @@ #include <svl/cjkoptions.hxx> #include <svl/ctloptions.hxx> #include <toolkit/awt/vclxdevice.hxx> +#include <unotools/configmgr.hxx> #include <unotools/moduleoptions.hxx> #include <vcl/outdev.hxx> #include <osl/diagnose.h> @@ -163,7 +164,7 @@ SwPrintUIOptions::SwPrintUIOptions( { // printing HTML sources does not have any valid UI options. // It's just the source code that gets printed... - if (bSwSrcView) + if (bSwSrcView || utl::ConfigManager::IsFuzzing()) { m_aUIProperties.clear(); return; diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 2ef8ef1a70a5..d0d654479a4e 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -809,8 +809,13 @@ SwView::SwView(SfxViewFrame& _rFrame, SfxViewShell* pOldSh) bDocSzUpdated = true; - CreateScrollbar( true ); - CreateScrollbar( false ); + static bool bFuzzing = utl::ConfigManager::IsFuzzing(); + + if (!bFuzzing) + { + CreateScrollbar( true ); + CreateScrollbar( false ); + } m_pViewImpl.reset(new SwView_Impl(this)); SetName("View"); @@ -983,7 +988,7 @@ SwView::SwView(SfxViewFrame& _rFrame, SfxViewShell* pOldSh) SAL_WARN_IF( officecfg::Office::Common::Undo::Steps::get() <= 0, "sw.ui", "/org.openoffice.Office.Common/Undo/Steps <= 0"); - if (!utl::ConfigManager::IsFuzzing() && 0 < officecfg::Office::Common::Undo::Steps::get()) + if (!bFuzzing && 0 < officecfg::Office::Common::Undo::Steps::get()) { m_pWrtShell->DoUndo(); } @@ -995,7 +1000,8 @@ SwView::SwView(SfxViewFrame& _rFrame, SfxViewShell* pOldSh) m_bVScrollbarEnabled = aUsrPref.IsViewVScrollBar(); m_bHScrollbarEnabled = aUsrPref.IsViewHScrollBar(); - m_pHScrollbar->SetAuto(bBrowse); + if (m_pHScrollbar) + m_pHScrollbar->SetAuto(bBrowse); if( aUsrPref.IsViewHRuler() ) CreateTab(); if( aUsrPref.IsViewVRuler() ) @@ -1079,15 +1085,19 @@ SwView::SwView(SfxViewFrame& _rFrame, SfxViewShell* pOldSh) rDocSh.EnableSetModified(); InvalidateBorder(); - if( !m_pHScrollbar->IsScrollbarVisible(true) ) - ShowHScrollbar( false ); - if( !m_pVScrollbar->IsScrollbarVisible(true) ) - ShowVScrollbar( false ); + if (!bFuzzing) + { + if (!m_pHScrollbar->IsScrollbarVisible(true)) + ShowHScrollbar( false ); + if (!m_pVScrollbar->IsScrollbarVisible(true)) + ShowVScrollbar( false ); + } if (m_pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton()) m_pWrtShell->InvalidateOutlineContentVisibility(); - GetViewFrame().GetWindow().AddChildEventListener( LINK( this, SwView, WindowChildEventListener ) ); + if (!bFuzzing) + GetViewFrame().GetWindow().AddChildEventListener(LINK(this, SwView, WindowChildEventListener)); } SwViewGlueDocShell::SwViewGlueDocShell(SwView& rView, SwDocShell& rDocSh) diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index f107586c1a29..e0a9feb9f5bf 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -69,6 +69,7 @@ #include <unostyle.hxx> #include <unodraw.hxx> #include <svl/eitem.hxx> +#include <unotools/configmgr.hxx> #include <unotools/datetime.hxx> #include <unocrsr.hxx> #include <unofieldcoll.hxx> @@ -2553,7 +2554,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( // #122919# Force field update before PDF export, but after layout init (tdf#121962) bool bStateChanged = false; // check configuration: shall update of printing information in DocInfo set the document to "modified"? - if (pRenderDocShell->IsEnableSetModified() && !officecfg::Office::Common::Print::PrintingModifiesDocument::get()) + if (pRenderDocShell->IsEnableSetModified() && !utl::ConfigManager::IsFuzzing() && !officecfg::Office::Common::Print::PrintingModifiesDocument::get()) { pRenderDocShell->EnableSetModified( false ); bStateChanged = true; diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index 4749065fb431..b222b8e70502 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -165,12 +165,12 @@ bool isTrustedLocationUriForUpdatingLinks(OUString const & uri) sal_Int32 GetMacroSecurityLevel() { - return officecfg::Office::Common::Security::Scripting::MacroSecurityLevel::get(); + return utl::ConfigManager::IsFuzzing() ? 3 : officecfg::Office::Common::Security::Scripting::MacroSecurityLevel::get(); } void SetMacroSecurityLevel( sal_Int32 _nLevel ) { - if( officecfg::Office::Common::Security::Scripting::MacroSecurityLevel::isReadOnly() ) + if (utl::ConfigManager::IsFuzzing() || officecfg::Office::Common::Security::Scripting::MacroSecurityLevel::isReadOnly()) return; if( _nLevel > 3 || _nLevel < 0 ) @@ -183,7 +183,7 @@ void SetMacroSecurityLevel( sal_Int32 _nLevel ) bool IsMacroDisabled() { - return officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get(); + return utl::ConfigManager::IsFuzzing() || officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get(); } std::vector< SvtSecurityOptions::Certificate > GetTrustedAuthors() 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); + } } } |