diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-04-03 13:21:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-04-03 17:50:31 +0200 |
commit | 3c10a1a4ce65496877d8fc78359f9b7e59d2703c (patch) | |
tree | 75b862e562550813441ba3e72bb34ab9513bff7b /sc/inc | |
parent | 61337efb8c6a434a88a82dd2819edf600e867aa4 (diff) |
reduce cost of displaying sheets with conditional formatting
shaves off 1-2% of the cost by stack-allocating some iterator objects
Change-Id: I509d4de6c59db086f112d83768a24c11dd5d0872
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165745
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/column.hxx | 3 | ||||
-rw-r--r-- | sc/inc/dociter.hxx | 11 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index e8dec1fb437a..39b192bb68ef 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -26,6 +26,7 @@ #include "rangelst.hxx" #include "types.hxx" #include "mtvelements.hxx" +#include "attarray.hxx" #include <formula/types.hxx> #include <svl/zforlist.hxx> #include <svx/svdobj.hxx> @@ -165,7 +166,7 @@ public: bool HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) const; bool HasAttrib( SCROW nRow, HasAttrFlags nMask, SCROW* nStartRow = nullptr, SCROW* nEndRow = nullptr ) const; - std::unique_ptr<ScAttrIterator> CreateAttrIterator( SCROW nStartRow, SCROW nEndRow ) const; + ScAttrIterator CreateAttrIterator( SCROW nStartRow, SCROW nEndRow ) const; bool IsAllAttrEqual( const ScColumnData& rCol, SCROW nStartRow, SCROW nEndRow ) const; diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx index 6be5a77e5e5b..190d284a39e8 100644 --- a/sc/inc/dociter.hxx +++ b/sc/inc/dociter.hxx @@ -26,12 +26,14 @@ #include "cellvalue.hxx" #include "mtvelements.hxx" #include "queryparam.hxx" +#include "attarray.hxx" #include <vcl/outdev.hxx> #include <vcl/vclptr.hxx> #include <memory> #include <set> #include <vector> +#include <optional> class ScDocument; class ScPatternAttr; @@ -255,13 +257,11 @@ private: SCROW nStartRow; SCROW nEndRow; SCCOL nCol; - std::unique_ptr<ScAttrIterator> - pColIter; + std::optional<ScAttrIterator> moColIter; public: ScDocAttrIterator(ScDocument& rDocument, SCTAB nTable, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); - ~ScDocAttrIterator(); const ScPatternAttr* GetNext( SCCOL& rCol, SCROW& rRow1, SCROW& rRow2 ); }; @@ -277,13 +277,12 @@ private: SCROW nEndRow; SCCOL nIterStartCol; SCCOL nIterEndCol; - std::unique_ptr<ScAttrIterator> - pColIter; + std::optional<ScAttrIterator> + moColIter; public: ScAttrRectIterator(ScDocument& rDocument, SCTAB nTable, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); - ~ScAttrRectIterator(); void DataChanged(); const ScPatternAttr* GetNext( SCCOL& rCol1, SCCOL& rCol2, SCROW& rRow1, SCROW& rRow2 ); |