26 #include <document.hxx>
29 #include <stlpool.hxx>
41 #include <tokenarray.hxx>
62 #include <osl/diagnose.h>
69 class ColumnRegroupFormulaCells
72 std::vector<ScAddress>* mpGroupPos;
75 ColumnRegroupFormulaCells(
ScColContainer& rCols, std::vector<ScAddress>* pGroupPos ) :
76 mrCols(rCols), mpGroupPos(pGroupPos) {}
78 void operator() (
SCCOL nCol)
80 mrCols[nCol].RegroupFormulaCells(mpGroupPos);
88 return aCol[nCol].GetTextWidth(nRow);
93 sal_uInt16 nOldSizeX = 0;
94 sal_uInt16 nOldSizeY = 0;
95 sal_uInt16 nNewSizeX = 0;
96 sal_uInt16 nNewSizeY = 0;
112 return ( nNewSizeX != nOldSizeX || nNewSizeY != nOldSizeY );
142 for (
SCCOL i=nStartCol; (
i<=nEndCol) && bTest;
i++)
158 pRowFlags->SetValue( nStartRow, nStartRow + nSize - 1,
177 for (; itr1 != itr2; ++itr1)
178 aNewBreaks.insert(static_cast<SCROW>(*itr1 + nSize));
184 for (
SCCOL j=nStartCol; j<=nEndCol; j++)
198 bool* pUndoOutline, std::vector<ScAddress>* pGroupPos )
206 mpRowHeights->removeSegment(nStartRow, nStartRow+nSize);
211 *pUndoOutline =
true;
214 mpHiddenRows->removeSegment(nStartRow, nStartRow+nSize);
220 std::set<SCROW>::iterator itr2 =
maRowManualBreaks.upper_bound(static_cast<SCROW>(nStartRow + nSize - 1));
229 for (; itr1 != itr2; ++itr1)
230 aNewBreaks.insert(static_cast<SCROW>(*itr1 - nSize));
238 for (
SCCOL j=nStartCol; j<=nEndCol; j++)
242 std::vector<SCCOL> aRegroupCols;
245 aRegroupCols.begin(), aRegroupCols.end(), ColumnRegroupFormulaCells(
aCol, pGroupPos));
264 for (
auto it = range.rbegin(); it != range.rend(); ++it )
287 mpHiddenCols->insertSegment(nStartCol, static_cast<SCCOL>(nSize));
288 mpFilteredCols->insertSegment(nStartCol, static_cast<SCCOL>(nSize));
299 for (; itr1 != itr2; ++itr1)
300 aNewBreaks.insert(static_cast<SCCOL>(*itr1 + nSize));
318 std::vector<SCCOL> aRegroupCols;
320 std::for_each(aRegroupCols.begin(), aRegroupCols.end(), ColumnRegroupFormulaCells(
aCol,
nullptr));
324 sal_uInt16 nWhichArray[2];
332 false,
aCol[nStartCol+
i] );
333 aCol[nStartCol+
i].RemoveFlags( nStartRow, nEndRow,
335 aCol[nStartCol+
i].ClearItems( nStartRow, nEndRow, nWhichArray );
362 *pUndoOutline =
true;
364 SCCOL nRmSize = nStartCol +
static_cast<SCCOL>(nSize);
372 std::set<SCCOL>::iterator itr2 =
maColManualBreaks.upper_bound(static_cast<SCCOL>(nStartCol + nSize - 1));
381 for (; itr1 != itr2; ++itr1)
382 aNewBreaks.insert(static_cast<SCCOL>(*itr1 - nSize));
400 aCol[nStartCol + nSize +
i].MoveTo(nStartRow, nEndRow,
aCol[nStartCol +
i]);
403 std::vector<SCCOL> aRegroupCols;
405 std::for_each(aRegroupCols.begin(), aRegroupCols.end(), ColumnRegroupFormulaCells(
aCol,
nullptr));
424 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
425 aCol[
i].
DeleteArea(nRow1, nRow2, nDelFlag, bBroadcast, pBroadcastSpans);
457 for (
size_t i = 0;
i < aRangeList.
size(); ++
i)
459 const ScRange & rRange = aRangeList[
i];
496 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
522 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
523 pTable->
aCol[
i].RemoveProtected(nRow1, nRow2);
531 for (
size_t i = 0, nListSize = rRanges.
size();
i < nListSize; ++
i )
541 if (nCol1 > nCol2 || nRow1 > nRow2)
545 if (nFirstUnallocated > nCol1)
548 for (
SCCOL i = nCol1;
i < nFirstUnallocated; ++
i)
557 for (
SCCOL i = nFirstUnallocated;
i <= nLastInDest; ++
i)
561 rDestCol.
maCells.set_empty(nRow1, nRow2);
562 for (
SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
566 SvNumberFormatterMergeMap::const_iterator itNum = rMap.find(nNumFmt);
567 if (itNum != rMap.end())
568 nNumFmt = itNum->second;
586 rDestCol.
maCells.set_empty(nDestRow, nDestRow);
588 rDestCol.
maCellNotes.set_empty(nDestRow, nDestRow);
610 for (
size_t i = 0;
i < rNewRangeList.
size(); ++
i)
612 rDstRangeList.
Join(rNewRangeList[i]);
626 ScRange aOldRange( nCol1 - nDx, nRow1 - nDy, pTable->
nTab, nCol2 - nDx, nRow2 - nDy, pTable->
nTab);
627 ScRange aNewRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab );
632 const ScRangeList& rCondFormatRange = rxCondFormat->GetRange();
637 std::unique_ptr<ScConditionalFormat> pNewFormat = rxCondFormat->
Clone(&rDocument);
639 pNewFormat->SetRange(aIntersectedRange);
646 pNewFormat->UpdateReference(aRefCxt,
true);
648 if (bSameDoc && pTable->
nTab == nTab && CheckAndDeduplicateCondFormat(rDocument,
mpCondFormatList->GetFormat(rxCondFormat->GetKey()), pNewFormat.get(),
nTab))
653 bool bDuplicate =
false;
658 if (CheckAndDeduplicateCondFormat(rDocument, rxCond.get(), pNewFormat.get(),
nTab))
664 if (rxCond->GetKey() > nMax)
665 nMax = rxCond->GetKey();
673 pNewFormat->SetKey(nMax + 1);
674 auto pNewFormatTmp = pNewFormat.get();
675 mpCondFormatList->InsertNew(std::move(pNewFormat));
679 for(
size_t i = 0,
n = pNewFormatTmp->size();
686 aStyleName = static_cast<const ScCondFormatEntry*>(pEntry)->GetStyle();
688 aStyleName = static_cast<const ScCondDateFormatEntry*>(pEntry)->GetStyleName();
690 if(!aStyleName.isEmpty())
720 if (nCol2 > rDocument.
MaxCol())
721 nCol2 = rDocument.
MaxCol();
722 if (nRow2 > rDocument.
MaxRow())
723 nRow2 = rDocument.
MaxRow();
729 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
732 aCol[
i].CopyFromClip(rCxt, nRow1, nRow2, nDy, pTable->
aCol[
i - nDx]);
738 sal_uInt16 nWhichArray[2];
741 for (
SCCOL i = nCol1;
i <= nCol2; ++
i)
742 aCol[
i].ClearItems(nRow1, nRow2, nWhichArray);
756 for (
SCROW j=nRow1; j<=nRow2; j++)
788 bool bSkipEmpty,
const ScTable* pSrcTab )
796 class TransClipHandler
808 return ScAddress(static_cast<SCCOL>(nRow-mnTopRow), mnTransRow, mrClipTab.
GetTab());
813 ScAddress aSrcPos(mnSrcCol, nSrcRow, mnSrcTab);
819 aArr.AddSingleReference(aRef);
823 void setLink(
size_t nRow)
825 SCCOL nTransCol = nRow - mnTopRow;
827 nTransCol, mnTransRow, createRefCell(nRow, getDestPos(nRow)));
831 TransClipHandler(
ScTable& rClipTab,
SCTAB nSrcTab,
SCCOL nSrcCol,
size_t nTopRow,
SCROW nTransRow,
bool bAsLink,
bool bWasCut) :
832 mrClipTab(rClipTab), mnSrcTab(nSrcTab), mnSrcCol(nSrcCol),
833 mnTopRow(nTopRow), mnTransRow(nTransRow), mbAsLink(bAsLink), mbWasCut(bWasCut) {}
835 void operator() (
size_t nRow,
double fVal)
843 SCCOL nTransCol = nRow - mnTopRow;
844 mrClipTab.
SetValue(nTransCol, mnTransRow, fVal);
855 SCCOL nTransCol = nRow - mnTopRow;
867 SCCOL nTransCol = nRow - mnTopRow;
888 SCCOL nTransCol = nRow - mnTopRow;
902 for (
SCCOL nCol=nCol1; nCol<=nCol2; nCol++)
909 for ( nRow=nRow1; nRow<=nRow2; nRow++ )
913 ScAddress aDestPos( static_cast<SCCOL>(nRow-nRow1), static_cast<SCROW>(nCol-nCol1), pTransClip->
nTab );
921 static_cast<SCCOL>(nRow-nRow1), static_cast<SCROW>(nCol-nCol1),
927 TransClipHandler aFunc(*pTransClip, nTab, nCol, nRow1, static_cast<SCROW>(nCol-nCol1), bAsLink, bWasCut);
934 SCROW nAttrRow1 = {};
935 SCROW nAttrRow2 = {};
937 std::unique_ptr<ScAttrIterator> pAttrIter(
aCol[nCol].CreateAttrIterator( nRow1, nRow2 ));
938 while ( (pPattern = pAttrIter->Next( nAttrRow1, nAttrRow2 )) !=
nullptr )
948 for (nRow = nAttrRow1; nRow<=nAttrRow2; nRow++)
949 pTransClip->
SetPattern( static_cast<SCCOL>(nRow-nRow1), static_cast<SCROW>(nCol-nCol1), *pPattern );
961 aNew.
SetLine( rOldBox.
GetLine( SvxBoxItemLine::TOP ), SvxBoxItemLine::LEFT );
962 aNew.
SetLine( rOldBox.
GetLine( SvxBoxItemLine::LEFT ), SvxBoxItemLine::TOP );
963 aNew.
SetLine( rOldBox.
GetLine( SvxBoxItemLine::BOTTOM ), SvxBoxItemLine::RIGHT );
964 aNew.
SetLine( rOldBox.
GetLine( SvxBoxItemLine::RIGHT ), SvxBoxItemLine::BOTTOM );
976 static_cast<SCCOL>(rDocument.
MaxCol()+1 - (nAttrRow2-nRow1))),
979 static_cast<SCROW>(rDocument.
MaxRow()+1 - (nCol-nCol1)))));
990 for (nRow = nAttrRow1; nRow<=nAttrRow2; nRow++)
991 pTransClip->
SetPattern( static_cast<SCCOL>(nRow-nRow1),
992 static_cast<SCROW>(nCol-nCol1), aNewPattern);
1005 sc::CellNoteStoreType::const_iterator itBlk =
aCol[nCol].maCellNotes.
begin(), itBlkEnd =
aCol[nCol].maCellNotes.
end();
1008 size_t nOffsetInBlock = 0;
1009 size_t nBlockStart = 0, nBlockEnd = 0, nRowPos =
static_cast<size_t>(nRow1);
1010 for (; itBlk != itBlkEnd; ++itBlk, nBlockStart = nBlockEnd)
1012 nBlockEnd = nBlockStart + itBlk->size;
1013 if (nBlockStart <= nRowPos && nRowPos < nBlockEnd)
1016 nOffsetInBlock = nRowPos - nBlockStart;
1021 if (itBlk == itBlkEnd)
1025 nRowPos =
static_cast<size_t>(nRow2);
1028 sc::cellnote_block::const_iterator itData, itDataEnd;
1029 for (; itBlk != itBlkEnd; ++itBlk, nBlockStart = nBlockEnd, nOffsetInBlock = 0)
1031 nBlockEnd = nBlockStart + itBlk->size;
1035 itData = sc::cellnote_block::begin(*itBlk->data);
1036 std::advance(itData, nOffsetInBlock);
1038 if (nBlockStart <= nRowPos && nRowPos < nBlockEnd)
1041 size_t nOffsetEnd = nRowPos - nBlockStart + 1;
1042 itDataEnd = sc::cellnote_block::begin(*itBlk->data);
1043 std::advance(itDataEnd, nOffsetEnd);
1044 size_t curRow = nBlockStart + nOffsetInBlock;
1045 for (; itData != itDataEnd; ++itData, ++curRow)
1047 ScAddress aDestPos( static_cast<SCCOL>(curRow-nRow1), static_cast<SCROW>(nCol-nCol1), pTransClip->
nTab );
1052 std::unique_ptr<ScPostIt> pClonedNote = pNote->
Clone(
ScAddress(nCol, curRow, nTab), pTransClip->
rDocument, aDestPos,
true );
1060 itDataEnd = sc::cellnote_block::end(*itBlk->data);
1061 size_t curRow = nBlockStart + nOffsetInBlock;
1062 for (; itData != itDataEnd; ++itData, ++curRow)
1064 ScAddress aDestPos( static_cast<SCCOL>(curRow-nRow1), static_cast<SCROW>(nCol-nCol1), pTransClip->
nTab );
1069 std::unique_ptr<ScPostIt> pClonedNote = pNote->
Clone(
ScAddress(nCol, curRow, nTab), pTransClip->
rDocument, aDestPos,
true );
1078 for ( curRow = nBlockStart + nOffsetInBlock; curRow <= nBlockEnd && curRow <= nRowPos; ++curRow)
1080 ScAddress aDestPos( static_cast<SCCOL>(curRow-nRow1), static_cast<SCROW>(nCol-nCol1), pTransClip->
nTab );
1083 if (curRow == nRowPos)
1107 std::shared_ptr<const sc::ColumnSet> pColSet = rCxt.
getColumnSet();
1113 else if (pColSet->hasTab( nTab))
1115 std::vector<SCCOL> aColumns;
1116 pColSet->getColumns( nTab, aColumns);
1117 for (
auto i : aColumns)
1129 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
1137 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
1145 if (nCol2 > rDocument.
MaxCol()) nCol2 = rDocument.
MaxCol();
1146 if (nRow2 > rDocument.
MaxRow()) nRow2 = rDocument.
MaxRow();
1148 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
1157 if (nCol2 > rDocument.
MaxCol()) nCol2 = rDocument.
MaxCol();
1158 if (nRow2 > rDocument.
MaxRow()) nRow2 = rDocument.
MaxRow();
1160 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
1167 bool bAsLink,
bool bColRowFlags,
bool bGlobalNamesToLocal,
bool bCopyCaptions )
1190 aCol[
i].CopyToColumn(rCxt, nRow1, nRow2, bIsUndoDoc ? nFlags : nTempFlags, bMarked,
1208 pNewDBData->GetArea(aTab, aCol1, aRow1, aCol2, aRow2);
1209 pNewDBData->MoveTo(pDestTab->
nTab, aCol1, aRow1, aCol2, aRow2);
1215 bool bFlagChange =
false;
1220 if (bWidth || bHeight)
1224 auto destTabColWidthIt = pDestTab->
mpColWidth->begin() + nCol1;
1225 auto thisTabColWidthIt =
mpColWidth->begin() + nCol1;
1228 for (
SCCOL i = nCol1;
i <= nCol2; ++
i)
1231 bool bHiddenChange = (pDestTab->
ColHidden(
i) != bThisHidden);
1232 bool bChange = bHiddenChange || (*destTabColWidthIt != *thisTabColWidthIt);
1235 if (bHiddenChange && pCharts)
1241 ++destTabColWidthIt;
1242 ++thisTabColWidthIt;
1258 for (
SCROW i = nRow1;
i <= nRow2; ++
i)
1261 bool bHidden =
RowHidden(
i,
nullptr, &nLastRow);
1262 if (nLastRow >= nRow2)
1266 bool bHiddenChanged = pDestTab->
SetRowHidden(
i, nLastRow, bHidden);
1267 if (bHiddenChanged && pCharts)
1279 for (
SCROW i = nRow1;
i <= nRow2; ++
i)
1283 if (nLastRow >= nRow2)
1296 if(nFlags & InsertDeleteFlags::ATTRIB)
1313 bool bCloneCaption )
1319 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
1322 pDestTab->
aCol[
i].UpdateNoteCaptions(nRow1, nRow2);
1354 if (
i >= nCol1 &&
i <= nCol2 )
1355 aCol[
i].UndoToColumn(rCxt, nRow1, nRow2, nFlags, bMarked, rDestCol);
1363 if (!(bWidth||bHeight))
1398 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1406 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1416 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1427 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1437 for (
size_t j = 0,
n = pList->
size(); j <
n; j++ )
1439 const ScRange & rR = (*pList)[j];
1455 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1469 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1521 for (
SCCOL i = nCol1;
i <= nCol2; ++
i)
1524 SCROW nThisFirst = -1;
1525 if (const_cast<ScColumn&>(rCol).HasEditCells(nRow1, nRow2, nThisFirst))
1527 if (nThisFirst == nRow1)
1530 if (nThisFirst < nFirst)
1531 nFirst = nThisFirst;
1535 return nFirst == (rDocument.
MaxRow()+1) ? -1 : nFirst;
1543 aCol[nCol].Delete(nRow);
1588 return aCol[nCol].GetSharedString(nRow);
1606 aCol[nCol].GetString( nRow, rString, pContext );
1622 aCol[nCol].GetInputString( nRow, rString );
1630 return aCol[nCol].GetValue( nRow );
1639 return aCol[nCol].GetEditText(nRow);
1647 return aCol[nCol].RemoveEditTextCharAttribs(nRow, rAttr);
1653 aCol[nCol].GetFormula( nRow, rFormula );
1663 return aCol[nCol].GetFormulaCell(nRow);
1678 return aCol[nCol].ReleaseNote(nRow);
1686 return aCol[nCol].GetNoteCount();
1694 return aCol[nCol].GetNotePosition(nIndex);
1708 for (
SCCOL i = nCol1;
i <= nCol2; ++
i)
1725 aCol[nCol].GetNotesInRange(nStartRow, nEndRow, rNotes);
1733 bool bIsFirstNoteShownState =
true;
1734 bool bFirstControl =
true;
1741 if (bFirstControl && rDocument.
HasColNotes(nCol, nTab))
1743 aCol[nCol].GetNotesInRange(nStartRow, nEndRow, rNotes);
1744 bIsFirstNoteShownState = rNotes.
begin()->mpNote->IsCaptionShown();
1745 bFirstControl =
false;
1750 aCol[nCol].GetNotesInRange(nStartRow, nEndRow, rNotes);
1752 bool bIsMixedState = std::any_of(rNotes.begin(), rNotes.end(), [bIsFirstNoteShownState](
const sc::NoteEntry& rNote) {
1754 return bIsFirstNoteShownState != rNote.mpNote->IsCaptionShown(); });
1764 for (
auto const & pCol :
aCol)
1765 pCol->GetUnprotectedCells(0, rDocument.
MaxRow(), rRangeList);
1775 bool bContainsNote = !
aCol[nCol].IsNotesEmptyBlock(nStartRow, nEndRow);
1786 return aCol[nCol].GetCellType( nRow );
1795 return aCol[nCol].GetCellValue(nRow);
1801 rRow = rDocument.
MaxRow()+1;
1802 while (rCol < (
aCol.
size() - 1) &&
aCol[rCol].IsEmptyData() )
1805 while (nCol <
aCol.
size() && rRow > 0)
1807 if (!
aCol[nCol].IsEmptyData())
1817 while (
aCol[rCol].IsEmptyData() && (rCol > 0))
1820 while (nCol >= 0 && rRow < rDocument.
MaxRow())
1827 return aCol[nCol].HasDataAt( nRow );
1835 return aCol[nCol].HasStringData( nRow );
1843 return aCol[nCol].HasValueData( nRow );
1854 for (
SCCOL nCol = nStartCol; nCol <= nEndCol; nCol++)
1932 bool bBroadcasted =
false;
1936 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
1938 return bBroadcasted;
1970 aCol[
i].CompileXML(rCxt, rProgress);
1979 bool bCompiled =
false;
2002 for (
SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++)
2011 return &
aCol[nCol].GetAttr( nRow, nWhich );
2021 return aCol[rPos.
Col()].GetNumberFormat(rContext, rPos.
Row());
2058 OSL_FAIL(
"wrong column or row");
2067 return aCol[nCol].GetMostUsedPattern( nStartRow, nEndRow );
2079 bool bFound =
false;
2080 for (
SCCOL i=nCol1;
i<=nCol2 && !bFound;
i++)
2091 for (
SCCOLROW j = aSpan.mnStart; j <= aSpan.mnEnd; ++j)
2106 OSL_FAIL(
"ScTable::ExtendMerge: invalid column number");
2111 OSL_FAIL(
"ScTable::ExtendMerge: invalid nStartCol");
2114 bool bFound =
false;
2115 SCCOL nOldEndX = std::min( rEndCol, static_cast<SCCOL>(
aCol.
size()-1) );
2116 SCROW nOldEndY = rEndRow;
2117 for (
SCCOL i=nStartCol;
i<=nOldEndX;
i++)
2118 bFound |=
aCol[
i].
ExtendMerge(
i, nStartRow, nOldEndY, rEndCol, rEndRow, bRefresh );
2133 if (nCol1 < nCol2 && nRow1 < nRow2)
2141 OSL_FAIL(
"ScTable::IsBlockEmpty: invalid column number");
2146 for (
SCCOL i=nCol1;
i<=nCol2 && bEmpty;
i++)
2148 bEmpty =
aCol[
i].IsEmptyBlock( nRow1, nRow2 );
2149 if (!bIgnoreNotes && bEmpty)
2151 bEmpty =
aCol[
i].IsNotesEmptyBlock(nRow1, nRow2);
2169 else if ( nCol > nX2+1 )
2174 double nFactor = 0.0;
2180 double nCos = cos( nRealOrient );
2181 double nSin = sin( nRealOrient );
2187 nFactor = -fabs( nCos / nSin );
2190 for (
SCROW nRow = nAttrRow1; nRow <= nAttrRow2; nRow++ )
2194 bool bHitOne =
true;
2199 SCCOL nTouchedCol = nCol;
2201 OSL_ENSURE(nWidth <= 0,
"Wrong direction");
2202 while ( nWidth < 0 && nTouchedCol > 0 )
2207 if ( nTouchedCol > nX2 )
2213 while ( nArrY<nArrCount && pRowInfo[nArrY].nRowNo < nRow )
2215 if ( nArrY<nArrCount && pRowInfo[nArrY].nRowNo == nRow )
2230 OSL_FAIL(
"Row/column info missing" );
2246 SCROW nAttrRow1, nAttrRow2;
2252 == SfxItemState::SET )
2261 for(
const auto& rItem : rCondFormatData)
2266 size_t nEntryCount = pFormat->
size();
2267 for (
size_t nEntry=0; nEntry<nEntryCount; nEntry++)
2275 if (!aStyleName.isEmpty())
2278 pStylePool->
Find( aStyleName, SfxStyleFamily::Para );
2282 nCol, nAttrRow1, nAttrRow2,
2283 nArrY, pPattern, &pStyleSheet->
GetItemSet() );
2293 nArrY =
FillMaxRot( pRowInfo, nArrCount, nX1, nX2,
2294 nCol, nAttrRow1, nAttrRow2,
2295 nArrY, pPattern,
nullptr );
2297 pPattern = aIter.
GetNext( nAttrCol, nAttrRow1, nAttrRow2 );
2304 bool bNoMatrixAtAll )
const
2311 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
2315 if ( nCol1 == nMaxCol2 )
2318 nEdges =
aCol[nCol1].GetBlockMatrixEdges( nRow1, nRow2, n, bNoMatrixAtAll );
2319 if ((nEdges != MatrixEdge::Nothing) && (((nEdges & n)!=n) || (nEdges & (MatrixEdge::Inside|MatrixEdge::Open))))
2325 if ((nEdges != MatrixEdge::Nothing) && ((!(nEdges &
MatrixEdge::Left)) || (nEdges & (MatrixEdge::Inside|MatrixEdge::Open))))
2329 if ((nEdges != MatrixEdge::Nothing) && ((!(nEdges &
MatrixEdge::Right)) || (nEdges & (MatrixEdge::Inside|MatrixEdge::Open))))
2335 for (
SCCOL i=nCol1;
i<=nMaxCol2;
i++)
2337 nEdges =
aCol[
i].GetBlockMatrixEdges( nRow1, nRow2, MatrixEdge::Nothing, bNoMatrixAtAll);
2338 if (nEdges != MatrixEdge::Nothing
2343 else if ( nRow1 == nRow2 )
2346 const MatrixEdge n = MatrixEdge::Bottom | MatrixEdge::Top;
2347 for (
SCCOL i=nCol1;
i<=nMaxCol2;
i++)
2349 nEdges =
aCol[
i].GetBlockMatrixEdges( nRow1, nRow1, n, bNoMatrixAtAll );
2350 if (nEdges != MatrixEdge::Nothing)
2352 if ( (nEdges & n) != n )
2371 for ( j=0, n = MatrixEdge::Top, nR=nRow1; j<2;
2372 j++, n = MatrixEdge::Bottom, nR=nRow2)
2375 for (
SCCOL i=nCol1;
i<=nMaxCol2;
i++)
2377 nEdges =
aCol[
i].GetBlockMatrixEdges( nR, nR, n, bNoMatrixAtAll );
2378 if ( nEdges != MatrixEdge::Nothing)
2382 if ( (nEdges & n) != n )
2406 for (
SCCOLROW j=aSpan.mnStart; j<=nEndCol; j++ )
2416 SCROW nRow2,
bool* pOnlyNotBecauseOfMatrix ,
2417 bool bNoMatrixAtAll )
const
2421 SAL_WARN(
"sc",
"IsBlockEditable: invalid column or row " << nCol2 <<
" " << nRow2);
2422 if (pOnlyNotBecauseOfMatrix)
2423 *pOnlyNotBecauseOfMatrix =
false;
2429 bool bIsEditable =
true;
2431 bIsEditable =
false;
2447 sal_uInt16 nScenTab = nTab+1;
2450 ScRange aEditRange(nCol1, nRow1, nScenTab, nCol2, nRow2, nScenTab);
2474 ScRange aEditRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab);
2487 bIsEditable =
false;
2488 if ( pOnlyNotBecauseOfMatrix )
2489 *pOnlyNotBecauseOfMatrix =
true;
2491 else if ( pOnlyNotBecauseOfMatrix )
2492 *pOnlyNotBecauseOfMatrix =
false;
2494 else if ( pOnlyNotBecauseOfMatrix )
2495 *pOnlyNotBecauseOfMatrix =
false;
2500 bool* pOnlyNotBecauseOfMatrix )
const
2502 bool bIsEditable =
true;
2504 bIsEditable =
false;
2521 SCTAB nScenTab = nTab+1;
2522 while(rDocument.
IsScenario(nScenTab) && bIsEditable)
2526 for (
size_t i=0, nRange = aRanges.
size(); (
i < nRange) && bIsEditable;
i++ )
2528 const ScRange & rRange = aRanges[
i ];
2555 for (
size_t i = 0, nRange = aRanges.
size(); (
i < nRange) && bIsEditable;
i++)
2557 const ScRange & rRange = aRanges[
i ];
2571 bIsEditable =
false;
2572 if ( pOnlyNotBecauseOfMatrix )
2573 *pOnlyNotBecauseOfMatrix =
true;
2575 else if ( pOnlyNotBecauseOfMatrix )
2576 *pOnlyNotBecauseOfMatrix =
false;
2578 else if ( pOnlyNotBecauseOfMatrix )
2579 *pOnlyNotBecauseOfMatrix =
false;
2594 OSL_FAIL(
"UnlockTable without LockTable");
2604 for (
SCCOLROW i = rSpan.mnStart;
i <= rSpan.mnEnd; ++
i)
2627 for (
SCCOL i=nStartCol;
i<=nEndCol;
i++)
2629 nStartRow, nEndRow, (
i==nStartCol), nEndCol-
i );
2641 for (
SCCOL i=nStartCol;
i<=nEndCol;
i++)
2643 nStartRow, nEndRow, (
i==nStartCol), nEndCol-
i);
2655 bool*
const pIsChanged )
2661 for (
SCCOL i = nStartCol;
i <= nEndCol;
i++)
2670 for (
SCCOL nCol = rRange.
aStart.
Col(); nCol <= nEndCol; nCol++ )
2672 aCol[nCol].ApplyPatternIfNumberformatIncompatible( rRange, rPattern, nNewType );
2678 size_t n = rRangeList.
size();
2679 for(
size_t i = 0;
i < n; ++
i)
2681 const ScRange & rRange = rRangeList[
i];
2686 for(
SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol)
2695 size_t n = rRangeList.
size();
2696 for(
size_t i = 0;
i < n; ++
i)
2698 const ScRange & rRange = rRangeList[
i];
2703 for(
SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol)
2705 aCol[nCol].RemoveCondFormat(nRowStart, nRowEnd, nIndex);
2713 aCol[nCol].SetPatternArea( nStartRow, nEndRow, rAttr);
2715 for (
const auto& rIndex : rCondFormatIndexes)
2721 aRange.
Join(
ScRange( nCol, nStartRow, nTab, nCol, nEndRow, nTab));
2741 if ( nEndCol == rDocument.
MaxCol() )
2747 for (
SCCOL i = nStartCol;
i <= nEndCol;
i++)
2760 for (
SCCOL i = nStartCol;
i <= nEndCol;
i++)
2772 const ::editeng::SvxBorderLine* pLine,
bool bColorOnly )
2774 if ( bColorOnly && !pLine )
2804 pNewStyle =
aCol[
i].GetSelectionStyle( rMark, bColFound );
2808 if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) )
2814 return bEqual ? pStyle :
nullptr;
2828 for (
SCCOL i=nCol1;
i<=nCol2 && bEqual;
i++)
2830 pNewStyle =
aCol[
i].GetAreaStyle(bColFound, nRow1, nRow2);
2834 if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) )
2840 return bEqual ? pStyle :
nullptr;
2845 bool bIsUsed =
false;
2865 aCol[
i].FindStyleSheet(pStyleSheet, aUsedRows, bRemoved);
2869 while (nRow <= rDocument.
MaxRow())
2872 if (!aUsedRows.getRangeData(nRow, aData))
2887 bool bChanged =
false;
2889 for (
SCCOL i = nStartCol;
i <= nEndCol;
i++)
2899 bool bChanged =
false;
2901 for (
SCCOL i = nStartCol;
i <= nEndCol;
i++)
2909 aCol[rPos.
Col()].SetPattern( rPos.
Row(), rAttr );
2915 return aCol[nCol].SetPattern( nRow, std::move(pAttr) );
2922 aCol[nCol].SetPattern( nRow, rAttr );
2961 if ( nNewWidth !=
mpColWidth->GetValue(nCol) )
2969 OSL_FAIL(
"Invalid column number or no widths");
2991 OSL_FAIL(
"SetRowHeight: Row height zero");
2996 if ( nNewHeight != nOldHeight )
3004 OSL_FAIL(
"Invalid row number or no heights");
3014 bool lcl_pixelSizeChanged(
3016 sal_uInt16 nNewHeight,
double nPPTY,
bool bApi)
3021 for (
SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow)
3024 if (!aFwdIter.getValue(nRow, nHeight))
3027 if (nHeight != nNewHeight)
3033 bool bChanged = (nNewPix != nOldPix) && (bApi || nEndRow - nStartRow > 0 || nNewPix > nOldPix);
3039 nRow = aFwdIter.getLastPos();
3047 double nPPTY,
bool bApi )
3049 bool bChanged =
false;
3054 OSL_FAIL(
"SetRowHeight: Row height zero");
3058 bool bSingle =
false;
3075 if (!bSingle || nEndRow - nStartRow < 20)
3077 bChanged = lcl_pixelSizeChanged(*
mpRowHeights, nStartRow, nEndRow, nNewHeight, nPPTY, bApi);
3079 mpRowHeights->setValue(nStartRow, nEndRow, nNewHeight);
3083 SCROW nMid = (nStartRow + nEndRow) / 2;
3096 OSL_FAIL(
"Invalid row number or no heights");
3110 mpRowHeights->setValue(nStartRow, nEndRow, nNewHeight);
3124 OSL_FAIL(
"Invalid row number or no column flags");
3130 OSL_ENSURE(
ValidCol(nCol),
"wrong column number");
3149 bool bHidden =
false;
3150 SCCOL nLastHiddenCol = -1;
3151 auto colWidthIt =
mpColWidth->begin() + nStartCol;
3152 for (
SCCOL nCol = nStartCol; nCol <= nEndCol; (++nCol <= nEndCol) ? ++colWidthIt : (
void)
false)
3154 if (nCol > nLastHiddenCol)
3155 bHidden =
ColHidden(nCol,
nullptr, &nLastHiddenCol);
3167 OSL_ENSURE(
ValidCol(nCol),
"wrong column number");
3181 OSL_FAIL(
"wrong column");
3182 nEndCol = rDocument.
MaxCol();
3185 sal_uInt16 nMaxWidth = 0;
3186 sal_uInt16 nMaxCount = 0;
3187 SCCOL nRangeStart = 0;
3188 while ( nRangeStart <= nEndCol )
3191 while ( nRangeStart <= nEndCol &&
ColHidden(nRangeStart) )
3193 if ( nRangeStart <= nEndCol )
3195 sal_uInt16 nThisCount = 0;
3196 auto colWidthIt =
mpColWidth->begin() + nRangeStart;
3197 sal_uInt16 nThisWidth = *colWidthIt;
3198 SCCOL nRangeEnd = nRangeStart;
3199 while ( nRangeEnd <= nEndCol && *colWidthIt == nThisWidth )
3206 while ( nRangeEnd <= nEndCol &&
ColHidden(nRangeEnd) )
3213 if ( nThisCount > nMaxCount )
3215 nMaxCount = nThisCount;
3216 nMaxWidth = nThisWidth;
3219 nRangeStart = nRangeEnd;
3232 if (bHiddenAsZero &&
RowHidden( nRow, pStartRow, pEndRow))
3252 *pStartRow = (bHiddenAsZero ? std::max( *pStartRow, aData.
mnRow1) : aData.
mnRow1);
3254 *pEndRow = (bHiddenAsZero ? std::min( *pEndRow, aData.
mnRow2) : aData.
mnRow2);
3275 SCROW nRow = nStartRow;
3276 while (nRow <= nEndRow)
3278 SCROW nLastRow = -1;
3279 if (!( (
RowHidden(nRow,
nullptr, &nLastRow) ) && bHiddenAsZero ) )
3281 if (nLastRow > nEndRow)
3285 nRow = nLastRow + 1;
3300 SCROW nRow = nStartRow;
3301 while (nRow <= nEndRow)
3303 SCROW nLastRow = -1;
3304 if (!
RowHidden(nRow,
nullptr, &nLastRow))
3306 if (nLastRow > nEndRow)
3311 while (nRow <= nLastRow)
3314 if (!aSegmentIter.
getValue(nRow, nRowVal))
3324 SCROW nRowsInSegment = nSegmentEnd + 1 - nRow;
3327 nRowsInSegment = std::min(nRowsInSegment, static_cast<SCROW>(*pnMaxHeight / nOneHeight + 1));
3328 nHeight += nOneHeight * nRowsInSegment;
3329 if (nHeight > *pnMaxHeight)
3333 nHeight += nOneHeight * nRowsInSegment;
3336 nRow = nSegmentEnd + 1;
3339 nRow = nLastRow + 1;
3346 SCROW nRowsInSegment = nEndRow - nStartRow + 1;
3349 nRowsInSegment = std::min(nRowsInSegment, static_cast<SCROW>(*pnMaxHeight / nOneHeight + 1));
3350 return nOneHeight * nRowsInSegment;
3353 return static_cast<sal_uLong>(nRowsInSegment * nOneHeight);
3359 OSL_ENSURE(
ValidRow(nRow),
"wrong row number");
3374 SCROW nLastRow = -1;
3378 return nLastRow - nRow + 1;
3388 if (bWasVis != bShow)
3399 OSL_FAIL(
"Invalid column number or no flags");
3408 if (bWasVis != bShow)
3422 OSL_FAIL(
"Invalid row number or no flags");
3448 OSL_FAIL(
"Invalid row number or no flags");
3454 SCROW nStartRow = nRow1;
3455 while (nStartRow <= nRow2)
3458 bool bWasVis = !
RowHiddenLeaf(nStartRow,
nullptr, &nEndRow);
3459 if (nEndRow > nRow2)
3462 bool bChanged = ( bWasVis != bShow );
3474 nStartRow = nEndRow + 1;
3486 SCROW nStartRow = nRow1;
3490 bool bHasObjects = pDrawLayer && pDrawLayer->
HasObjectsInRows( nTab, nRow1, nRow2 );
3492 while (nStartRow <= nRow2)
3495 bool bWasVis = !
RowHiddenLeaf(nStartRow,
nullptr, &nEndRow);
3496 if (nEndRow > nRow2)
3499 bool bChanged = ( bWasVis != bShow );
3514 nStartRow = nEndRow + 1;
3528 for (
SCROW i = nRowStart;
i <= nRowEnd; ++
i)
3533 for (
SCCOL i = nColStart;
i <= nColEnd; ++
i)
3553 OSL_FAIL(
"Invalid row number or no flags");
3560 pRowFlags->SetValue( nStartRow, nEndRow, nNewFlags);
3563 OSL_FAIL(
"Invalid row number(s) or no flags");
3585 SCROW nLastFound = 0;
3600 nLastFound = ::std::max(nLastFound, nRow);
3607 nLastFound = ::std::max(nLastFound, nRow);
3618 SCCOL nLastFound = 0;
3621 for (
SCCOL nCol = 1; nCol < nColSize; (++nCol < nColSize) ? ++colWidthIt : (
void)
false)
3642 return std::max( nLastFlags, nLastHeight);
3649 return pOutlineTable->GetColArray().ManualAction( nStartCol, nEndCol, bShow, *
this,
true );
3658 return pOutlineTable->GetRowArray().ManualAction( nStartRow, nEndRow, bShow, *
this,
false );
3685 if (rY2 < rDocument.
MaxRow())
3706 if (
ValidRow(nStartRow) && nStartRow >= rY1)
3721 template<
typename T >
3730 class OutlineArrayFinder
3740 maRef(rRef), mnCol(nCol), mnTab(nTab), mpArray(pArray),
3741 mbSizeChanged(bSizeChanged) {}
3765 typedef mdds::flat_segment_tree<SCROW, bool> UsedRowsType;
3767 bool bSizeChanged =
false;
3780 UsedRowsType aUsed(0, rDocument.
MaxRow()+1,
false);
3781 for (nCol=nStartCol; nCol<=nEndCol; nCol++)
3782 aCol[nCol].FindUsed(nStartRow, nEndRow, aUsed);
3786 for (nRow=nStartRow; nRow<=nEndRow; nRow++)
3789 SCROW nLastRow = nRow;
3790 aUsed.search_tree(nRow, bUsed,
nullptr, &nLastRow);
3798 for (nCol=nStartCol; nCol<=nEndCol && !bFound; nCol++)
3823 for (nCol=nStartCol; nCol<=nEndCol; nCol++)
3825 if (
aCol[nCol].IsEmptyData())
3828 OutlineArrayFinder aFunc(aRef, nCol, nTab, &rColArray, bSizeChanged);
3840 ScAddress aSrc( nStartCol, nStartRow, nTab );
3841 ScAddress aDest( nDestCol, nDestRow, nDestTab );
3842 ScRange aRange( aSrc, aDest );
3843 bool bThisTab = ( nDestTab ==
nTab );
3844 SCROW nDestY = nDestRow;
3845 for (
SCROW nRow=nStartRow; nRow<=nEndRow; nRow++)
3849 SCCOL nDestX = nDestCol;
3850 for (
SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++)
3876 aCell.
release(rDocument, aDest);
3897 nEndRow = ::std::numeric_limits<SCROW>::max();
3922 const sal_Int64 nMax = ::std::numeric_limits<tools::Long>::max();
3935 pDrawLayer->
SetPageSize(static_cast<sal_uInt16>(nTab),
Size(x, y), bUpdateNoteCaptionPos,
3941 if (bResetStreamValid)
3968 return GetRowHeight(0,
nullptr,
nullptr, bHiddenAsZero );
3971 #if OSL_DEBUG_LEVEL > 0
3972 if (n == ::std::numeric_limits<tools::ULong>::max())
3973 OSL_FAIL(
"ScTable::GetRowOffset: row heights overflow");
3978 OSL_FAIL(
"GetRowOffset: Data missing");
3990 aRowHeightRange.
mnRow2 = -1;
3993 for (
SCROW nRow = 0; nRow <= rDocument.
MaxRow(); ++nRow)
4006 if (aRowHeightRange.
mnRow2 < nRow)
4008 if (!
mpRowHeights->getRangeData(nRow, aRowHeightRange))
4015 assert (nLastCommon >= nRow);
4016 SCROW nCommon = nLastCommon - nRow + 1;
4023 if (nCommonPixels > nPixelsLeft)
4025 nRow += (nPixelsLeft + aRowHeightRange.
mnValue - 1) / aRowHeightRange.
mnValue;
4030 return rDocument.
MaxRow();
4040 return nRow <= rDocument.
MaxRow() ? nRow : rDocument.
MaxRow();
4044 nSum += nCommonPixels;
4056 for (
SCCOL i = 0;
i < nCol; (++
i < nCol) ? ++colWidthIt : (
void)
false)
4062 OSL_FAIL(
"GetColumnOffset: Data missing");
If set, cloned formula cells will start to listen to the document.
void FindMaxRotCol(RowInfo *pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2)
void SetFormula(SCCOL nCol, SCROW nRow, const ScTokenArray &rArray, formula::FormulaGrammar::Grammar eGram)
void SetMergedCells(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
void CellStorageModified()
Called whenever the state of cell array gets modified i.e.
void ApplyStyle(SCROW nRow, const ScStyleSheet *rStyle)
void CalcAfterLoad(sc::CompileFormulaContext &rCxt, bool bStartListening)
void CopyUpdated(const ScTable *pPosTab, ScTable *pDestTab) const
svl::SharedString GetSharedString(SCCOL nCol, SCROW nRow) const
bool TestCopyScenarioTo(const ScTable *pDestTab) const
SCCOL GetColMerge() const
SCROW mnRowDelta
Amount and direction of movement in the row direction.
const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow) const
bool SetRowHeightRange(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight, double nPPTY, bool bApi)
Temporarily switch on/off auto calculation mode.
SCCOL GetLastChangedCol() const
bool Intersects(const ScRange &) const
ScRotateDir GetRotateDir(const SfxItemSet *pCondSet) const
ScFormulaCell * SetFormulaCell(SCCOL nCol, SCROW nRow, ScFormulaCell *pCell)
Takes ownership of pCell.
void ApplyStyleArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScStyleSheet &rStyle)
bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, HasAttrFlags nMask) const
bool HasScenarioRange(SCTAB nTab, const ScRange &rRange) const
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
bool HasBlockMatrixFragment(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bNoMatrixAtAll=false) const
void CompileAll(sc::CompileFormulaContext &rCxt)
Store parameters used in the ScDocument::SetString() method.
void ForgetNoteCaptions(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bPreserveData)
void SetAllFormulasDirty(const sc::SetFormulaDirtyContext &rCxt)
void SetRowFlags(SCROW nRow, CRFlags nNewFlags)
bool IsBlockEmpty(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bIgnoreNotes) const
void MergeSelectionPattern(ScMergePatternState &rState, const ScMarkData &rMark, bool bDeep) const
const ScPatternAttr * GetPattern(SCROW nRow) const
void SetRowHeight(SCROW nRow, sal_uInt16 nNewHeight)
std::unique_ptr< ScFlatUInt16RowSegments > mpRowHeights
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
void SetPatternAreaCondFormat(SCCOL nCol, SCROW nStartRow, SCROW nEndRow, const ScPatternAttr &rAttr, const ScCondFormatIndexes &rCondFormatIndexes)
Sheet / outlining (grouping) information.
Simple container to keep track of sheet - column pair.
Single reference (one address) into the sheet.
ScTable * FetchTable(SCTAB nTab)
bool IsDataFiltered(SCCOL nColStart, SCROW nRowStart, SCCOL nColEnd, SCROW nRowEnd) const
bool IsSelectionEditable(const ScMarkData &rMark, bool *pOnlyNotBecauseOfMatrix=nullptr) const
void SetRowHeightOnly(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight)
Set specified row height to specified ranges.
SC_DLLPUBLIC bool IsActiveScenario(SCTAB nTab) const
size_t GetNoteCount(SCCOL nCol) const
void ApplyPattern(SCCOL nCol, SCROW nRow, const ScPatternAttr &rAttr)
ScColumn * FetchColumn(SCCOL nCol)
std::unique_ptr< ScPostIt > ReleaseNote(SCCOL nCol, SCROW nRow)
void CopyData(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCCOL nDestCol, SCROW nDestRow, SCTAB nDestTab)
SC_DLLPUBLIC bool Intersects(const ScRange &rRange) const
bool TestInsertRow(SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize) const
Context for reference update during shifting, moving or copying of cell ranges.
void CopyRowFiltered(const ScTable &rTable, SCROW nStartRow, SCROW nEndRow)
bool IsOverlapped() const
CellType GetCellType(const ScAddress &rPos) const
void SetCalcNotification(bool bSet)
void SetEditText(SCROW nRow, std::unique_ptr< EditTextObject > pEditText)
void GetString(SCCOL nCol, SCROW nRow, OUString &rString, const ScInterpreterContext *pContext=nullptr) const
void DetachFormulaCells(sc::EndListeningContext &rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
std::unique_ptr< ScFlatBoolColSegments > mpFilteredCols
const ScStyleSheet * GetSelectionStyle(const ScMarkData &rMark, bool &rFound) const
ScColumnVector::const_iterator end() const
bool HasScenarioRange(const ScRange &rRange) const
CommentCaptionState GetAllNoteCaptionsState(const ScRange &rRange, std::vector< sc::NoteEntry > &rNotes)
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
formula::FormulaToken * AddSingleReference(const ScSingleRefData &rRef)
ScSingleRefToken with ocPush.
Store position data for column array storage.
const SfxItemSet & GetItemSet() const
sal_uInt16 GetDistance(SvxBoxItemLine nLine) const
InsertDeleteFlags getInsertFlag() const
bool IsClipOrUndo() const
bool HasObjectsInRows(SCTAB nTab, SCROW nStartRow, SCROW nEndRow)
void CopyStaticToDocument(SCROW nRow1, SCROW nRow2, const SvNumberFormatterMergeMap &rMap, ScColumn &rDestCol)
bool CompileErrorCells(sc::CompileFormulaContext &rCxt, FormulaError nErrCode)
sal_uInt16 GetTextWidth(SCCOL nCol, SCROW nRow) const
void GetFirstDataPos(SCCOL &rCol, SCROW &rRow) const
CellStoreType::const_iterator ParseAllNonEmpty(const typename CellStoreType::const_iterator &itPos, const CellStoreType &rCells, SCROW nRow1, SCROW nRow2, Func &rFunc)
void SetManualHeight(SCROW nStartRow, SCROW nEndRow, bool bManual)
void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden)
void ApplyPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPatternAttr &rPatAttr, ScEditDataArray *pDataArray=nullptr, bool *const pIsChanged=nullptr)
virtual SfxItemSet & GetItemSet()
This is very similar to ScCellValue, except that it references the original value instead of copying ...
void CopyScenarioTo(const ScTable *pDestTab) const
void UndoToTable(sc::CopyToDocContext &rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, InsertDeleteFlags nFlags, bool bMarked, ScTable *pDestTab)
void DeleteRow(const sc::ColumnSet &rRegroupCols, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize, bool *pUndoOutline, std::vector< ScAddress > *pGroupPos)
sal_uInt16 GetOriginalHeight(SCROW nRow) const
void RemoveEditTextCharAttribs(SCCOL nCol, SCROW nRow, const ScPatternAttr &rAttr)
const editeng::SvxBorderLine * GetRight() const
mdds::multi_type_vector< CellFunc, CellStoreEvent > CellStoreType
const ScStyleSheet * GetStyle(SCCOL nCol, SCROW nRow) const
void MixData(sc::MixDocContext &rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScPasteFunc nFunction, bool bSkipEmpty, const ScTable *pSrcTab)
bool HasData(SCCOL nCol, SCROW nRow) const
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
void MergeBlockFrame(SvxBoxItem *pLineOuter, SvxBoxInfoItem *pLineInner, ScLineFlags &rFlags, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow) const
void ApplySelectionStyle(const ScStyleSheet &rStyle, const ScMarkData &rMark)
std::unique_ptr< ScRangeName > mpRangeName
SCROW GetRowForHeight(sal_uLong nHeight) const
Get the last row such that the height of row 0 to the end row is as high as possible without exceedin...
const ScAddress & GetAddress() const
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
void ApplyAttr(SCCOL nCol, SCROW nRow, const SfxPoolItem &rAttr)
void TransposeClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable *pTransClip, InsertDeleteFlags nFlags, bool bAsLink)
Internal use only (d&d undo): do not delete caption objects of cell notes.
void MarkScenarioIn(ScMarkData &rMark, ScScenarioFlags nNeededBits) const
bool ValidRow(SCROW nRow) const
SC_DLLPUBLIC ScDocumentPool * GetPool()
void StartListeners(sc::StartListeningContext &rCxt, bool bAll)
Either start all formula cells as listeners unconditionally, or start those that are marked "needs li...
void SetStreamValid(bool bSet, bool bIgnoreLock=false)
ScColumn & CreateColumnIfNotExists(const SCCOL nScCol) const
void AttachFormulaCells(sc::StartListeningContext &rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Store arbitrary cell value of any kind.
void TransposeColNotes(ScTable *pTransClip, SCCOL nCol1, SCCOL nCol, SCROW nRow1, SCROW nRow2)
constexpr TypedWhichId< ScRotateValueItem > ATTR_ROTATE_VALUE(135)
void ResetChanged(const ScRange &rRange)
ScFormulaCell * SetFormulaCell(SCROW nRow, ScFormulaCell *pCell, sc::StartListeningType eListenType=sc::SingleCellListening, bool bInheritNumFormatIfNeeded=true)
Takes ownership of pCell.
sal_uLong GetColOffset(SCCOL nCol, bool bHiddenAsZero=true) const
void SetNumberFormat(SCCOL nCol, SCROW nRow, sal_uInt32 nNumberFormat)
bool IsBlockEditable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool *pOnlyNotBecauseOfMatrix=nullptr, bool bNoMatrixAtAll=false) const
void InsertRow(SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize)
ScFormulaCell * mpFormula
SC_DLLPUBLIC SCROW MaxRow() const
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
void SetTableOpDirty(const ScRange &)
void SetAnonymousDBData(std::unique_ptr< ScDBData > pDBData)
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
Additional class containing cell annotation data.
void SetColManualBreaks(const ::std::set< SCCOL > &rBreaks)
static short DiffSign(T a, T b)
void GetFormula(SCCOL nCol, SCROW nRow, OUString &rFormula) const
sal_uLong GetScaledRowHeight(SCROW nStartRow, SCROW nEndRow, double fScale, const sal_uLong *pnMaxHeight=nullptr) const
bool UpdateOutlineCol(SCCOL nStartCol, SCCOL nEndCol, bool bShow)
void SetNumberFormat(SCROW nRow, sal_uInt32 nNumberFormat)
double * GetValueCell(SCCOL nCol, SCROW nRow)
sc::CellStoreType maCells
const std::shared_ptr< const ColumnSet > & getColumnSet() const
void SetColWidthOnly(SCCOL nCol, sal_uInt16 nNewWidth)
ScFormulaCell * mpFormula
void CopyToClip(sc::CopyToClipContext &rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable *pTable)
void StripHidden(SCCOL &rX1, SCROW &rY1, SCCOL &rX2, SCROW &rY2)
void release(ScDocument &rDoc, const ScAddress &rPos)
Set cell value at specified position in specified document.
void CopyColHidden(const ScTable &rTable, SCCOL nStartCol, SCCOL nEndCol)
bool SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden)
void SetColWidth(SCCOL nCol, sal_uInt16 nNewWidth)
const editeng::SvxBorderLine * GetLine(SvxBoxItemLine nLine) const
bool HasValueData(SCCOL nCol, SCROW nRow) const
bool SetFormulaCells(SCROW nRow, std::vector< ScFormulaCell * > &rCells)
sal_uInt32 GetNumberFormat(const ScInterpreterContext &rContext, SCROW nRow) const
ScColumnVector::const_iterator begin() const
void SetValue(SCCOL nCol, SCROW nRow, const double &rVal)
std::unique_ptr< ScOutlineTable > pOutlineTable
void DoAutoOutline(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow)
void SetRangeName(std::unique_ptr< ScRangeName > pNew)
void SetPattern(const ScAddress &rPos, const ScPatternAttr &rAttr)
bool RemoveFlags(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScMF nFlags)
ScBroadcastAreaSlotMachine * GetBASM() const
void SetRowManualBreaks(const ::std::set< SCROW > &rBreaks)
sal_uInt16 GetOriginalWidth(SCCOL nCol) const
bool HasSelectionMatrixFragment(const ScMarkData &rMark) const
std::unique_ptr< ScBitMaskCompressedArray< SCCOL, CRFlags > > mpColFlags
constexpr auto convert(N n, sal_Int64 mul, sal_Int64 div)
void PutInOrder(T &nStart, T &nEnd)
bool IsColValid(const SCCOL nScCol) const
constexpr OUStringLiteral aData
bool SetString(SCROW nRow, SCTAB nTab, const OUString &rString, formula::FormulaGrammar::AddressConvention eConv, const ScSetStringParam *pParam=nullptr)
Returns true if the cell format was set as well.
bool SetOutlineTable(const ScOutlineTable *pNewOutline)
static SC_DLLPUBLIC sal_uInt16 nStdRowHeight
std::unique_ptr< ScFlatBoolColSegments > mpHiddenCols
bool SetFormulaCells(SCCOL nCol, SCROW nRow, std::vector< ScFormulaCell * > &rCells)
void ShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
void ApplyStyle(SCCOL nCol, SCROW nRow, const ScStyleSheet *rStyle)
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
const editeng::SvxBorderLine * GetTop() const
void SetDrawPageSize(bool bResetStreamValid=true, bool bUpdateNoteCaptionPos=true, const ScObjectHandling eObjectHandling=ScObjectHandling::RecalcPosMode)
SC_DLLPUBLIC SCCOL MaxCol() const
bool ColHidden(SCCOL nCol, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
SC_DLLPUBLIC void SetPattern(const ScAddress &, const ScPatternAttr &rAttr)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
UNDERLYING_TYPE get() const
void GetScenarioFlags(SCTAB nTab, ScScenarioFlags &rFlags) const
bool ValidCol(SCCOL nCol) const
const ScFormulaCell * GetFormulaCell(SCCOL nCol, SCROW nRow) const
void InitBlockPosition(sc::ColumnBlockPosition &rBlockPos)
const editeng::SvxBorderLine * GetLeft() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetRawString(SCROW nRow, const OUString &rStr)
void AddCondFormatData(const ScRangeList &rRange, sal_uInt32 nIndex)
UpdateRefMode meMode
update mode - insert/delete, copy, or move.
const ScRangeList * GetScenarioRanges() const
void CheckVectorizationState()
void SetFlag3D(bool bVal)
void InitAddress(const ScAddress &rAdr)
InitAddress: InitFlags and set address.
sal_uInt16 GetColWidth(SCCOL nCol, bool bHiddenAsZero=true) const
void InvalidateScenarioRanges()
void CopyCaptionsToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable *pDestTab, bool bCloneCaption)
std::unique_ptr< ScDBData > pDBDataNoName
SC_DLLPUBLIC void SetAutoCalc(bool bNewAutoCalc)
void CopyRowHidden(const ScTable &rTable, SCROW nStartRow, SCROW nEndRow)
sc::CellTextAttrStoreType maCellTextAttrs
std::unique_ptr< ScPostIt > Clone(const ScAddress &rOwnPos, ScDocument &rDestDoc, const ScAddress &rDestPos, bool bCloneCaption) const
Clones this note and its caption object, if specified.
CRFlags GetRowFlags(SCROW nRow) const
void SetEmptyCell(SCCOL nCol, SCROW nRow)
::std::map< sal_uInt32, sal_uInt32 > SvNumberFormatterMergeMap
const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, sal_uInt16 nWhich) const
ScSheetLimits & GetSheetLimits() const
SvNumberFormatter * GetFormatTable() const
ScScenarioFlags nScenarioFlags
void ApplyStyleArea(SCROW nStartRow, SCROW nEndRow, const ScStyleSheet &rStyle)
const ScStyleSheet * GetStyleSheet() const
void GetUnprotectedCells(ScRangeList &rRangeList) const
void ShowCol(SCCOL nCol, bool bShow)
bool HasAttribSelection(const ScMarkData &rMark, HasAttrFlags nMask) const
void CopyFromClip(sc::CopyFromClipContext &rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCCOL nDx, SCROW nDy, ScTable *pTable)
const EditTextObject * GetEditText(SCCOL nCol, SCROW nRow) const
void DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
void GetNotesInRange(const ScRange &rRange, std::vector< sc::NoteEntry > &rNotes) const
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
bool TestInsertRow(SCROW nStartRow, SCSIZE nSize) const
std::unique_ptr< ScTableProtection > pTabProtection
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
void GetLastDataPos(SCCOL &rCol, SCROW &rRow) const
Structure that stores segments of boolean flags per column, and perform custom action on those segmen...
void SetNote(const ScAddress &rPos, std::unique_ptr< ScPostIt > pNote)
void SetRangeDirty(const ScRange &rRange)
void CompileXML(sc::CompileFormulaContext &rCxt, ScProgress &rProgress)
void SetRawString(SCCOL nCol, SCROW nRow, const svl::SharedString &rStr)
sal_uInt32 GetNumberFormat(SvNumberFormatter *) const
void StartListeningFormulaCells(sc::StartListeningContext &rStartCxt, sc::EndListeningContext &rEndCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
void DBShowRow(SCROW nRow, bool bShow)
::std::set< SCROW > maRowManualBreaks
std::unique_ptr< ScConditionalFormatList > mpCondFormatList
double * GetValueCell(SCROW nRow)
void SetDistance(sal_uInt16 nNew, SvxBoxItemLine nLine)
void ApplySelectionLineStyle(const ScMarkData &rMark, const ::editeng::SvxBorderLine *pLine, bool bColorOnly)
void BroadcastRecalcOnRefMove()
Broadcast dirty formula cells that contain functions such as CELL(), COLUMN() or ROW() which may chan...
void ExtendHidden(SCCOL &rX1, SCROW &rY1, SCCOL &rX2, SCROW &rY2)
void SetAreasChangedNeedBroadcast()
bool ApplyFlags(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScMF nFlags)
ScRange maRange
Range of cells that are about to be moved for insert/delete/move modes.
void ApplyAttr(SCROW nRow, const SfxPoolItem &rAttr)
BroadcastMode
Broadcast mode for SetDirty(SCROW,SCROW,BroadcastMode).
bool ContainsNotesInRange(const ScRange &rRange) const
void getColumns(SCTAB nTab, std::vector< SCCOL > &rCols) const
bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
bool RefVisible(const ScFormulaCell *pCell)
void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, InsertDeleteFlags nDelFlag, bool bBroadcast=true, sc::ColumnSpanSet *pBroadcastSpans=nullptr)
void MergePatternArea(ScMergePatternState &rState, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bDeep) const
Internal use only (undo etc.): do not copy/delete caption objects of cell notes.
void CopyToTable(sc::CopyToDocContext &rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, InsertDeleteFlags nFlags, bool bMarked, ScTable *pDestTab, const ScMarkData *pMarkData, bool bAsLink, bool bColRowFlags, bool bGlobalNamesToLocal, bool bCopyCaptions)
void InvalidatePageBreaks()
bool ApplyFlags(SCROW nStartRow, SCROW nEndRow, ScMF nFlags)
bool RowHidden(SCROW nRow, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetPageSize(sal_uInt16 nPageNo, const Size &rSize, bool bUpdateNoteCaptionPos, const ScObjectHandling eObjectHandling=ScObjectHandling::RecalcPosMode)
void SetFormula(SCROW nRow, const ScTokenArray &rArray, formula::FormulaGrammar::Grammar eGram)
std::unique_ptr< ScFlatBoolRowSegments > mpFilteredRows
sc::CellNoteStoreType maCellNotes
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
void CopyScenarioFrom(const ScTable *pSrcTab)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
#define SAL_WARN_IF(condition, area, stream)
sal_uInt32 GetTotalRowHeight(SCROW nStartRow, SCROW nEndRow, bool bHiddenAsZero=true) const
ScRangeName * GetRangeName() const
void CopyStyleFrom(ScStyleSheetPool *pSrcPool, const OUString &rName, SfxStyleFamily eFamily)
void Join(const ScRange &, bool bIsInList=false)
ScRefCellValue GetCellValue(SCCOL nCol, SCROW nRow) const
void DeleteCol(const sc::ColumnSet &rRegroupCols, SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize, bool *pUndoOutline)
bool ValidColRow(SCCOL nCol, SCROW nRow) const
SCTAB mnTabDelta
Amount and direction of movement in the sheet direction.
bool BroadcastBroadcasters(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScHint &rHint)
Broadcast single broadcasters in range, without explicitly setting anything dirty, not doing area broadcasts.
sal_uInt16 GetCommonWidth(SCCOL nEndCol) const
void CopyConditionalFormat(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCCOL nDx, SCROW nDy, const ScTable *pTable)
void MergeSelectionPattern(ScMergePatternState &rState, const ScMarkData &rMark, bool bDeep) const
void assign(const ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
ScColumnsRange GetColumnsRange(SCCOL begin, SCCOL end) const
const ScPatternAttr * GetMostUsedPattern(SCCOL nCol, SCROW nStartRow, SCROW nEndRow) const
SCROW GetLastChangedRow() const
::std::set< SCCOL > maColManualBreaks
void CopyRowHeight(const ScTable &rSrcTable, SCROW nStartRow, SCROW nEndRow, SCROW nSrcOffset)
SC_DLLPUBLIC bool HasColNotes(SCCOL nCol, SCTAB nTab) const
void ApplyPattern(SCROW nRow, const ScPatternAttr &rPatAttr)
void GetInputString(SCCOL nCol, SCROW nRow, OUString &rString) const