sc/inc/fillinfo.hxx | 40 +++++++++++++++++++-------------------- sc/source/core/data/fillinfo.cxx | 22 ++++++++++----------- sc/source/ui/view/gridwin4.cxx | 4 +-- sc/source/ui/view/output.cxx | 14 ++++++------- sc/source/ui/view/output2.cxx | 20 +++++++++---------- sc/source/ui/view/printfun.cxx | 4 +-- 6 files changed, 52 insertions(+), 52 deletions(-)
New commits: commit 77ebac1021e1e795b6c6a7456a2ed8c56dd9370c Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Sat Feb 26 18:49:58 2022 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Sun Feb 27 08:22:38 2022 +0100 prefix CellInfo and BasicCellInfo with Sc CellInfo is a pretty generic term to be used in the global namespace. Change-Id: I9a2ce6b7b2157f75d7213321c615fc9636817252 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130608 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/sc/inc/fillinfo.hxx b/sc/inc/fillinfo.hxx index d6ab0bd537c6..e348f7648bc7 100644 --- a/sc/inc/fillinfo.hxx +++ b/sc/inc/fillinfo.hxx @@ -98,11 +98,11 @@ struct ScIconSetInfo // FillInfo() computes some info for all cells starting from column 0, // but most of the info is needed only for cells in the given columns. -// Keeping all the info in CellInfo could lead to allocation and initialization +// Keeping all the info in ScCellInfo could lead to allocation and initialization // of MiB's of memory, so split the info needed for all cells to a smaller structure. -struct BasicCellInfo +struct ScBasicCellInfo { - BasicCellInfo() + ScBasicCellInfo() : nWidth(0) , bEmptyCellText(true) , bEditEngine(false) // view-internal @@ -112,9 +112,9 @@ struct BasicCellInfo bool bEditEngine : 1; // output-internal }; -struct CellInfo +struct ScCellInfo { - CellInfo() + ScCellInfo() : pPatternAttr(nullptr) , pConditionSet(nullptr) , pDataBar(nullptr) @@ -142,8 +142,8 @@ struct CellInfo { } - CellInfo(const CellInfo&) = delete; - const CellInfo& operator=(const CellInfo&) = delete; + ScCellInfo(const ScCellInfo&) = delete; + const ScCellInfo& operator=(const ScCellInfo&) = delete; ScRefCellValue maCell; @@ -188,7 +188,7 @@ struct RowInfo RowInfo(const RowInfo&) = delete; const RowInfo& operator=(const RowInfo&) = delete; - CellInfo& cellInfo(SCCOL nCol) + ScCellInfo& cellInfo(SCCOL nCol) { assert( nCol >= nStartCol - 1 ); #ifdef DBG_UTIL @@ -196,12 +196,12 @@ struct RowInfo #endif return pCellInfo[ nCol - nStartCol + 1 ]; } - const CellInfo& cellInfo(SCCOL nCol) const + const ScCellInfo& cellInfo(SCCOL nCol) const { return const_cast<RowInfo*>(this)->cellInfo(nCol); } - BasicCellInfo& basicCellInfo(SCCOL nCol) + ScBasicCellInfo& basicCellInfo(SCCOL nCol) { assert( nCol >= -1 ); #ifdef DBG_UTIL @@ -209,7 +209,7 @@ struct RowInfo #endif return pBasicCellInfo[ nCol + 1 ]; } - const BasicCellInfo& basicCellInfo(SCCOL nCol) const + const ScBasicCellInfo& basicCellInfo(SCCOL nCol) const { return const_cast<RowInfo*>(this)->basicCellInfo(nCol); } @@ -220,8 +220,8 @@ struct RowInfo #ifdef DBG_UTIL nEndCol = endCol; #endif - pCellInfo = new CellInfo[ endCol - nStartCol + 1 + 2 ]; - pBasicCellInfo = new BasicCellInfo[ endCol + 2 ]; + pCellInfo = new ScCellInfo[ endCol - nStartCol + 1 + 2 ]; + pBasicCellInfo = new ScBasicCellInfo[ endCol + 2 ]; } void freeCellInfo() { @@ -239,13 +239,13 @@ struct RowInfo bool bChanged:1; // TRUE, if not tested private: - // This class allocates CellInfo with also one item extra before and after. + // This class allocates ScCellInfo with also one item extra before and after. // To make handling easier, this is private and access functions take care of adjusting - // the array indexes and error-checking. CellInfo is allocated only for a given - // range of columns plus one on each side, BasicCellInfo is allocated for columns + // the array indexes and error-checking. ScCellInfo is allocated only for a given + // range of columns plus one on each side, ScBasicCellInfo is allocated for columns // starting from column 0 until the last column given, again plus one on each side. - CellInfo* pCellInfo; - BasicCellInfo* pBasicCellInfo; + ScCellInfo* pCellInfo; + ScBasicCellInfo* pBasicCellInfo; SCCOL nStartCol; #ifdef DBG_UTIL SCCOL nEndCol; @@ -275,8 +275,8 @@ struct ScTableInfo mIconSetInfos.push_back(std::move(info)); } private: - // These are owned here and not in CellInfo to avoid freeing - // memory for every pointer in CellInfo, most of which are nullptr. + // These are owned here and not in ScCellInfo to avoid freeing + // memory for every pointer in ScCellInfo, most of which are nullptr. std::vector<std::unique_ptr<const ScDataBarInfo>> mDataBarInfos; std::vector<std::unique_ptr<const ScIconSetInfo>> mIconSetInfos; }; diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 3e7931620ba2..ccff98180089 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -53,7 +53,7 @@ static void lcl_GetMergeRange( SCCOL nX, SCROW nY, SCSIZE nArrY, SCCOL nX1, SCROW nY1, SCTAB nTab, SCCOL& rStartX, SCROW& rStartY, SCCOL& rEndX, SCROW& rEndY ) { - CellInfo* pInfo = &pRowInfo[nArrY].cellInfo(nX); + ScCellInfo* pInfo = &pRowInfo[nArrY].cellInfo(nX); rStartX = nX; rStartY = nY; @@ -258,7 +258,7 @@ void initCellInfo(RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nStartCol, SCCOL nR for (SCCOL nCol = nMinCol-1; nCol <= nRotMax+1; ++nCol) // Preassign cell info { - CellInfo& rInfo = rThisRowInfo.cellInfo(nCol); + ScCellInfo& rInfo = rThisRowInfo.cellInfo(nCol); rInfo.pShadowAttr = pDefShadow; } } @@ -283,7 +283,7 @@ void initColWidths(RowInfo* pRowInfo, const ScDocument* pDoc, double fColScale, } bool handleConditionalFormat(ScConditionalFormatList& rCondFormList, const ScCondFormatIndexes& rCondFormats, - CellInfo* pInfo, ScTableInfo* pTableInfo, ScStyleSheetPool* pStlPool, + ScCellInfo* pInfo, ScTableInfo* pTableInfo, ScStyleSheetPool* pStlPool, const ScAddress& rAddr, bool& bHidden, bool& bHideFormula, bool bTabProtect) { bool bFound = false; @@ -542,8 +542,8 @@ void ScDocument::FillInfo( if (bPivotButton || bPivotPopupButton) pThisRowInfo->bPivotButton = true; - CellInfo* pInfo = &pThisRowInfo->cellInfo(nCol); - BasicCellInfo* pBasicInfo = &pThisRowInfo->basicCellInfo(nCol); + ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nCol); + ScBasicCellInfo* pBasicInfo = &pThisRowInfo->basicCellInfo(nCol); pInfo->pBackground = pBackground; pInfo->pPatternAttr = pPattern; pInfo->bMerged = bMerged; @@ -642,7 +642,7 @@ void ScDocument::FillInfo( { for (SCCOL nCol=nCol1-1; nCol<=nCol2+1; nCol++) // 1 more left and right { - CellInfo* pInfo = &pRowInfo[nArrRow].cellInfo(nCol); + ScCellInfo* pInfo = &pRowInfo[nArrRow].cellInfo(nCol); ScPatternAttr* pModifiedPatt = nullptr; if ( ValidCol(nCol) && pRowInfo[nArrRow].nRowNo <= MaxRow() ) @@ -706,7 +706,7 @@ void ScDocument::FillInfo( for (SCCOL nCol=nCol1-1; nCol<=nCol2+1; nCol++) // 1 more left and right { - CellInfo* pInfo = &pThisRowInfo->cellInfo(nCol); + ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nCol); if (pInfo->bMerged || pInfo->bHOverlapped || pInfo->bVOverlapped) { @@ -753,7 +753,7 @@ void ScDocument::FillInfo( bool bLeft = ( nCol == nCol1-1 ); bool bRight = ( nCol == nCol2+1 ); - CellInfo* pInfo = &pRowInfo[nArrRow].cellInfo(nCol); + ScCellInfo* pInfo = &pRowInfo[nArrRow].cellInfo(nCol); const SvxShadowItem* pThisAttr = pInfo->pShadowAttr; SvxShadowLocation eLoc = pThisAttr ? pThisAttr->GetLocation() : SvxShadowLocation::NONE; if (eLoc != SvxShadowLocation::NONE) @@ -888,8 +888,8 @@ void ScDocument::FillInfo( // *** create the frame border array *** // RowInfo structs are filled in the range [ 0 , nArrCount-1 ], - // each RowInfo contains CellInfo structs in the range [ nCol1-1 , nCol2+1 ] - // and BasicCellInfo structs in the range [ -1, nCol2+1 ] + // each RowInfo contains ScCellInfo structs in the range [ nCol1-1 , nCol2+1 ] + // and ScBasicCellInfo structs in the range [ -1, nCol2+1 ] size_t nColCount = nCol2 - nCol1 + 1 + 2; size_t nRowCount = nArrCount; @@ -904,7 +904,7 @@ void ScDocument::FillInfo( for( SCCOL nCol = nCol1 - 1; nCol <= nCol2 + 1; ++nCol ) // 1 more left and right { - const CellInfo& rInfo = rThisRowInfo.cellInfo( nCol ); + const ScCellInfo& rInfo = rThisRowInfo.cellInfo( nCol ); const SvxBoxItem* pBox = rInfo.pLinesAttr; const SvxLineItem* pTLBR = rInfo.mpTLBRLine; const SvxLineItem* pBLTR = rInfo.mpBLTRLine; diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 4db0e20ce5a4..b92099ea8e1e 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -2041,7 +2041,7 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo for (nCol=nX1; nCol<=nX2; nCol++) { - CellInfo* pInfo = &pThisRowInfo->cellInfo(nCol); + ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nCol); //if several columns merged on a row, there should be only one auto button at the end of the columns. //if several rows merged on a column, the button may be in the middle, so "!pInfo->bVOverlapped" should not be used if ( pInfo->bAutoFilter && !pInfo->bHOverlapped ) @@ -2121,7 +2121,7 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo nRow = pThisRowInfo->nRowNo; for (nCol=nX1; nCol<=nX2; nCol++) { - CellInfo* pInfo = &pThisRowInfo->cellInfo(nCol); + ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nCol); if (pInfo->bHOverlapped || pInfo->bVOverlapped) continue; diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 9e4a89bd008d..045066e96689 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -631,7 +631,7 @@ void ScOutputData::SetCellRotations() for (SCCOL nX=0; nX<=nRotMax; nX++) { - CellInfo* pInfo = &pThisRowInfo->cellInfo(nX); + ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nX); const ScPatternAttr* pPattern = pInfo->pPatternAttr; const SfxItemSet* pCondSet = pInfo->pConditionSet; @@ -646,7 +646,7 @@ void ScOutputData::SetCellRotations() ScRotateDir nDir = pPattern->GetRotateDir( pCondSet ); if (nDir != ScRotateDir::NONE) { - // Needed for CellInfo internal decisions (bg fill, ...) + // Needed for ScCellInfo internal decisions (bg fill, ...) pInfo->nRotateDir = nDir; // create target coordinates @@ -1095,7 +1095,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) for (SCCOL nX=nX1; nX + nMergedCols <= nX2 + 1; nX += nOldMerged) { - CellInfo* pInfo = &pThisRowInfo->cellInfo(nX-1+nMergedCols); + ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nX-1+nMergedCols); nOldMerged = nMergedCols; @@ -1554,7 +1554,7 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext) { if (nX==nX1) nPosX = nInitPosX; // calculated individually for preceding positions - CellInfo* pInfo = &rThisRowInfo.cellInfo(nX); + ScCellInfo* pInfo = &rThisRowInfo.cellInfo(nX); tools::Long nColWidth = pRowInfo[0].basicCellInfo(nX).nWidth; if ( pInfo->nRotateDir > ScRotateDir::Standard && !pInfo->bHOverlapped && !pInfo->bVOverlapped ) @@ -2329,7 +2329,7 @@ void ScOutputData::DrawNoteMarks(vcl::RenderContext& rRenderContext) tools::Long nPosX = nInitPosX; for (SCCOL nX=nX1; nX<=nX2; nX++) { - CellInfo* pInfo = &pThisRowInfo->cellInfo(nX); + ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nX); bool bIsMerged = false; if ( nX==nX1 && pInfo->bHOverlapped && !pInfo->bVOverlapped ) @@ -2404,7 +2404,7 @@ void ScOutputData::AddPDFNotes() tools::Long nPosX = nInitPosX; for (SCCOL nX=nX1; nX<=nX2; nX++) { - CellInfo* pInfo = &pThisRowInfo->cellInfo(nX); + ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nX); bool bIsMerged = false; SCROW nY = pRowInfo[nArrY].nRowNo; SCCOL nMergeX = nX; @@ -2495,7 +2495,7 @@ void ScOutputData::DrawClipMarks() tools::Long nPosX = nInitPosX; for (SCCOL nX=nX1; nX<=nX2; nX++) { - CellInfo* pInfo = &pThisRowInfo->cellInfo(nX); + ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nX); if (pInfo->nClipMark != ScClipMark::NONE) { if (pInfo->bHOverlapped || pInfo->bVOverlapped) diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 7de62adfe8dd..ba999ad98580 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -991,7 +991,7 @@ bool ScOutputData::GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY, if (!mpDoc->ColHidden(nX, nTab) && nX >= nX1 && nX <= nX2 && !mpDoc->RowHidden(nY, nTab) && nY >= nY1 && nY <= nY2) { - CellInfo* pInfo = &pRowInfo[nArrY].cellInfo(nX); + ScCellInfo* pInfo = &pRowInfo[nArrY].cellInfo(nX); bHOver = pInfo->bHOverlapped; bVOver = pInfo->bVOverlapped; } @@ -1570,7 +1570,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co for (SCCOL nX=nLoopStartX; nX<=nX2; nX++) { bool bMergeEmpty = false; - const CellInfo* pInfo = &pThisRowInfo->cellInfo(nX); + const ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nX); bool bEmpty = nX < nX1 || pThisRowInfo->basicCellInfo(nX).bEmptyCellText; SCCOL nCellX = nX; // position where the cell really starts @@ -1679,7 +1679,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co { if ( nCellY == nY && nCellX >= nX1 && nCellX <= nX2 ) { - CellInfo& rCellInfo = pThisRowInfo->cellInfo(nCellX); + ScCellInfo& rCellInfo = pThisRowInfo->cellInfo(nCellX); pPattern = rCellInfo.pPatternAttr; pCondSet = rCellInfo.pConditionSet; @@ -1892,7 +1892,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co } if (bUseEditEngine) { - // mark the cell in CellInfo to be drawn in DrawEdit: + // mark the cell in ScCellInfo to be drawn in DrawEdit: // Cells to the left are marked directly, cells to the // right are handled by the flag for nX2 SCCOL nMarkX = ( nCellX <= nX2 ) ? nCellX : nX2; @@ -3124,7 +3124,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) rParam.mbBreak && bMarkClipped && ( rParam.mpEngine->GetParagraphCount() > 1 || rParam.mpEngine->GetLineCount(0) > 1 ) ) { - CellInfo* pClipMarkCell = nullptr; + ScCellInfo* pClipMarkCell = nullptr; if ( bMerged ) { // anywhere in the merged area... @@ -3229,7 +3229,7 @@ void ScOutputData::ShowClipMarks( DrawEditParam& rParam, tools::Long nEngineWidt || (rParam.mpEngine->GetParagraphCount() <= 1 && rParam.mpEngine->GetLineCount(0) <= 1)) return; - CellInfo* pClipMarkCell = nullptr; + ScCellInfo* pClipMarkCell = nullptr; if (bMerged) { // anywhere in the merged area... @@ -3965,7 +3965,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam) rParam.mbBreak && bMarkClipped && ( rParam.mpEngine->GetParagraphCount() > 1 || rParam.mpEngine->GetLineCount(0) > 1 ) ) { - CellInfo* pClipMarkCell = nullptr; + ScCellInfo* pClipMarkCell = nullptr; if ( bMerged ) { // anywhere in the merged area... @@ -4252,7 +4252,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam) !rParam.mbAsianVertical && bMarkClipped && ( rParam.mpEngine->GetParagraphCount() > 1 || rParam.mpEngine->GetLineCount(0) > 1 ) ) { - CellInfo* pClipMarkCell = nullptr; + ScCellInfo* pClipMarkCell = nullptr; if ( bMerged ) { // anywhere in the merged area... @@ -4407,7 +4407,7 @@ void ScOutputData::DrawEdit(bool bPixelToLogic) if ( nCellY == nY && nCellX >= nX1 && nCellX <= nX2 && !mpDoc->ColHidden(nCellX, nTab) ) { - CellInfo& rCellInfo = pThisRowInfo->cellInfo(nCellX); + ScCellInfo& rCellInfo = pThisRowInfo->cellInfo(nCellX); pPattern = rCellInfo.pPatternAttr; pCondSet = rCellInfo.pConditionSet; aCell = rCellInfo.maCell; @@ -4550,7 +4550,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) { if (nX==nX1) nPosX = nInitPosX; // positions before nX1 are calculated individually - const CellInfo* pInfo = &pThisRowInfo->cellInfo(nX); + const ScCellInfo* pInfo = &pThisRowInfo->cellInfo(nX); if ( pInfo->nRotateDir != ScRotateDir::NONE ) { SCROW nY = pThisRowInfo->nRowNo; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index cecaa80afa51..f01892b1818b 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -443,8 +443,8 @@ static void lcl_HidePrint( const ScTableInfo& rTabInfo, SCCOL nX1, SCCOL nX2 ) RowInfo* pThisRowInfo = &rTabInfo.mpRowInfo[nArrY]; for (SCCOL nX=nX1; nX<=nX2; nX++) { - CellInfo& rCellInfo = pThisRowInfo->cellInfo(nX); - BasicCellInfo& rBasicCellInfo = pThisRowInfo->basicCellInfo(nX); + ScCellInfo& rCellInfo = pThisRowInfo->cellInfo(nX); + ScBasicCellInfo& rBasicCellInfo = pThisRowInfo->basicCellInfo(nX); if (!rBasicCellInfo.bEmptyCellText) if (rCellInfo.pPatternAttr-> GetItem(ATTR_PROTECTION, rCellInfo.pConditionSet).GetHidePrint())