summaryrefslogtreecommitdiff
path: root/sc/inc/table.hxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-11-04 15:19:13 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2022-11-21 12:37:18 +0100
commit0a55aa8ba38aea56a2bce1504fd687e510f66b9d (patch)
treed1d14abf8c4718be2728d8c8b25cddba283082d8 /sc/inc/table.hxx
parentd29349a3f8808e650a9432bd087e352845e8b0d3 (diff)
calc: cache GetCellArea results
This will avoid repeated lookup in the ScTable::GetCellArea. Which is used for vcl::ITiledRenderable::getDataArea(). Tested in CppunitTest_sc_ucalc Change-Id: Ied58cfe447e1b924af9b401e95e127c784b80355 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142279 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142995 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc/inc/table.hxx')
-rw-r--r--sc/inc/table.hxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index a9d2ad71bd39..f81e3925964e 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -178,6 +178,12 @@ private:
SCROW nRepeatStartY;
SCROW nRepeatEndY;
+ // last used col and row
+ bool mbCellAreaDirty;
+ bool mbCellAreaEmpty;
+ SCCOL mnEndCol;
+ SCROW mnEndRow;
+
std::unique_ptr<ScTableProtection> pTabProtection;
std::unique_ptr<ScCompressedArray<SCCOL, sal_uInt16>> mpColWidth;
@@ -604,7 +610,8 @@ public:
void InvalidateTableArea();
void InvalidatePageBreaks();
- bool GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const; // FALSE = empty
+ void InvalidateCellArea() { mbCellAreaDirty = true; }
+ bool GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ); // FALSE = empty
bool GetTableArea( SCCOL& rEndCol, SCROW& rEndRow, bool bCalcHiddens = false) const;
bool GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, bool bNotes, bool bCalcHiddens = false) const;
bool GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow,