sc/source/filter/excel/impop.cxx |   11 ++++++++---
 sc/source/filter/inc/imp_op.hxx  |    1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 1a47dff65bb94274c03543958b06e8a654a44d4a
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Nov 6 13:06:09 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Nov 6 20:19:12 2022 +0100

    ofz#51431 Timeout
    
    Change-Id: Ibcaefe2f12d2cad41eb8c7e6cd2924cf2c0c8e3d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142353
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 9ddc6e6e756e..7d4400f4f617 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -95,7 +95,8 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& 
rStrm ):
     mnIxfeIndex( 0 ),
     mnLastRecId(0),
     mbBiff2HasXfs(false),
-    mbBiff2HasXfsValid(false)
+    mbBiff2HasXfsValid(false),
+    mbFuzzing(utl::ConfigManager::IsFuzzing())
 {
     nBdshtTab = 0;
 
@@ -979,7 +980,11 @@ void ImportExcel::Cellmerging()
         maStrm >> aXclRange;    // 16-bit rows and columns
         ScRange aScRange( ScAddress::UNINITIALIZED );
         if( rAddrConv.ConvertRange( aScRange, aXclRange, nScTab, nScTab, true 
) )
-            GetXFRangeBuffer().SetMerge( aScRange.aStart.Col(), 
aScRange.aStart.Row(), aScRange.aEnd.Col(), aScRange.aEnd.Row() );
+        {
+            const bool bTooSlowForFuzzing = mbFuzzing && (aScRange.aEnd.Col() 
> 512 || aScRange.aEnd.Row() > 512);
+            if (!bTooSlowForFuzzing)
+                GetXFRangeBuffer().SetMerge( aScRange.aStart.Col(), 
aScRange.aStart.Row(), aScRange.aEnd.Col(), aScRange.aEnd.Row() );
+        }
         ++nIdx;
     }
 }
@@ -1102,7 +1107,7 @@ void ImportExcel::TableOp()
     sal_uInt16 nInpRow2 = aIn.ReaduInt16();
     sal_uInt16 nInpCol2 = aIn.ReaduInt16();
 
-    if (utl::ConfigManager::IsFuzzing())
+    if (mbFuzzing)
     {
         //shrink to smallish arbitrary value to not timeout
         nLastRow = std::min<sal_uInt16>(nLastRow, MAXROW_30 / 2);
diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx
index 1b791bb72a1e..398ae11827b0 100644
--- a/sc/source/filter/inc/imp_op.hxx
+++ b/sc/source/filter/inc/imp_op.hxx
@@ -115,6 +115,7 @@ protected:
 
     bool mbBiff2HasXfs:1;      /// Select XF formatting or direct formatting 
in BIFF2.
     bool mbBiff2HasXfsValid:1; /// False = mbBiff2HasXfs is undetermined yet.
+    bool mbFuzzing:1;          /// True if fuzzing filter
 
     void SetLastFormula( SCCOL nCol, SCROW nRow, double fVal, sal_uInt16 nXF, 
ScFormulaCell* pCell );
 

Reply via email to