summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-27 05:11:20 +0200
committerAshod Nakashian <ashnakash@gmail.com>2016-05-22 03:34:30 +0000
commit40b2e53d22347e625cd22f0ac8fd6c79165b3703 (patch)
tree4a51fba0678e41010a7c0c55d34f08fddf87fea4
parent7c942ee446ff357d2cd874913b15b4d641ed1ba6 (diff)
extract another function from ScDocument::FillInfo
Change-Id: If6f898d514dc454a7f1c5448769a95269e9066d7 Reviewed-on: https://gerrit.libreoffice.org/23550 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 5ecda97eeab36ceab022458345f2c61c31ab2d94) Reviewed-on: https://gerrit.libreoffice.org/25285 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
-rw-r--r--sc/source/core/data/fillinfo.cxx110
1 files changed, 59 insertions, 51 deletions
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index ca0ac9286b64..6e5dc7b9f1de 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
{