diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-26 20:58:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-27 17:41:31 +0200 |
commit | de873f01d286d57829d8fb78d1f2748372552d37 (patch) | |
tree | e161c9894bb944969fd3010233bb315a4fe4dac0 /sw | |
parent | 770f94f4c5bedede8ee70e1f3bc1303dbace62ca (diff) |
ofz#30647 skip boring slow path for fuzzing
Change-Id: Ifab4209e4481058046c95efc9efccf337b4badd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117939
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8graf2.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 3 |
3 files changed, 12 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index e5289fa8d4dc..266feac64975 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -265,7 +265,7 @@ bool SwWW8ImplReader::ReadGrafFile(OUString& rFileName, std::unique_ptr<Graphic> return false; //skip duplicate graphics when fuzzing - if (utl::ConfigManager::IsFuzzing()) + if (m_bFuzzing) { if (!m_aGrafPosSet.insert(nPosFc).second) return false; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 0f5257417dfb..04b53252d49d 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3281,6 +3281,12 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const OUString& rAddString if (rAddString.isEmpty()) return; + if (m_bFuzzing) + { + simpleAddTextToParagraph(rAddString); + return; + } + uno::Reference<i18n::XBreakIterator> xBI(g_pBreakIt->GetBreakIter()); assert(xBI.is()); @@ -4306,6 +4312,7 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage, , m_bCareLastParaEndInToc(false) , m_aTOXEndCps() , m_bNotifyMacroEventRead(false) + , m_bFuzzing(utl::ConfigManager::IsFuzzing()) { m_pStrm->SetEndian( SvStreamEndian::LITTLE ); m_aApos.push_back(false); @@ -4880,7 +4887,7 @@ void WW8Customizations::Import( SwDocShell* pShell ) void SwWW8ImplReader::ReadGlobalTemplateSettings( std::u16string_view sCreatedFrom, const uno::Reference< container::XNameContainer >& xPrjNameCache ) { - if (utl::ConfigManager::IsFuzzing()) + if (m_bFuzzing) return; SvtPathOptions aPathOpt; @@ -5196,7 +5203,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss) } #if HAVE_FEATURE_SCRIPTING - if (!utl::ConfigManager::IsFuzzing()) + if (!m_bFuzzing) { BasicManager *pBasicMan = m_pDocShell->GetBasicManager(); if (pBasicMan) diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 430ae7d10a9a..1e86ed8ba991 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1376,7 +1376,8 @@ private: bool m_bCareLastParaEndInToc; cp_set m_aTOXEndCps; - bool m_bNotifyMacroEventRead:1; + bool m_bNotifyMacroEventRead; + bool m_bFuzzing; const SprmReadInfo& GetSprmReadInfo(sal_uInt16 nId) const; |