tdf#124997: only skip parsing non-empty cells for unallocated columns
Otherwise, not-yet-allocated columns have STD_COL_WIDTH (1280), while
normal columns have widths like 82 (pixel), making the oversized grid
look as if the columns not having vertical lines at all.
Also, we need to consider default attrubutes here, to properly render
cell properties like borders and background for unallocated columns.
Regression after commit 7282014e362a1529a36c88eb308df8ed359c2cfa
Change-Id: Ibb37c0c621d009bda2c5c0176cf5d3b238c45964
Reviewed-on: https://gerrit.libreoffice.org/71408
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index aef2e64..35c164d 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -433,7 +433,7 @@ void ScDocument::FillInfo(
{
SCCOL nX = (nArrCol>0) ? nArrCol-1 : MAXCOL+1; // negative -> invalid
if ( ValidCol(nX) && nX < maTabs[nTab]->GetAllocatedColumnsCount() )
if (ValidCol(nX))
{
// #i58049#, #i57939# Hidden columns must be skipped here, or their attributes
// will disturb the output
@@ -447,18 +447,25 @@ void ScDocument::FillInfo(
pRowInfo[0].pCellInfo[nArrCol].nWidth = nThisWidth; //TODO: this should be enough
ScColumn* pThisCol = &maTabs[nTab]->aCol[nX]; // Column data
const ScAttrArray* pThisAttrArr; // Attribute
if (nX < maTabs[nTab]->GetAllocatedColumnsCount())
{
ScColumn* pThisCol = &maTabs[nTab]->aCol[nX]; // Column data
nArrRow = 1;
// Iterate between rows nY1 and nY2 and pick up non-empty
// cells that are not hidden.
RowInfoFiller aFunc(*this, nTab, pRowInfo, nArrCol, nArrRow);
sc::ParseAllNonEmpty(
pThisCol->maCells.begin(), pThisCol->maCells, nRow1, nRow2, aFunc);
nArrRow = 1;
// Iterate between rows nY1 and nY2 and pick up non-empty
// cells that are not hidden.
RowInfoFiller aFunc(*this, nTab, pRowInfo, nArrCol, nArrRow);
sc::ParseAllNonEmpty(pThisCol->maCells.begin(), pThisCol->maCells, nRow1, nRow2,
aFunc);
pThisAttrArr = pThisCol->pAttrArray.get();
}
else
pThisAttrArr = &maTabs[nTab]->aDefaultColAttrArray;
if (nX+1 >= nCol1) // Attribute/Blockmark from nX1-1
{
ScAttrArray* pThisAttrArr = pThisCol->pAttrArray.get(); // Attribute
nArrRow = 0;
SCROW nCurRow=nRow1; // single rows