12 #include <document.hxx>
23 #include <osl/diagnose.h>
32 return aCol[nCol].IsMerged(nRow);
40 if (nCol1 > nCol2 || nRow1 > nRow2)
61 for (
SCCOL nCol = nCol1; nCol <= nCol2 && nCol <= nMaxCol; ++nCol)
63 SCROW nFirstDataRow = -1;
64 switch (
aCol[nCol].HasDataCellsInRange(nRow1, nRow2, &nFirstDataRow))
68 setFirstCell(aRet, nCol, nFirstDataRow);
81 setFirstCell(aRet, nCol, nFirstDataRow);
114 if (nClipCol > aClipRange.
aEnd.
Col())
118 aCol[nCol].DeleteBeforeCopyFromClip(rCxt, rClipCol, rBroadcastSpans);
131 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
133 SCCOL nColOffset = nCol - nCol1;
134 nColOffset = nColOffset % nSrcColSize;
140 for (
SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
142 nRow - nSrcRow, pSrcTab);
165 OSL_ENSURE(pDrawLayer,
"No drawing layer");
172 aSrcStartPos.
Col(), aSrcStartPos.
Row(), aSrcEndPos.
Col(), aSrcEndPos.
Row(),
211 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
250 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
252 for (
SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
266 return nRow2 <= aData.
mnRow2;
290 aCol[nCol].RegroupFormulaCells();
298 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
300 for (
SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
313 aCol[nCol].EndListeningIntersectedGroup(rCxt, nRow, pGroupPos);
318 std::vector<ScAddress>* pGroupPos )
324 aCol[nCol].EndListeningIntersectedGroups(rCxt, nRow1, nRow2, pGroupPos);
332 aCol[nCol].EndListeningGroup(rCxt, nRow);
427 return std::unique_ptr<sc::ColumnIterator>();
437 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
439 bool bAnyDirty =
false;
441 for (
SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
443 bool bRet =
aCol[nCol].EnsureFormulaCellResults(nRow1, nRow2, bSkipRunning);
444 bAnyDirty = bAnyDirty || bRet;
465 GetDataArea(nStartCol, nStartRow, nEndCol, nEndRow,
false,
false);
468 for (
SCCOL nCol = 0; nCol <= nEndCol; ++nCol)
470 aCol[nCol].StoreToCache(rStrm);
476 sal_uInt64 nCols = 0;
478 for (
SCCOL nCol = 0; nCol < static_cast<SCCOL>(nCols); ++nCol)
480 aCol[nCol].RestoreFromCache(rStrm);
521 static const OString aDefaultForCols
523 static const OString aDefaultForRows
530 auto dumpColWidths = [](
const ColWidthsType& rWidths) -> OString {
534 const SCCOL nMaxCol = std::min(rWidths.GetLastPos(),
MAXCOL);
536 while (nStartCol <= nMaxCol)
539 sal_uInt16 nWidth = rWidths.
GetValue(nStartCol, nDummy, nEndCol);
541 if (nEndCol > nMaxCol)
543 aSegment = OString::number(nWidth) +
":" + OString::number(nEndCol) +
" ";
545 nStartCol = nEndCol + 1;
560 static const OString aDefaultForCols =
"0:" + OString::number(
MAXCOL) +
" ";
561 static const OString aDefaultForRows =
"0:" + OString::number(
MAXROW) +
" ";
602 SAL_WARN(
"sc.core",
"ScTable::SetLOKFreezeCol : invalid nFreezeCol = " << nFreezeCol);
619 SAL_WARN(
"sc.core",
"ScTable::SetLOKFreezeRow : invalid nFreezeRow = " << nFreezeRow);
SvStream & WriteUInt64(sal_uInt64 nuInt64)
bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, HasAttrFlags nMask) const
void TransferCellValuesTo(const SCCOL nCol, SCROW nRow, size_t nLen, sc::CellValues &rDest)
bool HasBlockMatrixFragment(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bNoMatrixAtAll=false) const
std::unique_ptr< ScFlatUInt16RowSegments > mpRowHeights
void SetValues(const SCCOL nCol, const SCROW nRow, const std::vector< double > &rVals)
void SwapNonEmpty(sc::TableValues &rValues, sc::StartListeningContext &rStartCxt, sc::EndListeningContext &rEndCxt)
void UpdateScriptTypes(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2)
bool HasFormulaCell(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2) const
Think of this as a mini-ScColumn like storage that only stores cell values in a column.
std::unique_ptr< ScFlatBoolColSegments > mpFilteredCols
void TransferCellValuesTo(SCROW nRow, size_t nLen, sc::CellValues &rDest)
InsertDeleteFlags getInsertFlag() const
Stores cell values for multiple tables.
void CopyFromClip(ScDrawLayer *pClipModel, SCTAB nSourceTab, const tools::Rectangle &rSourceRange, const ScAddress &rDestPos, const tools::Rectangle &rDestRange)
sal_uInt16 GetOriginalHeight(SCROW nRow) const
SvStream & ReadUInt64(sal_uInt64 &rUInt64)
void CompileHybridFormula(sc::StartListeningContext &rStartListenCxt, sc::CompileFormulaContext &rCompileCxt)
void RestoreFromCache(SvStream &rStrm)
void PreprocessDBDataUpdate(sc::EndListeningContext &rEndListenCxt, sc::CompileFormulaContext &rCompileCxt)
Internal use only (d&d undo): do not delete caption objects of cell notes.
bool ValidRow(SCROW nRow) const
void SetStreamValid(bool bSet, bool bIgnoreLock=false)
ScColumn & CreateColumnIfNotExists(const SCCOL nScCol) const
bool IsEditActionAllowed(sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd) const
ScClipParam & GetClipParam()
bool IsBlockEditable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool *pOnlyNotBecauseOfMatrix=nullptr, bool bNoMatrixAtAll=false) const
SC_DLLPUBLIC SCROW MaxRow() const
void finalizeOutlineImport()
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void setCondFormatList(ScConditionalFormatList *pCondFormatList)
void ConvertFormulaToValue(sc::EndListeningContext &rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2, sc::TableValues *pUndo)
void PreprocessRangeNameUpdate(sc::EndListeningContext &rEndListenCxt, sc::CompileFormulaContext &rCompileCxt)
void CopyCellValuesFrom(const SCCOL nCol, SCROW nRow, const sc::CellValues &rSrc)
void EndListeningIntersectedGroups(sc::EndListeningContext &rCxt, const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, std::vector< ScAddress > *pGroupPos)
bool HasUniformRowHeight(SCROW nRow1, SCROW nRow2) const
std::unique_ptr< ScOutlineTable > pOutlineTable
void SetNeedsListeningGroup(SCCOL nCol, SCROW nRow)
std::unique_ptr< ScDrawLayer > mpDrawLayer
bool IsColValid(const SCCOL nScCol) const
constexpr OUStringLiteral aData
void CopyOneCellFromClip(sc::CopyFromClipContext &rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2, const SCROW nSrcRow, const ScTable *pSrcTab)
static SC_DLLPUBLIC sal_uInt16 nStdRowHeight
OString dumpColumnRowGroups(bool bColumns) const
Returns list-of-spans representation of the column/row groupings encoded as an OString.
std::unique_ptr< ScFlatBoolColSegments > mpHiddenCols
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
SC_DLLPUBLIC SCCOL MaxCol() const
bool ValidCol(SCCOL nCol) const
void SetValues(const SCROW nRow, const std::vector< double > &rVals)
void UnshareFormulaCells(SCCOL nCol, std::vector< SCROW > &rRows)
sc::MultiDataCellState HasMultipleDataCells(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
ScAddress maLOKFreezeCell
std::unique_ptr< ScTableProtection > pTabProtection
Structure that stores segments of boolean flags per column, and perform custom action on those segmen...
OString dumpHiddenFiltered(bool bColumns, bool bHidden)
Returns list-of-spans representation of hidden/filtered states of columns/rows encoded as an OString...
const ScRange & getRange() const
std::unique_ptr< ScConditionalFormatList > mpCondFormatList
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
void setTableProtected(bool b)
SheetGeomType
Represents the type of sheet geometry data.
void EndListeningGroup(sc::EndListeningContext &rCxt, const SCCOL nCol, SCROW nRow)
SCROW GetLOKFreezeRow() const
bool SetLOKFreezeCol(SCCOL nFreezeCol)
const D & GetValue(A nPos) const
ScRange getWholeRange() const
Return a single range that encompasses all individual ranges.
std::unique_ptr< ScFlatBoolRowSegments > mpFilteredRows
std::unique_ptr< sc::ColumnIterator > GetColumnIterator(SCCOL nCol, SCROW nRow1, SCROW nRow2) const
void CopyCellValuesFrom(SCROW nRow, const sc::CellValues &rSrc)
void GetDataArea(SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bIncludeOld, bool bOnlyDown) const
bool ValidColRow(SCCOL nCol, SCROW nRow) const
void CopyConditionalFormat(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCCOL nDx, SCROW nDy, const ScTable *pTable)
ScColumnsRange GetColumnsRange(SCCOL begin, SCCOL end) const
std::unique_ptr< sc::ColumnIterator > GetColumnIterator(SCROW nRow1, SCROW nRow2) const
void CopyOneCellFromClip(sc::CopyFromClipContext &rCxt, SCROW nRow1, SCROW nRow2, size_t nColOffset)
std::unique_ptr< ScCompressedArray< SCCOL, sal_uInt16 > > mpColWidth
ScDocument * getClipDoc()
bool SetLOKFreezeRow(SCROW nFreezeRow)
Compressed array of row (or column) entries, e.g.
void ConvertFormulaToValue(sc::EndListeningContext &rCxt, SCROW nRow1, SCROW nRow2, sc::TableValues *pUndo)
bool EnsureFormulaCellResults(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bSkipRunning=false)
void RegroupFormulaCells(SCCOL nCol)
Range getDestRange() const
#define SAL_WARN(area, stream)
void DeleteBeforeCopyFromClip(sc::CopyFromClipContext &rCxt, const ScTable &rClipTab, sc::ColumnSpanSet &rBroadcastSpans)
void EndListeningIntersectedGroup(sc::EndListeningContext &rCxt, SCCOL nCol, SCROW nRow, std::vector< ScAddress > *pGroupPos)
std::unique_ptr< ScBitMaskCompressedArray< SCROW, CRFlags > > pRowFlags
void SwapNonEmpty(sc::TableValues &rValues, sc::StartListeningContext &rStartCxt, sc::EndListeningContext &rEndCxt)
void StoreToCache(SvStream &rStrm) const
std::unique_ptr< ScFlatBoolRowSegments > mpHiddenRows
SCCOL GetAllocatedColumnsCount() const
void SetNeedsListeningGroup(SCROW nRow)
SCCOL GetLOKFreezeCol() const
bool IsMerged(SCCOL nCol, SCROW nRow) const
void SplitFormulaGroups(SCCOL nCol, std::vector< SCROW > &rRows)
OString dumpSheetGeomData(bool bColumns, SheetGeomType eGeomType)
Serializes the sheet's geometry data.
OString dumpColumnRowSizes(bool bColumns)
Returns list-of-spans representation of the column-widths/row-heights in twips encoded as an OString...