26 #include <document.hxx>
29 #include <stlpool.hxx>
41 #include <tokenarray.hxx>
61 #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<=maxCol;
i++)
146 if( maxCol != nEndCol )
163 pRowFlags->SetValue( nStartRow, nStartRow + nSize - 1,
182 for (; itr1 != itr2; ++itr1)
183 aNewBreaks.insert(static_cast<SCROW>(*itr1 + nSize));
190 aCol[j].InsertRow( nStartRow, nSize );
204 bool* pUndoOutline, std::vector<ScAddress>* pGroupPos )
212 mpRowHeights->removeSegment(nStartRow, nStartRow+nSize);
217 *pUndoOutline =
true;
220 mpHiddenRows->removeSegment(nStartRow, nStartRow+nSize);
226 std::set<SCROW>::iterator itr2 =
maRowManualBreaks.upper_bound(static_cast<SCROW>(nStartRow + nSize - 1));
235 for (; itr1 != itr2; ++itr1)
236 aNewBreaks.insert(static_cast<SCROW>(*itr1 - nSize));
248 std::vector<SCCOL> aRegroupCols;
251 aRegroupCols.begin(), aRegroupCols.end(), ColumnRegroupFormulaCells(
aCol, pGroupPos));
270 for (
auto it = range.rbegin(); it != range.rend(); ++it )
293 mpHiddenCols->insertSegment(nStartCol, static_cast<SCCOL>(nSize));
294 mpFilteredCols->insertSegment(nStartCol, static_cast<SCCOL>(nSize));
305 for (; itr1 != itr2; ++itr1)
306 aNewBreaks.insert(static_cast<SCCOL>(*itr1 + nSize));
317 for (
SCCOL nCol =
aCol.
size() - 1 - nSize; nCol >= nStartCol; --nCol)
318 aCol[nCol].SwapCol(
aCol[nCol+nSize]);
326 std::vector<SCCOL> aRegroupCols;
328 std::for_each(aRegroupCols.begin(), aRegroupCols.end(), ColumnRegroupFormulaCells(
aCol,
nullptr));
332 sal_uInt16 nWhichArray[2];
340 false,
aCol[nStartCol+
i] );
341 aCol[nStartCol+
i].RemoveFlags( nStartRow, nEndRow,
343 aCol[nStartCol+
i].ClearItems( nStartRow, nEndRow, nWhichArray );
370 *pUndoOutline =
true;
372 SCCOL nRmSize = nStartCol +
static_cast<SCCOL>(nSize);
380 std::set<SCCOL>::iterator itr2 =
maColManualBreaks.upper_bound(static_cast<SCCOL>(nStartCol + nSize - 1));
389 for (; itr1 != itr2; ++itr1)
390 aNewBreaks.insert(static_cast<SCCOL>(*itr1 - nSize));
401 for (
SCCOL nCol = nStartCol + nSize; nCol <
aCol.
size(); ++nCol)
402 aCol[nCol].SwapCol(
aCol[nCol - nSize]);
407 aCol[nStartCol + nSize +
i].MoveTo(nStartRow, nEndRow,
aCol[nStartCol +
i]);
410 std::vector<SCCOL> aRegroupCols;
412 std::for_each(aRegroupCols.begin(), aRegroupCols.end(), ColumnRegroupFormulaCells(
aCol,
nullptr));
431 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
432 aCol[
i].
DeleteArea(nRow1, nRow2, nDelFlag, bBroadcast, pBroadcastSpans);
464 for (
size_t i = 0;
i < aRangeList.
size(); ++
i)
466 const ScRange & rRange = aRangeList[
i];
503 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
529 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
530 pTable->
aCol[
i].RemoveProtected(nRow1, nRow2);
538 for (
size_t i = 0, nListSize = rRanges.
size();
i < nListSize; ++
i )
548 if (nCol1 > nCol2 || nRow1 > nRow2)
552 if (nFirstUnallocated > nCol1)
555 for (
SCCOL i = nCol1;
i < nFirstUnallocated; ++
i)
564 for (
SCCOL i = nFirstUnallocated;
i <= nLastInDest; ++
i)
568 rDestCol.
maCells.set_empty(nRow1, nRow2);
569 for (
SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
573 SvNumberFormatterMergeMap::const_iterator itNum = rMap.find(nNumFmt);
574 if (itNum != rMap.end())
575 nNumFmt = itNum->second;
593 rDestCol.
maCells.set_empty(nDestRow, nDestRow);
595 rDestCol.
maCellNotes.set_empty(nDestRow, nDestRow);
617 for (
size_t i = 0;
i < rNewRangeList.
size(); ++
i)
619 rDstRangeList.
Join(rNewRangeList[i]);
633 ScRange aOldRange( nCol1 - nDx, nRow1 - nDy, pTable->
nTab, nCol2 - nDx, nRow2 - nDy, pTable->
nTab);
634 ScRange aNewRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab );
639 const ScRangeList& rCondFormatRange = rxCondFormat->GetRange();
644 std::unique_ptr<ScConditionalFormat> pNewFormat = rxCondFormat->
Clone(&rDocument);
646 pNewFormat->SetRange(aIntersectedRange);
653 pNewFormat->UpdateReference(aRefCxt,
true);
655 if (bSameDoc && pTable->
nTab == nTab && CheckAndDeduplicateCondFormat(rDocument,
mpCondFormatList->GetFormat(rxCondFormat->GetKey()), pNewFormat.get(),
nTab))
660 bool bDuplicate =
false;
665 if (CheckAndDeduplicateCondFormat(rDocument, rxCond.get(), pNewFormat.get(),
nTab))
671 if (rxCond->GetKey() > nMax)
672 nMax = rxCond->GetKey();
680 pNewFormat->SetKey(nMax + 1);
681 auto pNewFormatTmp = pNewFormat.get();
682 mpCondFormatList->InsertNew(std::move(pNewFormat));
686 for(
size_t i = 0,
n = pNewFormatTmp->size();
693 aStyleName = static_cast<const ScCondFormatEntry*>(pEntry)->GetStyle();
695 aStyleName = static_cast<const ScCondDateFormatEntry*>(pEntry)->GetStyleName();
697 if(!aStyleName.isEmpty())
727 if (nCol2 > rDocument.
MaxCol())
728 nCol2 = rDocument.
MaxCol();
729 if (nRow2 > rDocument.
MaxRow())
730 nRow2 = rDocument.
MaxRow();
736 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
739 aCol[
i].CopyFromClip(rCxt, nRow1, nRow2, nDy, pTable->
aCol[
i - nDx]);
745 sal_uInt16 nWhichArray[2];
748 for (
SCCOL i = nCol1;
i <= nCol2; ++
i)
749 aCol[
i].ClearItems(nRow1, nRow2, nWhichArray);
763 for (
SCROW j=nRow1; j<=nRow2; j++)
795 bool bSkipEmpty,
const ScTable* pSrcTab )
803 class TransClipHandler
813 SCROW mnFilteredRows = 0;
814 SCROW mnRowDestOffset = 0;
817 bool mbIncludeFiltered;
822 return ScAddress(static_cast<SCCOL>(mnCol1 + nRow - mnTopRow), mnTransRow,
828 ScAddress aSrcPos(mnSrcCol, nSrcRow, mnSrcTab);
834 aArr.AddSingleReference(aRef);
838 void setLink(
size_t nRow)
840 SCCOL nTransCol = mnCol1 + nRow - mnTopRow - mnFilteredRows + mnRowDestOffset;
842 createRefCell(nRow, getDestPos(nRow)));
847 SCCOL nSrcCol,
size_t nTopRow,
size_t nEndRow,
SCROW nCombinedStartRow,
848 SCROW nRowDestOffset,
bool bAsLink,
bool bWasCut,
850 std::vector<SCROW>& rFilteredRows)
851 : mrClipTab(rClipTab)
858 , mnTransRow(nSrcCol - nCol1 + nCombinedStartRow)
859 , mnRowDestOffset(nRowDestOffset)
862 , mbIncludeFiltered(bIncludeFiltered)
866 if (!mbIncludeFiltered)
868 for (
SCROW curRow = nTopRow; curRow <= static_cast<SCROW>(mnEndRow); ++curRow)
871 bool bFiltered = mrSrcTab.
RowFiltered(curRow,
nullptr,
nullptr);
873 rFilteredRows.push_back(curRow);
878 void operator() (
size_t nRow,
double fVal)
880 bool bFiltered = mrSrcTab.
RowFiltered(nRow,
nullptr,
nullptr);
881 if (!mbIncludeFiltered && bFiltered)
893 SCCOL nTransCol = mnCol1 + nRow - mnTopRow - mnFilteredRows + mnRowDestOffset;
894 mrClipTab.
SetValue(nTransCol, mnTransRow, fVal);
899 bool bFiltered = mrSrcTab.
RowFiltered(nRow,
nullptr,
nullptr);
900 if (!mbIncludeFiltered && bFiltered)
912 SCCOL nTransCol = mnCol1 + nRow - mnTopRow - mnFilteredRows + mnRowDestOffset;
918 bool bFiltered = mrSrcTab.
RowFiltered(nRow,
nullptr,
nullptr);
919 if (!mbIncludeFiltered && bFiltered)
931 SCCOL nTransCol = mnCol1 + nRow - mnTopRow - mnFilteredRows + mnRowDestOffset;
937 bool bFiltered = mrSrcTab.
RowFiltered(nRow,
nullptr,
nullptr);
938 if (!mbIncludeFiltered && bFiltered)
951 getDestPos(nRow - mnFilteredRows + mnRowDestOffset),
960 SCCOL nTransCol = mnCol1 + nRow - mnTopRow - mnFilteredRows + mnRowDestOffset;
965 void operator()(
const int ,
size_t nRow,
size_t nDataSize)
967 for (
size_t curRow = nRow; curRow < nRow + nDataSize; ++curRow)
969 bool bFiltered = mrSrcTab.
RowFiltered(curRow,
nullptr,
nullptr);
970 if (!mbIncludeFiltered && bFiltered)
993 for (
SCCOL nCol=nCol1; nCol<=nCol2; nCol++)
995 std::vector<SCROW> aFilteredRows;
997 TransClipHandler aFunc(*pTransClip, *
this, nTab, nCol1, nCol, nRow1, nRow2,
998 nCombinedStartRow, nRowDestOffset, bAsLink, bWasCut, nFlags,
999 bIncludeFiltered, aFilteredRows);
1004 sc::ParseAll(rCells.begin(), rCells, nRow1, nRow2, aFunc,
1010 bIncludeFiltered, aFilteredRows, nRowDestOffset);
1015 bIncludeFiltered, nRowDestOffset);
1022 const std::vector<SCROW>& rFilteredRows,
1023 SCROW nRowDestOffset)
1025 for (
SCROW nRow = nAttrRow1; nRow <= nAttrRow2; nRow++)
1027 size_t nFilteredRowAdjustment = 0;
1028 if (!bIncludeFiltered)
1032 auto itRow1 = std::lower_bound(rFilteredRows.begin(), rFilteredRows.end(), nRow1);
1033 auto itRow = std::lower_bound(rFilteredRows.begin(), rFilteredRows.end(), nRow);
1034 bool bRefRowIsFiltered = itRow != rFilteredRows.end() && *itRow == nRow;
1035 if (bRefRowIsFiltered)
1040 nFilteredRowAdjustment = std::distance(itRow1, itRow);
1044 static_cast<SCCOL>(nCol1 + nRow - nRow1 - nFilteredRowAdjustment + nRowDestOffset),
1045 static_cast<SCROW>(nCombinedStartRow + nCol - nCol1), rPatternAttr);
1050 SCROW nRow2,
SCROW nCombinedStartRow,
bool bIncludeFiltered,
1051 const std::vector<SCROW>& rFilteredRows,
SCROW nRowDestOffset)
1053 SCROW nAttrRow1 = {};
1054 SCROW nAttrRow2 = {};
1056 std::unique_ptr<ScAttrIterator> pAttrIter(
aCol[nCol].CreateAttrIterator( nRow1, nRow2 ));
1057 while ( (pPattern = pAttrIter->Next( nAttrRow1, nAttrRow2 )) !=
nullptr )
1069 nCombinedStartRow, nCol, *pPattern,
1070 bIncludeFiltered, rFilteredRows, nRowDestOffset);
1082 aNew.
SetLine( rOldBox.
GetLine( SvxBoxItemLine::TOP ), SvxBoxItemLine::LEFT );
1083 aNew.
SetLine( rOldBox.
GetLine( SvxBoxItemLine::LEFT ), SvxBoxItemLine::TOP );
1084 aNew.
SetLine( rOldBox.
GetLine( SvxBoxItemLine::BOTTOM ), SvxBoxItemLine::RIGHT );
1085 aNew.
SetLine( rOldBox.
GetLine( SvxBoxItemLine::RIGHT ), SvxBoxItemLine::BOTTOM );
1090 rNewSet.
Put( aNew );
1097 static_cast<SCCOL>(rDocument.
MaxCol()+1 - (nAttrRow2-nRow1))),
1100 static_cast<SCROW>(rDocument.
MaxRow()+1 - (nCol-nCol1)))));
1113 nCombinedStartRow, nCol, aNewPattern,
1114 bIncludeFiltered, rFilteredRows, nRowDestOffset);
1121 SCROW nRow2,
SCROW nCombinedStartRow,
bool bIncludeFiltered,
1122 SCROW nRowDestOffset)
1124 sc::CellNoteStoreType::const_iterator itBlk =
aCol[nCol].maCellNotes.
begin(), itBlkEnd =
aCol[nCol].maCellNotes.
end();
1127 size_t nOffsetInBlock = 0;
1128 size_t nBlockStart = 0, nBlockEnd = 0, nRowPos =
static_cast<size_t>(nRow1);
1129 for (; itBlk != itBlkEnd; ++itBlk, nBlockStart = nBlockEnd)
1131 nBlockEnd = nBlockStart + itBlk->size;
1132 if (nBlockStart <= nRowPos && nRowPos < nBlockEnd)
1135 nOffsetInBlock = nRowPos - nBlockStart;
1140 if (itBlk == itBlkEnd)
1144 nRowPos =
static_cast<size_t>(nRow2);
1145 SCCOL nFilteredRows = 0;
1148 sc::cellnote_block::const_iterator itData, itDataEnd;
1149 for (; itBlk != itBlkEnd; ++itBlk, nBlockStart = nBlockEnd, nOffsetInBlock = 0)
1151 nBlockEnd = nBlockStart + itBlk->size;
1155 itData = sc::cellnote_block::begin(*itBlk->data);
1156 std::advance(itData, nOffsetInBlock);
1159 if (nBlockStart <= nRowPos && nRowPos < nBlockEnd)
1162 size_t nOffsetEnd = nRowPos - nBlockStart + 1;
1163 itDataEnd = sc::cellnote_block::begin(*itBlk->data);
1164 std::advance(itDataEnd, nOffsetEnd);
1165 size_t curRow = nBlockStart + nOffsetInBlock;
1166 for (; itData != itDataEnd; ++itData, ++curRow)
1168 bool bFiltered = this->
RowFiltered(curRow,
nullptr,
nullptr);
1169 if (!bIncludeFiltered && bFiltered)
1176 static_cast<SCCOL>(nCol1 + curRow - nRow1 - nFilteredRows + nRowDestOffset),
1177 static_cast<SCROW>(nCombinedStartRow + nCol - nCol1), pTransClip->
nTab);
1182 std::unique_ptr<ScPostIt> pClonedNote = pNote->
Clone(
ScAddress(nCol, curRow, nTab), pTransClip->
rDocument, aDestPos,
true );
1190 itDataEnd = sc::cellnote_block::end(*itBlk->data);
1191 size_t curRow = nBlockStart + nOffsetInBlock;
1192 for (; itData != itDataEnd; ++itData, ++curRow)
1194 bool bFiltered = this->
RowFiltered(curRow,
nullptr,
nullptr);
1195 if (!bIncludeFiltered && bFiltered)
1202 static_cast<SCCOL>(nCol1 + curRow - nRow1 - nFilteredRows + nRowDestOffset),
1203 static_cast<SCROW>(nCombinedStartRow + nCol - nCol1), pTransClip->
nTab);
1208 std::unique_ptr<ScPostIt> pClonedNote = pNote->
Clone(
ScAddress(nCol, curRow, nTab), pTransClip->
rDocument, aDestPos,
true );
1216 for (
size_t curRow = nBlockStart + nOffsetInBlock;
1217 curRow <= nBlockEnd && curRow <= nRowPos; ++curRow)
1219 bool bFiltered = this->
RowFiltered(curRow,
nullptr,
nullptr);
1220 if (!bIncludeFiltered && bFiltered && curRow < nBlockEnd)
1227 static_cast<SCCOL>(nCol1 + curRow - nRow1 - nFilteredRows + nRowDestOffset),
1228 static_cast<SCROW>(nCombinedStartRow + nCol - nCol1), pTransClip->
nTab);
1253 std::shared_ptr<const sc::ColumnSet> pColSet = rCxt.
getColumnSet();
1259 else if (pColSet->hasTab( nTab))
1261 std::vector<SCCOL> aColumns;
1262 pColSet->getColumns( nTab, aColumns);
1263 for (
auto i : aColumns)
1275 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
1283 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
1291 if (nCol2 > rDocument.
MaxCol()) nCol2 = rDocument.
MaxCol();
1292 if (nRow2 > rDocument.
MaxRow()) nRow2 = rDocument.
MaxRow();
1294 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
1303 if (nCol2 > rDocument.
MaxCol()) nCol2 = rDocument.
MaxCol();
1304 if (nRow2 > rDocument.
MaxRow()) nRow2 = rDocument.
MaxRow();
1306 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
1313 bool bAsLink,
bool bColRowFlags,
bool bGlobalNamesToLocal,
bool bCopyCaptions )
1336 aCol[
i].CopyToColumn(rCxt, nRow1, nRow2, bIsUndoDoc ? nFlags : nTempFlags, bMarked,
1354 pNewDBData->GetArea(aTab, aCol1, aRow1, aCol2, aRow2);
1355 pNewDBData->MoveTo(pDestTab->
nTab, aCol1, aRow1, aCol2, aRow2);
1361 bool bFlagChange =
false;
1366 if (bWidth || bHeight)
1370 auto destTabColWidthIt = pDestTab->
mpColWidth->begin() + nCol1;
1371 auto thisTabColWidthIt =
mpColWidth->begin() + nCol1;
1374 for (
SCCOL i = nCol1;
i <= nCol2; ++
i)
1377 bool bHiddenChange = (pDestTab->
ColHidden(
i) != bThisHidden);
1378 bool bChange = bHiddenChange || (*destTabColWidthIt != *thisTabColWidthIt);
1381 if (bHiddenChange && pCharts)
1387 ++destTabColWidthIt;
1388 ++thisTabColWidthIt;
1404 for (
SCROW i = nRow1;
i <= nRow2; ++
i)
1407 bool bHidden =
RowHidden(
i,
nullptr, &nLastRow);
1408 if (nLastRow >= nRow2)
1412 bool bHiddenChanged = pDestTab->
SetRowHidden(
i, nLastRow, bHidden);
1413 if (bHiddenChanged && pCharts)
1425 for (
SCROW i = nRow1;
i <= nRow2; ++
i)
1429 if (nLastRow >= nRow2)
1442 if(nFlags & InsertDeleteFlags::ATTRIB)
1469 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
1476 bool bCloneCaption )
1482 for (
SCCOL i = nCol1;
i <= nCol2;
i++)
1485 pDestTab->
aCol[
i].UpdateNoteCaptions(nRow1, nRow2);
1517 if (
i >= nCol1 &&
i <= nCol2 )
1518 aCol[
i].UndoToColumn(rCxt, nRow1, nRow2, nFlags, bMarked, rDestCol);
1526 if (!(bWidth||bHeight))
1561 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1569 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1579 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1590 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1600 for (
size_t j = 0,
n = pList->
size(); j <
n; j++ )
1602 const ScRange & rR = (*pList)[j];
1618 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1632 OSL_ENSURE(
bScenario,
"bScenario == FALSE" );
1684 for (
SCCOL i = nCol1;
i <= nCol2; ++
i)
1687 SCROW nThisFirst = -1;
1688 if (const_cast<ScColumn&>(rCol).HasEditCells(nRow1, nRow2, nThisFirst))
1690 if (nThisFirst == nRow1)
1693 if (nThisFirst < nFirst)
1694 nFirst = nThisFirst;
1698 return nFirst == (rDocument.
MaxRow()+1) ? -1 : nFirst;
1706 aCol[nCol].Delete(nRow);
1751 return aCol[nCol].GetSharedString(nRow);
1769 return aCol[nCol].GetString( nRow, pContext );
1785 return aCol[nCol].GetInputString( nRow, pShared, bForceSystemLocale );
1793 return aCol[nCol].GetValue( nRow );
1802 return aCol[nCol].GetEditText(nRow);
1810 return aCol[nCol].RemoveEditTextCharAttribs(nRow, rAttr);
1816 return aCol[nCol].GetFormula( nRow );
1826 return aCol[nCol].GetFormulaCell(nRow);
1834 return aCol[nCol].GetFormulaCell(nRow);
1842 return std::shared_ptr<sc::Sparkline>();
1845 if (!pSparklineCell)
1846 return std::shared_ptr<sc::Sparkline>();
1848 return pSparklineCell->getSparkline();
1858 std::shared_ptr<sc::Sparkline> pSparkline(
new sc::Sparkline(nCol, nRow, pSparklineGroup));
1861 return pSparkline.get();
1869 aCol[nCol].DeleteSparkline(nRow);
1886 return aCol[nCol].ReleaseNote(nRow);
1893 return aCol[nCol].GetCellNote(nRow);
1909 return aCol[nCol].GetNoteCount();
1917 return aCol[nCol].GetNotePosition(nIndex);
1931 for (
SCCOL i = nCol1;
i <= nCol2; ++
i)
1948 aCol[nCol].GetNotesInRange(nStartRow, nEndRow, rNotes);
1956 bool bIsFirstNoteShownState =
true;
1957 bool bFirstControl =
true;
1964 if (bFirstControl && rDocument.
HasColNotes(nCol, nTab))
1966 aCol[nCol].GetNotesInRange(nStartRow, nEndRow, rNotes);
1967 bIsFirstNoteShownState = rNotes.
begin()->mpNote->IsCaptionShown();
1968 bFirstControl =
false;
1973 aCol[nCol].GetNotesInRange(nStartRow, nEndRow, rNotes);
1975 bool bIsMixedState = std::any_of(rNotes.begin(), rNotes.end(), [bIsFirstNoteShownState](
const sc::NoteEntry& rNote) {
1977 return bIsFirstNoteShownState != rNote.mpNote->IsCaptionShown(); });
1987 for (
auto const & pCol :
aCol)
1988 pCol->GetUnprotectedCells(0, rDocument.
MaxRow(), rRangeList);
1998 bool bContainsNote = !
aCol[nCol].IsNotesEmptyBlock(nStartRow, nEndRow);
2009 return aCol[nCol].GetCellType( nRow );
2018 return aCol[nCol].GetCellValue(nRow);
2026 return aCol[nCol].GetCellValue(rBlockPos, nRow);
2032 rRow = rDocument.
MaxRow()+1;
2036 while (nCol <
aCol.
size() && rRow > 0)
2051 while (nCol >= 0 && rRow < rDocument.
MaxRow())
2058 return aCol[nCol].HasDataAt( nRow );
2066 return aCol[nCol].HasStringData( nRow );
2074 return aCol[nCol].HasValueData( nRow );
2085 for (
SCCOL nCol = nStartCol; nCol <= nEndCol; nCol++)
2156 bool bBroadcasted =
false;
2159 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
2161 return bBroadcasted;
2193 aCol[
i].CompileXML(rCxt, rProgress);
2202 bool bCompiled =
false;
2225 for (
SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++)
2289 for(
SCCOL nCol = nCol1; nCol <= nCol2 && nCol <
aCol.
size(); ++nCol )
2308 for (
SCCOLROW j = aSpan.mnStart; j <= aSpan.mnEnd; ++j)
2323 OSL_FAIL(
"ScTable::ExtendMerge: invalid column number");
2328 bool bFound =
false;
2330 SCROW nOldEndY = rEndRow;
2331 for (
SCCOL i=nStartCol;
i<=nOldEndX;
i++)
2332 bFound |=
aCol[
i].
ExtendMerge(
i, nStartRow, nOldEndY, rEndCol, rEndRow, bRefresh );
2347 if (nCol1 < nCol2 && nRow1 < nRow2)
2355 OSL_FAIL(
"ScTable::IsBlockEmpty: invalid column number");
2360 for (
SCCOL i=nCol1;
i<=nCol2 && bEmpty;
i++)
2362 bEmpty =
aCol[
i].IsEmptyData( nRow1, nRow2 );
2365 bEmpty =
aCol[
i].IsSparklinesEmptyBlock(nRow1, nRow2);
2369 bEmpty =
aCol[
i].IsNotesEmptyBlock(nRow1, nRow2);
2387 else if ( nCol > nX2+1 )
2392 double nFactor = 0.0;
2397 double nRealOrient =
toRadians(nRotVal);
2398 double nCos = cos( nRealOrient );
2399 double nSin = sin( nRealOrient );
2405 nFactor = -fabs( nCos / nSin );
2408 for (
SCROW nRow = nAttrRow1; nRow <= nAttrRow2; nRow++ )
2412 bool bHitOne =
true;
2417 SCCOL nTouchedCol = nCol;
2419 OSL_ENSURE(nWidth <= 0,
"Wrong direction");
2420 while ( nWidth < 0 && nTouchedCol > 0 )
2425 if ( nTouchedCol > nX2 )
2431 while ( nArrY<nArrCount && pRowInfo[nArrY].nRowNo < nRow )
2433 if ( nArrY<nArrCount && pRowInfo[nArrY].nRowNo == nRow )
2448 OSL_FAIL(
"Row/column info missing" );
2464 SCROW nAttrRow1, nAttrRow2;
2477 for(
const auto& rItem : rCondFormatData)
2482 size_t nEntryCount = pFormat->
size();
2483 for (
size_t nEntry=0; nEntry<nEntryCount; nEntry++)
2491 if (!aStyleName.isEmpty())
2494 pStylePool->
Find( aStyleName, SfxStyleFamily::Para );
2498 nCol, nAttrRow1, nAttrRow2,
2499 nArrY, pPattern, &pStyleSheet->
GetItemSet() );
2509 nArrY =
FillMaxRot( pRowInfo, nArrCount, nX1, nX2,
2510 nCol, nAttrRow1, nAttrRow2,
2511 nArrY, pPattern,
nullptr );
2513 pPattern = aIter.
GetNext( nAttrCol, nAttrRow1, nAttrRow2 );
2520 bool bNoMatrixAtAll )
const
2527 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
2531 if ( nCol1 == nMaxCol2 )
2534 nEdges =
aCol[nCol1].GetBlockMatrixEdges( nRow1, nRow2, n, bNoMatrixAtAll );
2535 if ((nEdges != MatrixEdge::Nothing) && (((nEdges & n)!=n) || (nEdges & (MatrixEdge::Inside|MatrixEdge::Open))))
2541 if ((nEdges != MatrixEdge::Nothing) && ((!(nEdges &
MatrixEdge::Left)) || (nEdges & (MatrixEdge::Inside|MatrixEdge::Open))))
2545 if ((nEdges != MatrixEdge::Nothing) && ((!(nEdges &
MatrixEdge::Right)) || (nEdges & (MatrixEdge::Inside|MatrixEdge::Open))))
2551 for (
SCCOL i=nCol1;
i<=nMaxCol2;
i++)
2553 nEdges =
aCol[
i].GetBlockMatrixEdges( nRow1, nRow2, MatrixEdge::Nothing, bNoMatrixAtAll);
2554 if (nEdges != MatrixEdge::Nothing
2559 else if ( nRow1 == nRow2 )
2562 const MatrixEdge n = MatrixEdge::Bottom | MatrixEdge::Top;
2563 for (
SCCOL i=nCol1;
i<=nMaxCol2;
i++)
2565 nEdges =
aCol[
i].GetBlockMatrixEdges( nRow1, nRow1, n, bNoMatrixAtAll );
2566 if (nEdges != MatrixEdge::Nothing)
2568 if ( (nEdges & n) != n )
2587 for ( j=0, n = MatrixEdge::Top, nR=nRow1; j<2;
2588 j++, n = MatrixEdge::Bottom, nR=nRow2)
2591 for (
SCCOL i=nCol1;
i<=nMaxCol2;
i++)
2593 nEdges =
aCol[
i].GetBlockMatrixEdges( nR, nR, n, bNoMatrixAtAll );
2594 if ( nEdges != MatrixEdge::Nothing)
2598 if ( (nEdges & n) != n )
2623 for (
SCCOLROW j=aSpan.mnStart; j<=nEndCol; j++ )
2633 SCROW nRow2,
bool* pOnlyNotBecauseOfMatrix ,
2634 bool bNoMatrixAtAll )
const
2638 SAL_WARN(
"sc",
"IsBlockEditable: invalid column or row " << nCol2 <<
" " << nRow2);
2639 if (pOnlyNotBecauseOfMatrix)
2640 *pOnlyNotBecauseOfMatrix =
false;
2644 bool bIsEditable =
true;
2646 bIsEditable =
false;
2662 sal_uInt16 nScenTab = nTab+1;
2665 ScRange aEditRange(nCol1, nRow1, nScenTab, nCol2, nRow2, nScenTab);
2689 ScRange aEditRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab);
2702 bIsEditable =
false;
2703 if ( pOnlyNotBecauseOfMatrix )
2704 *pOnlyNotBecauseOfMatrix =
true;
2706 else if ( pOnlyNotBecauseOfMatrix )
2707 *pOnlyNotBecauseOfMatrix =
false;
2709 else if ( pOnlyNotBecauseOfMatrix )
2710 *pOnlyNotBecauseOfMatrix =
false;
2715 bool* pOnlyNotBecauseOfMatrix )
const
2717 bool bIsEditable =
true;
2719 bIsEditable =
false;
2736 SCTAB nScenTab = nTab+1;
2737 while(rDocument.
IsScenario(nScenTab) && bIsEditable)
2741 for (
size_t i=0, nRange = aRanges.
size(); (
i < nRange) && bIsEditable;
i++ )
2743 const ScRange & rRange = aRanges[
i ];
2770 for (
size_t i = 0, nRange = aRanges.
size(); (
i < nRange) && bIsEditable;
i++)
2772 const ScRange & rRange = aRanges[
i ];
2786 bIsEditable =
false;
2787 if ( pOnlyNotBecauseOfMatrix )
2788 *pOnlyNotBecauseOfMatrix =
true;
2790 else if ( pOnlyNotBecauseOfMatrix )
2791 *pOnlyNotBecauseOfMatrix =
false;
2793 else if ( pOnlyNotBecauseOfMatrix )
2794 *pOnlyNotBecauseOfMatrix =
false;
2809 OSL_FAIL(
"UnlockTable without LockTable");
2820 for (
SCCOL i = rSpan.mnStart;
i <= maxCol; ++
i)
2822 aCol[
i].MergeSelectionPattern( rState, rMark, bDeep );
2831 for (
SCCOL i=nCol1;
i<=nEndCol;
i++)
2833 if (nEndCol != nCol2)
2845 for (
SCCOL i=nStartCol;
i<=nEndCol;
i++)
2847 nStartRow, nEndRow, (
i==nStartCol), nEndCol-
i );
2859 for (
SCCOL i=nStartCol;
i<=nEndCol;
i++)
2861 nStartRow, nEndRow, (
i==nStartCol), nEndCol-
i);
2873 bool*
const pIsChanged )
2879 SCCOL maxCol = nEndCol;
2880 if( nEndCol ==
GetDoc().MaxCol())
2883 maxCol = std::max( nStartCol,
aCol.
size()) - 1;
2888 for (
SCCOL i = nStartCol;
i <= maxCol;
i++)
2896 if ( nEndCol == rDocument.
MaxCol() )
2902 for (
SCCOL i = nStartCol;
i <= nEndCol;
i++)
2916 for (
SCCOL i = nStartCol;
i < nEndCol;
i++)
2919 aCol[nEndCol].SetAttrEntries( std::move(vNewData));
2929 for (
SCCOL nCol = rRange.
aStart.
Col(); nCol <= nEndCol; nCol++ )
2931 aCol[nCol].ApplyPatternIfNumberformatIncompatible( rRange, rPattern, nNewType );
2937 size_t n = rRangeList.
size();
2938 for(
size_t i = 0;
i < n; ++
i)
2940 const ScRange & rRange = rRangeList[
i];
2945 for(
SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol)
2954 size_t n = rRangeList.
size();
2955 for(
size_t i = 0;
i < n; ++
i)
2957 const ScRange & rRange = rRangeList[
i];
2962 for(
SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol)
2964 aCol[nCol].RemoveCondFormat(nRowStart, nRowEnd, nIndex);
2974 for (
const auto& rIndex : rCondFormatIndexes)
2980 aRange.
Join(
ScRange( nCol, nStartRow, nTab, nCol, nEndRow, nTab));
3000 if ( nEndCol == rDocument.
MaxCol() )
3006 for (
SCCOL i = nStartCol;
i <= nEndCol;
i++)
3019 for (
SCCOL i = nStartCol;
i <= nEndCol;
i++)
3031 const ::editeng::SvxBorderLine* pLine,
bool bColorOnly )
3033 if ( bColorOnly && !pLine )
3060 pNewStyle =
aCol[
i].GetSelectionStyle( rMark, bColFound );
3064 if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) )
3070 return bEqual ? pStyle :
nullptr;
3084 for (
SCCOL i=nCol1;
i<=nCol2 && bEqual;
i++)
3086 pNewStyle =
aCol[
i].GetAreaStyle(bColFound, nRow1, nRow2);
3090 if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) )
3096 return bEqual ? pStyle :
nullptr;
3101 bool bIsUsed =
false;
3121 aCol[
i].FindStyleSheet(pStyleSheet, aUsedRows, bRemoved);
3125 while (nRow <= rDocument.
MaxRow())
3128 if (!aUsedRows.getRangeData(nRow, aData))
3143 bool bChanged =
false;
3145 for (
SCCOL i = nStartCol;
i <= nEndCol;
i++)
3155 bool bChanged =
false;
3157 for (
SCCOL i = nStartCol;
i <= nEndCol;
i++)
3192 SCCOL lastChangeCol;
3197 if( lastChangeCol >= 0 )
3207 for (
SCCOL i=0;
i <= lastChangeCol;
i++)
3215 SCCOL lastChangeCol;
3220 if( lastChangeCol >= 0 )
3230 for (
SCCOL i=0;
i <= lastChangeCol;
i++)
3238 SCCOL lastChangeCol;
3243 if( lastChangeCol >= 0 )
3253 for (
SCCOL i=0;
i <= lastChangeCol;
i++)
3268 if ( nNewWidth !=
mpColWidth->GetValue(nCol) )
3276 OSL_FAIL(
"Invalid column number or no widths");
3298 OSL_FAIL(
"SetRowHeight: Row height zero");
3303 if ( nNewHeight != nOldHeight )
3311 OSL_FAIL(
"Invalid row number or no heights");
3321 bool lcl_pixelSizeChanged(
3323 sal_uInt16 nNewHeight,
double nPPTY,
bool bApi)
3328 for (
SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow)
3331 if (!aFwdIter.getValue(nRow, nHeight))
3334 if (nHeight != nNewHeight)
3340 bool bChanged = (nNewPix != nOldPix) && (bApi || nEndRow - nStartRow > 0 || nNewPix > nOldPix);
3346 nRow = aFwdIter.getLastPos();
3354 double nPPTY,
bool bApi )
3356 bool bChanged =
false;
3361 OSL_FAIL(
"SetRowHeight: Row height zero");
3365 bool bSingle =
false;
3382 if (!bSingle || nEndRow - nStartRow < 20)
3384 bChanged = lcl_pixelSizeChanged(*
mpRowHeights, nStartRow, nEndRow, nNewHeight, nPPTY, bApi);
3386 mpRowHeights->setValue(nStartRow, nEndRow, nNewHeight);
3390 SCROW nMid = (nStartRow + nEndRow) / 2;
3403 OSL_FAIL(
"Invalid row number or no heights");
3417 mpRowHeights->setValue(nStartRow, nEndRow, nNewHeight);
3431 OSL_FAIL(
"Invalid row number or no column flags");
3437 OSL_ENSURE(
ValidCol(nCol),
"wrong column number");
3456 bool bHidden =
false;
3457 SCCOL nLastHiddenCol = -1;
3458 auto colWidthIt =
mpColWidth->begin() + nStartCol;
3459 for (
SCCOL nCol = nStartCol; nCol <= nEndCol; (++nCol <= nEndCol) ? ++colWidthIt : (
void)
false)
3461 if (nCol > nLastHiddenCol)
3462 bHidden =
ColHidden(nCol,
nullptr, &nLastHiddenCol);
3474 OSL_ENSURE(
ValidCol(nCol),
"wrong column number");
3488 OSL_FAIL(
"wrong column");
3489 nEndCol = rDocument.
MaxCol();
3492 sal_uInt16 nMaxWidth = 0;
3493 sal_uInt16 nMaxCount = 0;
3494 SCCOL nRangeStart = 0;
3495 while ( nRangeStart <= nEndCol )
3498 while ( nRangeStart <= nEndCol &&
ColHidden(nRangeStart) )
3500 if ( nRangeStart <= nEndCol )
3502 sal_uInt16 nThisCount = 0;
3503 auto colWidthIt =
mpColWidth->begin() + nRangeStart;
3504 sal_uInt16 nThisWidth = *colWidthIt;
3505 SCCOL nRangeEnd = nRangeStart;
3506 while ( nRangeEnd <= nEndCol && *colWidthIt == nThisWidth )
3513 while ( nRangeEnd <= nEndCol &&
ColHidden(nRangeEnd) )
3520 if ( nThisCount > nMaxCount )
3522 nMaxCount = nThisCount;
3523 nMaxWidth = nThisWidth;
3526 nRangeStart = nRangeEnd;
3539 if (bHiddenAsZero &&
RowHidden( nRow, pStartRow, pEndRow))
3559 *pStartRow = (bHiddenAsZero ? std::max( *pStartRow, aData.
mnRow1) : aData.
mnRow1);
3561 *pEndRow = (bHiddenAsZero ? std::min( *pEndRow, aData.
mnRow2) : aData.
mnRow2);
3582 SCROW nRow = nStartRow;
3583 while (nRow <= nEndRow)
3585 SCROW nLastRow = -1;
3586 if (!( (
RowHidden(nRow,
nullptr, &nLastRow) ) && bHiddenAsZero ) )
3588 if (nLastRow > nEndRow)
3592 nRow = nLastRow + 1;
3607 SCROW nRow = nStartRow;
3608 while (nRow <= nEndRow)
3610 SCROW nLastRow = -1;
3611 if (!
RowHidden(nRow,
nullptr, &nLastRow))
3613 if (nLastRow > nEndRow)
3618 while (nRow <= nLastRow)
3621 if (!aSegmentIter.
getValue(nRow, nRowVal))
3631 SCROW nRowsInSegment = nSegmentEnd + 1 - nRow;
3634 nRowsInSegment = std::min(nRowsInSegment, static_cast<SCROW>(*pnMaxHeight / nOneHeight + 1));
3635 nHeight += nOneHeight * nRowsInSegment;
3636 if (nHeight > *pnMaxHeight)
3640 nHeight += nOneHeight * nRowsInSegment;
3643 nRow = nSegmentEnd + 1;
3646 nRow = nLastRow + 1;
3653 SCROW nRowsInSegment = nEndRow - nStartRow + 1;
3656 nRowsInSegment = std::min(nRowsInSegment, static_cast<SCROW>(*pnMaxHeight / nOneHeight + 1));
3657 return nOneHeight * nRowsInSegment;
3660 return static_cast<tools::Long>(nRowsInSegment * nOneHeight);
3666 OSL_ENSURE(
ValidRow(nRow),
"wrong row number");
3681 SCROW nLastRow = -1;
3685 return nLastRow - nRow + 1;
3695 if (bWasVis != bShow)
3706 OSL_FAIL(
"Invalid column number or no flags");
3715 if (bWasVis != bShow)
3729 OSL_FAIL(
"Invalid row number or no flags");
3755 OSL_FAIL(
"Invalid row number or no flags");
3761 SCROW nStartRow = nRow1;
3762 while (nStartRow <= nRow2)
3765 bool bWasVis = !
RowHiddenLeaf(nStartRow,
nullptr, &nEndRow);
3766 if (nEndRow > nRow2)
3769 bool bChanged = ( bWasVis != bShow );
3781 nStartRow = nEndRow + 1;
3793 SCROW nStartRow = nRow1;
3797 bool bHasObjects = pDrawLayer && pDrawLayer->
HasObjectsInRows( nTab, nRow1, nRow2 );
3799 while (nStartRow <= nRow2)
3802 bool bWasVis = !
RowHiddenLeaf(nStartRow,
nullptr, &nEndRow);
3803 if (nEndRow > nRow2)
3806 bool bChanged = ( bWasVis != bShow );
3821 nStartRow = nEndRow + 1;
3835 assert(nColStart <= nColEnd && nRowStart <= nRowEnd
3836 &&
"range must be normalized to obtain a valid result");
3837 for (
SCROW i = nRowStart;
i <= nRowEnd; ++
i)
3842 for (
SCCOL i = nColStart;
i <= nColEnd; ++
i)
3863 OSL_FAIL(
"Invalid row number or no flags");
3870 pRowFlags->SetValue( nStartRow, nEndRow, nNewFlags);
3873 OSL_FAIL(
"Invalid row number(s) or no flags");
3895 SCROW nLastFound = 0;
3910 nLastFound = ::std::max(nLastFound, nRow);
3917 nLastFound = ::std::max(nLastFound, nRow);
3928 SCCOL nLastFound = 0;
3951 return std::max( nLastFlags, nLastHeight);
3958 return pOutlineTable->GetColArray().ManualAction( nStartCol, nEndCol, bShow, *
this,
true );
3967 return pOutlineTable->GetRowArray().ManualAction( nStartRow, nEndRow, bShow, *
this,
false );
3994 if (rY2 < rDocument.
MaxRow())
4015 if (
ValidRow(nStartRow) && nStartRow >= rY1)
4030 template<
typename T >
4039 class OutlineArrayFinder
4049 maRef(rRef), mnCol(nCol), mnTab(nTab), mpArray(pArray),
4050 mbSizeChanged(bSizeChanged) {}
4074 typedef mdds::flat_segment_tree<SCROW, bool> UsedRowsType;
4076 bool bSizeChanged =
false;
4089 UsedRowsType aUsed(0, rDocument.
MaxRow()+1,
false);
4090 for (nCol=nStartCol; nCol<=nEndCol; nCol++)
4091 aCol[nCol].FindUsed(nStartRow, nEndRow, aUsed);
4095 for (nRow=nStartRow; nRow<=nEndRow; nRow++)
4098 SCROW nLastRow = nRow;
4099 aUsed.search_tree(nRow, bUsed,
nullptr, &nLastRow);
4107 for (nCol=nStartCol; nCol<=nEndCol && !bFound; nCol++)
4132 for (nCol=nStartCol; nCol<=nEndCol; nCol++)
4137 OutlineArrayFinder aFunc(aRef, nCol, nTab, &rColArray, bSizeChanged);
4149 ScAddress aSrc( nStartCol, nStartRow, nTab );
4150 ScAddress aDest( nDestCol, nDestRow, nDestTab );
4151 ScRange aRange( aSrc, aDest );
4152 bool bThisTab = ( nDestTab ==
nTab );
4153 SCROW nDestY = nDestRow;
4154 for (
SCROW nRow=nStartRow; nRow<=nEndRow; nRow++)
4158 SCCOL nDestX = nDestCol;
4159 for (
SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++)
4185 aCell.
release(rDocument, aDest);
4206 nEndRow = ::std::numeric_limits<SCROW>::max();
4230 const sal_Int64 nMax = ::std::numeric_limits<tools::Long>::max();
4243 pDrawLayer->
SetPageSize(static_cast<sal_uInt16>(nTab),
Size(x, y), bUpdateNoteCaptionPos,
4249 if (bResetStreamValid)
4276 return GetRowHeight(0,
nullptr,
nullptr, bHiddenAsZero );
4279 #if OSL_DEBUG_LEVEL > 0
4280 if (n == ::std::numeric_limits<tools::Long>::max())
4281 OSL_FAIL(
"ScTable::GetRowOffset: row heights overflow");
4286 OSL_FAIL(
"GetRowOffset: Data missing");
4298 aRowHeightRange.
mnRow2 = -1;
4301 for (
SCROW nRow = 0; nRow <= rDocument.
MaxRow(); ++nRow)
4314 if (aRowHeightRange.
mnRow2 < nRow)
4316 if (!
mpRowHeights->getRangeData(nRow, aRowHeightRange))
4323 assert (nLastCommon >= nRow);
4324 SCROW nCommon = nLastCommon - nRow + 1;
4331 if (nCommonPixels > nPixelsLeft)
4333 nRow += (nPixelsLeft + aRowHeightRange.
mnValue - 1) / aRowHeightRange.
mnValue;
4338 return rDocument.
MaxRow();
4348 return nRow <= rDocument.
MaxRow() ? nRow : rDocument.
MaxRow();
4352 nSum += nCommonPixels;
4364 for (
SCCOL i = 0;
i < nCol; (++
i < nCol) ? ++colWidthIt : (
void)
false)
4370 OSL_FAIL(
"GetColumnOffset: Data missing");
constexpr sal_Int32 STD_COL_WIDTH
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)
const ScRange & GetArea() const
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.
bool Intersects(const ScRange &) const
void CopySparklinesToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable *pDestTab)
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
ScColumnsRange GetAllocatedColumnsRange(SCCOL begin, SCCOL end) const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) 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.
bool SetOptimalHeight(sc::RowHeightContext &rCxt, SCROW nStartRow, SCROW nEndRow, bool bApi, ScProgress *pOuterProgress=nullptr, sal_uInt64 nProgressStart=0)
void ForgetNoteCaptions(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bPreserveData)
void SetAllFormulasDirty(const sc::SetFormulaDirtyContext &rCxt)
void SetRowFlags(SCROW nRow, CRFlags nNewFlags)
void SetRowHeight(SCROW nRow, sal_uInt16 nNewHeight)
std::unique_ptr< ScFlatUInt16RowSegments > mpRowHeights
void CopyScenarioTo(ScTable *pDestTab) const
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
void SetPatternAreaCondFormat(SCCOL nCol, SCROW nStartRow, SCROW nEndRow, const ScPatternAttr &rAttr, const ScCondFormatIndexes &rCondFormatIndexes)
Simple container to keep track of sheet - column pair.
sc::Sparkline * CreateSparkline(SCCOL nCol, SCROW nRow, std::shared_ptr< sc::SparklineGroup > const &pSparklineGroup)
Single reference (one address) into the sheet.
void ApplyPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPatternAttr &rPatAttr, ScEditDataArray *pDataArray=nullptr, bool *const pIsChanged=nullptr)
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.
const ScPatternAttr * GetPattern(SCROW nRow) const
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)
Tracks and gathers all created sparklines and sparkline groups.
void CopyData(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCCOL nDestCol, SCROW nDestRow, SCTAB nDestTab)
bool Intersects(const ScRange &rRange) const
SCROW GetRowForHeight(tools::Long nHeight) const
Get the last row such that the height of row 0 to the end row is as high as possible without exceedin...
bool TestInsertRow(SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize) const
void SetCellNote(SCROW nRow, std::unique_ptr< ScPostIt > pNote)
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
ScColumn & CreateColumnIfNotExists(const SCCOL nScCol)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
void SetCalcNotification(bool bSet)
void SetEditText(SCROW nRow, std::unique_ptr< EditTextObject > pEditText)
const SfxPoolItem & GetAttr(SCROW nRow, sal_uInt16 nWhich) 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)
std::unordered_map< sal_uInt32, sal_uInt32 > SvNumberFormatterMergeMap
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
Store position data for column array storage.
sal_uInt16 GetDistance(SvxBoxItemLine nLine) const
InsertDeleteFlags getInsertFlag() const
bool IsClipOrUndo() const
void TransposeColPatterns(ScTable *pTransClip, SCCOL nCol1, SCCOL nCol, SCROW nRow1, SCROW nRow2, SCROW nCombinedStartRow, bool bIncludeFiltered, const std::vector< SCROW > &rFilteredRows, SCROW nRowDestOffset)
Transpose clipboard patterns.
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
void SetManualHeight(SCROW nStartRow, SCROW nEndRow, bool bManual)
void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden)
ScPostIt * GetNote(SCCOL nCol, SCROW nRow)
void SetAttrEntries(std::vector< ScAttrEntry > &&vNewData)
virtual SfxItemSet & GetItemSet()
This is very similar to ScCellValue, except that it references the original value instead of copying ...
void UndoToTable(sc::CopyToDocContext &rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, InsertDeleteFlags nFlags, bool bMarked, ScTable *pDestTab)
Sparkline data, used for rendering the content of a cell.
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
const ScStyleSheet * GetStyle(SCCOL nCol, SCROW nRow) const
void ChangeSelectionIndent(bool bIncrement, const ScMarkData &rMark, SCCOL nCol)
void TransposeClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCROW nCombinedStartRow, SCROW nRowDestOffset, ScTable *pTransClip, InsertDeleteFlags nFlags, bool bAsLink, bool bIncludeFiltered)
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
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
bool bTableAreaVisibleValid
void ApplyAttr(SCCOL nCol, SCROW nRow, const SfxPoolItem &rAttr)
ScColumnData aDefaultColData
sc::SparklineList maSparklineList
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()
bool TestInsertRow(SCSIZE nSize) const
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)
OUString GetFormula(SCCOL nCol, SCROW nRow) const
void AttachFormulaCells(sc::StartListeningContext &rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Store arbitrary cell value of any kind.
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.
static void lcl_SetTransposedPatternInRows(ScTable *pTransClip, SCROW nAttrRow1, SCROW nAttrRow2, SCCOL nCol1, SCROW nRow1, SCROW nCombinedStartRow, SCCOL nCol, const ScPatternAttr &rPatternAttr, bool bIncludeFiltered, const std::vector< SCROW > &rFilteredRows, SCROW nRowDestOffset)
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
tools::Long GetScaledRowHeight(SCROW nStartRow, SCROW nEndRow, double fScale, const tools::Long *pnMaxHeight=nullptr) 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
Additional class containing cell annotation data.
void TransposeColNotes(ScTable *pTransClip, SCCOL nCol1, SCCOL nCol, SCROW nRow1, SCROW nRow2, SCROW nCombinedStartRow, bool bIncludeFiltered, SCROW nRowDestOffset)
Transpose clipboard notes.
static short DiffSign(T a, T b)
bool UpdateOutlineCol(SCCOL nStartCol, SCCOL nEndCol, bool bShow)
void SetNumberFormat(SCROW nRow, sal_uInt32 nNumberFormat)
void MergePatternArea(ScMergePatternState &rState, SCROW nRow1, SCROW nRow2, bool bDeep) const
double * GetValueCell(SCCOL nCol, SCROW nRow)
sc::CellStoreType maCells
std::shared_ptr< sc::Sparkline > GetSparkline(SCCOL nCol, SCROW nRow)
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)
SCCOL GetLastChangedColFlagsWidth() const
void SetRowManualBreaks(::std::set< SCROW > &&rBreaks)
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)
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
tools::Long GetRowOffset(SCROW nRow, bool bHiddenAsZero=true) const
void SetAttrEntries(SCCOL nStartCol, SCCOL nEndCol, std::vector< ScAttrEntry > &&vNewData)
sal_uInt16 GetOriginalWidth(SCCOL nCol) const
bool HasSelectionMatrixFragment(const ScMarkData &rMark) const
std::unique_ptr< ScBitMaskCompressedArray< SCCOL, CRFlags > > mpColFlags
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 &