[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Jun 27 15:42:02 UTC 2021


 sw/source/filter/ww8/ww8graf2.cxx |    2 +-
 sw/source/filter/ww8/ww8par.cxx   |   11 +++++++++--
 sw/source/filter/ww8/ww8par.hxx   |    3 ++-
 3 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit de873f01d286d57829d8fb78d1f2748372552d37
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Jun 26 20:58:57 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Jun 27 17:41:31 2021 +0200

    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 at redhat.com>

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;
 


More information about the Libreoffice-commits mailing list