sc/source/core/data/column3.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
New commits: commit 3fa6edf0b8625185fc19a76fc1e6268d99275cb0 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Dec 4 10:17:51 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Dec 4 12:15:52 2024 +0100 tdf#163010 walk pattern by range which avoids a lot of lookup cost Change-Id: I9b030f3f8402f05a5c7b03c0147ff3ffc91d1cdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177778 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index dd3f477f6c44..3b28214a913c 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2729,13 +2729,19 @@ void ScColumn::GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntri const ScPatternAttr* pPrevPattern = nullptr; ScRefCellValue aPrevCellValue; Color aPrevPatternColor; + const ScPatternAttr* pPattern = nullptr; + SCROW nPatternStartRow = -1; + SCROW nPatternEndRow = -1; while (nRow1 <= nRow2) { aCell.SetRow(nRow1); Color aBackColor; bool bCondBackColor = false; - const ScPatternAttr* pPattern = GetPattern(nRow1); + if (nRow1 <= nPatternEndRow) + ; // then the previous value of pPattern is still valid + else + pPattern = pAttrArray->GetPatternRange(nPatternStartRow, nPatternEndRow, nRow1); ScConditionalFormat* pCondFormat = rDoc.GetCondFormat(aCell.Col(), aCell.Row(), aCell.Tab()); if (pPattern) commit 6f70663c322209626bec08e3b63be6f0de663911 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Dec 4 09:28:28 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Dec 4 12:15:44 2024 +0100 tdf#163010 include GetPattern here we are already at the column data level, no need to call via ScDocument Change-Id: Ib8b0bc0f1fd9782229dc6c5240f87c086bdc970c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177777 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 825d0bb58d02..dd3f477f6c44 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2735,7 +2735,7 @@ void ScColumn::GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntri Color aBackColor; bool bCondBackColor = false; - const ScPatternAttr* pPattern = rDoc.GetPattern(aCell.Col(), aCell.Row(), aCell.Tab()); + const ScPatternAttr* pPattern = GetPattern(nRow1); ScConditionalFormat* pCondFormat = rDoc.GetCondFormat(aCell.Col(), aCell.Row(), aCell.Tab()); if (pPattern)