[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - 2 commits - sc/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Sun May 22 03:34:38 UTC 2016
sc/source/core/data/fillinfo.cxx | 115 +++++++++++++++++++++------------------
1 file changed, 62 insertions(+), 53 deletions(-)
New commits:
commit 40b2e53d22347e625cd22f0ac8fd6c79165b3703
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Mar 27 05:11:20 2016 +0200
extract another function from ScDocument::FillInfo
Change-Id: If6f898d514dc454a7f1c5448769a95269e9066d7
Reviewed-on: https://gerrit.libreoffice.org/23550
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
(cherry picked from commit 5ecda97eeab36ceab022458345f2c61c31ab2d94)
Reviewed-on: https://gerrit.libreoffice.org/25285
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index ca0ac92..6e5dc7b 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -261,6 +261,63 @@ void initRowInfo(ScDocument* pDoc, RowInfo* pRowInfo, SCROW& rY,
}
}
+void initCellInfo(RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nRotMax, bool bPaintMarks,
+ const SvxShadowItem* pDefShadow, SCROW nBlockStartY, SCROW nBlockEndY,
+ SCCOL nBlockStartX, SCCOL nBlockEndX)
+{
+ for (SCSIZE nArrRow = 0; nArrRow < nArrCount; nArrRow++)
+ {
+ RowInfo* pThisRowInfo = &pRowInfo[nArrRow];
+ SCROW nY = pThisRowInfo->nRowNo;
+ pThisRowInfo->pCellInfo = new CellInfo[ nRotMax+1+2 ]; // to delete the caller!
+
+ for (SCCOL nArrCol = 0; nArrCol <= nRotMax+2; nArrCol++) // Preassign cell info
+ {
+ SCCOL nX;
+ if (nArrCol>0)
+ nX = nArrCol-1;
+ else
+ nX = MAXCOL+1; // invalid
+
+ CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrCol];
+ pInfo->bEmptyCellText = true;
+ pInfo->maCell.clear();
+ if (bPaintMarks)
+ pInfo->bMarked = ( nX >= nBlockStartX && nX <= nBlockEndX
+ && nY >= nBlockStartY && nY <= nBlockEndY );
+ else
+ pInfo->bMarked = false;
+ pInfo->nWidth = 0;
+
+ pInfo->nClipMark = SC_CLIPMARK_NONE;
+ pInfo->bMerged = false;
+ pInfo->bHOverlapped = false;
+ pInfo->bVOverlapped = false;
+ pInfo->bAutoFilter = false;
+ pInfo->bPivotButton = false;
+ pInfo->bPivotPopupButton = false;
+ pInfo->bFilterActive = false;
+ pInfo->nRotateDir = SC_ROTDIR_NONE;
+
+ pInfo->bPrinted = false; // view-internal
+ pInfo->bHideGrid = false; // view-internal
+ pInfo->bEditEngine = false; // view-internal
+
+ pInfo->pBackground = nullptr; //TODO: omit?
+ pInfo->pPatternAttr = nullptr;
+ pInfo->pConditionSet= nullptr;
+
+ pInfo->pLinesAttr = nullptr;
+ pInfo->mpTLBRLine = nullptr;
+ pInfo->mpBLTRLine = nullptr;
+
+ pInfo->pShadowAttr = pDefShadow;
+ pInfo->pHShadowOrigin = nullptr;
+ pInfo->pVShadowOrigin = nullptr;
+ }
+ }
+}
+
}
void ScDocument::FillInfo(
@@ -352,57 +409,8 @@ void ScDocument::FillInfo(
// Allocate cell information only after the test rotation
// to nRotMax due to nRotateDir Flag
-
- for (nArrRow=0; nArrRow<nArrCount; nArrRow++)
- {
- RowInfo* pThisRowInfo = &pRowInfo[nArrRow];
- nY = pThisRowInfo->nRowNo;
- pThisRowInfo->pCellInfo = new CellInfo[ nRotMax+1+2 ]; // to delete the caller!
-
- for (nArrCol=0; nArrCol<=nRotMax+2; nArrCol++) // Preassign cell info
- {
- if (nArrCol>0)
- nX = nArrCol-1;
- else
- nX = MAXCOL+1; // invalid
-
- CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrCol];
- pInfo->bEmptyCellText = true;
- pInfo->maCell.clear();
- if (bPaintMarks)
- pInfo->bMarked = ( nX >= nBlockStartX && nX <= nBlockEndX
- && nY >= nBlockStartY && nY <= nBlockEndY );
- else
- pInfo->bMarked = false;
- pInfo->nWidth = 0;
-
- pInfo->nClipMark = SC_CLIPMARK_NONE;
- pInfo->bMerged = false;
- pInfo->bHOverlapped = false;
- pInfo->bVOverlapped = false;
- pInfo->bAutoFilter = false;
- pInfo->bPivotButton = false;
- pInfo->bPivotPopupButton = false;
- pInfo->bFilterActive = false;
- pInfo->nRotateDir = SC_ROTDIR_NONE;
-
- pInfo->bPrinted = false; // view-internal
- pInfo->bHideGrid = false; // view-internal
- pInfo->bEditEngine = false; // view-internal
-
- pInfo->pBackground = nullptr; //TODO: omit?
- pInfo->pPatternAttr = nullptr;
- pInfo->pConditionSet= nullptr;
-
- pInfo->pLinesAttr = nullptr;
- pInfo->mpTLBRLine = nullptr;
- pInfo->mpBLTRLine = nullptr;
-
- pInfo->pShadowAttr = pDefShadow;
- pInfo->pHShadowOrigin = nullptr;
- pInfo->pVShadowOrigin = nullptr;
- }
- }
+ initCellInfo(pRowInfo, nArrCount, nRotMax, bPaintMarks, pDefShadow,
+ nBlockStartY, nBlockEndY, nBlockStartX, nBlockEndX);
for (nArrCol=nCol2+3; nArrCol<=nRotMax+2; nArrCol++) // Add remaining widths
{
commit 7c942ee446ff357d2cd874913b15b4d641ed1ba6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Mar 29 18:59:24 2016 +0200
that should not have become part of the previous commit
Change-Id: Ia116e5f9fdbd34cd1017ec1f2dabf6e581c4c707
(cherry picked from commit 789a3e61785a2458429890e28ad9a37fab8cdade)
Reviewed-on: https://gerrit.libreoffice.org/25284
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index b8955b9..ca0ac92 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -444,16 +444,17 @@ void ScDocument::FillInfo(
ScColumn* pThisCol = &maTabs[nTab]->aCol[nX]; // Column data
- nArrRow = 0;
+ 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, std::max<SCROW>(0 , nRow1 - 1), nYExtra, aFunc);
+ pThisCol->maCells.begin(), pThisCol->maCells, nRow1, nRow2, aFunc);
if (nX+1 >= nCol1) // Attribute/Blockmark from nX1-1
{
ScAttrArray* pThisAttrArr = pThisCol->pAttrArray; // Attribute
+ nArrRow = 0;
const ScPatternAttr* pPattern;
SCROW nCurRow=nRow1; // single rows
More information about the Libreoffice-commits
mailing list