diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-05-21 23:10:35 -0400 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-26 19:06:37 +0000 |
commit | bdb112ea8bcf6f6f80483c31af05fefb2a40e026 (patch) | |
tree | 6c726eec0ffd5212796cf302734caece6ebcba27 /sc/source/core | |
parent | d4188f643db050c962a937547d19a9a08bd2235d (diff) |
sc lok bccu#1610 - Tiles not rendering in large spreadsheets
Variable max info rows instead of hard-coded allows
for collecting info on more rows.
FillInfo, however, is extremely slow for large
row count (a few thousand) and needs improving.
Reviewed-on: https://gerrit.libreoffice.org/25293
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 4c338a328d6be0450bfdcb08876abfd149cb80ca)
Change-Id: Ib0e475513bc3ba98fff66a5b9d405aeba1057331
Reviewed-on: https://gerrit.libreoffice.org/25423
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/fillinfo.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 8cd7534ade82..6f7155070b09 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -46,8 +46,6 @@ #include <memory> #include <o3tl/make_unique.hxx> -const sal_uInt16 ROWINFO_MAX = 1024; - enum FillInfoLinePos { FILP_TOP, @@ -209,7 +207,7 @@ bool isRotateItemUsed(ScDocumentPool *pPool) return false; } -void initRowInfo(ScDocument* pDoc, RowInfo* pRowInfo, +void initRowInfo(ScDocument* pDoc, RowInfo* pRowInfo, const SCSIZE nMaxRow, double fRowScale, SCROW nRow1, SCTAB nTab, SCROW& rYExtra, SCSIZE& rArrRow, SCROW& rRow2) { sal_uInt16 nDocHeight = ScGlobal::nStdRowHeight; @@ -249,7 +247,7 @@ void initRowInfo(ScDocument* pDoc, RowInfo* pRowInfo, pThisRowInfo->nRotMaxCol = SC_ROTMAX_NONE; ++rArrRow; - if (rArrRow >= ROWINFO_MAX) + if (rArrRow >= nMaxRow) { OSL_FAIL("FillInfo: Range too big" ); rYExtra = nSignedY; // End @@ -434,7 +432,7 @@ void ScDocument::FillInfo( nArrRow=0; SCROW nYExtra = nRow2+1; - initRowInfo(this, pRowInfo, fRowScale, nRow1, + initRowInfo(this, pRowInfo, rTabInfo.mnArrCapacity, fRowScale, nRow1, nTab, nYExtra, nArrRow, nRow2); nArrCount = nArrRow; // incl. Dummys @@ -1124,17 +1122,18 @@ void ScDocument::FillInfo( rArray.MirrorSelfX(); } -ScTableInfo::ScTableInfo() - : mpRowInfo(new RowInfo[ROWINFO_MAX]) +ScTableInfo::ScTableInfo(const SCSIZE capacity) + : mpRowInfo(new RowInfo[capacity]) , mnArrCount(0) + , mnArrCapacity(capacity) , mbPageMode(false) { - memset(mpRowInfo, 0, ROWINFO_MAX*sizeof(RowInfo)); + memset(mpRowInfo, 0, mnArrCapacity * sizeof(RowInfo)); } ScTableInfo::~ScTableInfo() { - for( sal_uInt16 nIdx = 0; nIdx < ROWINFO_MAX; ++nIdx ) + for( SCSIZE nIdx = 0; nIdx < mnArrCapacity; ++nIdx ) delete [] mpRowInfo[ nIdx ].pCellInfo; delete [] mpRowInfo; } |