Kaydet (Commit) 4c338a32 authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Ashod Nakashian

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.

Change-Id: Ib0e475513bc3ba98fff66a5b9d405aeba1057331
Reviewed-on: https://gerrit.libreoffice.org/25293Reviewed-by: 's avatarAshod Nakashian <ashnakash@gmail.com>
Tested-by: 's avatarAshod Nakashian <ashnakash@gmail.com>
üst 4475acb6
......@@ -195,10 +195,11 @@ struct ScTableInfo
{
svx::frame::Array maArray;
RowInfo* mpRowInfo;
sal_uInt16 mnArrCount;
sal_uInt16 mnArrCount;
sal_uInt16 mnArrCapacity;
bool mbPageMode;
explicit ScTableInfo();
explicit ScTableInfo(const sal_uInt16 capacity = 1024);
~ScTableInfo();
ScTableInfo(const ScTableInfo&) = delete;
const ScTableInfo& operator=(const ScTableInfo&) = delete;
......
......@@ -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
......@@ -1125,17 +1123,18 @@ void ScDocument::FillInfo(
rArray.MirrorSelfX( true, false );
}
ScTableInfo::ScTableInfo()
: mpRowInfo(new RowInfo[ROWINFO_MAX])
ScTableInfo::ScTableInfo(const sal_uInt16 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( sal_uInt16 nIdx = 0; nIdx < mnArrCapacity; ++nIdx )
delete [] mpRowInfo[ nIdx ].pCellInfo;
delete [] mpRowInfo;
}
......
......@@ -975,7 +975,7 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
double fPPTX = pViewData->GetPPTX();
double fPPTY = pViewData->GetPPTY();
ScTableInfo aTabInfo;
ScTableInfo aTabInfo(nEndRow + 2);
pDoc->FillInfo(aTabInfo, nStartCol, nStartRow, nEndCol, nEndRow, nTab, fPPTX, fPPTY, false, false, NULL);
ScOutputData aOutputData(&rDevice, OUTTYPE_WINDOW, aTabInfo, pDoc, nTab,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment