diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-11-06 13:06:09 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-11-06 20:19:12 +0100 |
commit | 1a47dff65bb94274c03543958b06e8a654a44d4a (patch) | |
tree | 6abd68d540d8be593dece84d5f25b035822390f5 /sc | |
parent | 6d1118245fed414114f66d2a27a5b5d022ecb3e4 (diff) |
ofz#51431 Timeout
Change-Id: Ibcaefe2f12d2cad41eb8c7e6cd2924cf2c0c8e3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142353
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/impop.cxx | 11 | ||||
-rw-r--r-- | sc/source/filter/inc/imp_op.hxx | 1 |
2 files changed, 9 insertions, 3 deletions
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 ); |