diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-03-27 05:11:20 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-03-30 03:43:12 +0000 |
commit | 5ecda97eeab36ceab022458345f2c61c31ab2d94 (patch) | |
tree | ea600db36ed5395e95e11c539aa42bb2794b68a5 /sc | |
parent | f11a228cfd326bc089d7ff1c11a1561cdf5ee986 (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>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/fillinfo.cxx | 110 |
1 files changed, 59 insertions, 51 deletions
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index ed5e9dcdfedb..99d58c1b9259 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 { |