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);
113 for (
SCCOL nCol = aRange.
mnCol1; nCol <= nMaxCol2; ++nCol, ++nClipCol)
115 if (nClipCol > aClipRange.
aEnd.
Col())
119 aCol[nCol].DeleteBeforeCopyFromClip(rCxt, rClipCol, rBroadcastSpans);
132 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
134 SCCOL nColOffset = nCol - nCol1;
135 nColOffset = nColOffset % nSrcColSize;
136 assert(nColOffset >= 0);
141 for (
SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
143 nRow - nSrcRow, pSrcTab);
166 OSL_ENSURE(pDrawLayer,
"No drawing layer");
173 aSrcStartPos.
Col(), aSrcStartPos.
Row(), aSrcEndPos.
Col(), aSrcEndPos.
Row(),
212 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
251 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
253 for (
SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
267 return nRow2 <=
aData.mnRow2;
291 aCol[nCol].RegroupFormulaCells();
299 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
301 for (
SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
314 aCol[nCol].EndListeningIntersectedGroup(rCxt, nRow, pGroupPos);
319 std::vector<ScAddress>* pGroupPos )
325 aCol[nCol].EndListeningIntersectedGroups(rCxt, nRow1, nRow2, pGroupPos);
333 aCol[nCol].EndListeningGroup(rCxt, nRow);
438 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
440 bool bAnyDirty =
false;
442 for (
SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
444 bool bRet =
aCol[nCol].EnsureFormulaCellResults(nRow1, nRow2, bSkipRunning);
445 bAnyDirty = bAnyDirty || bRet;
466 GetDataArea(nStartCol, nStartRow, nEndCol, nEndRow,
false,
false);
469 for (
SCCOL nCol = 0; nCol <= nEndCol; ++nCol)
477 sal_uInt64 nCols = 0;
479 for (
SCCOL nCol = 0; nCol < static_cast<SCCOL>(nCols); ++nCol)
522 static const OString aDefaultForCols
524 static const OString aDefaultForRows
531 auto dumpColWidths = [
this](
const ColWidthsType& rWidths) -> OString {
535 const SCCOL nMaxCol = std::min(rWidths.GetLastPos(),
GetDoc().MaxCol());
537 while (nStartCol <= nMaxCol)
540 sal_uInt16 nWidth = rWidths.GetValue(nStartCol, nDummy, nEndCol);
542 if (nEndCol > nMaxCol)
544 aSegment = OString::number(nWidth) +
":" + OString::number(nEndCol) +
" ";
546 nStartCol = nEndCol + 1;
561 static const OString aDefaultForCols =
"0:" + OString::number(
GetDoc().MaxCol()) +
" ";
562 static const OString aDefaultForRows =
"0:" + OString::number(
GetDoc().MaxRow()) +
" ";
603 SAL_WARN(
"sc.core",
"ScTable::SetLOKFreezeCol : invalid nFreezeCol = " << nFreezeCol);
620 SAL_WARN(
"sc.core",
"ScTable::SetLOKFreezeRow : invalid nFreezeRow = " << nFreezeRow);
635 std::set<SCCOL> aColIndices;
637 for (
const auto& pCol :
aCol)
639 if (pCol->HasFormulaCell())
640 aColIndices.insert(pCol->GetCol());
648 for (
const auto& pCol :
aCol)
649 pCol->CheckIntegrity();
void TransferCellValuesTo(SCROW nRow, size_t nLen, sc::CellValues &rDest)
void ConvertFormulaToValue(sc::EndListeningContext &rCxt, SCROW nRow1, SCROW nRow2, sc::TableValues *pUndo)
std::optional< sc::ColumnIterator > GetColumnIterator(SCROW nRow1, SCROW nRow2) const
void SwapNonEmpty(sc::TableValues &rValues, sc::StartListeningContext &rStartCxt, sc::EndListeningContext &rEndCxt)
void SetNeedsListeningGroup(SCROW nRow)
void CopyOneCellFromClip(sc::CopyFromClipContext &rCxt, SCROW nRow1, SCROW nRow2, size_t nColOffset)
void SetValues(const SCROW nRow, const std::vector< double > &rVals)
void CopyCellValuesFrom(SCROW nRow, const sc::CellValues &rSrc)
Compressed array of row (or column) entries, e.g.
ScClipParam & GetClipParam()
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
std::unique_ptr< ScDrawLayer > mpDrawLayer
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
void CopyFromClip(ScDrawLayer *pClipModel, SCTAB nSourceTab, const tools::Rectangle &rSourceRange, const ScAddress &rDestPos, const tools::Rectangle &rDestRange)
static SC_DLLPUBLIC sal_uInt16 nStdRowHeight
std::unique_ptr< ScFlatBoolColSegments > mpHiddenCols
SCCOL GetLOKFreezeCol() const
bool ValidCol(SCCOL nCol) const
sal_uInt16 GetOriginalHeight(SCROW nRow) const
bool IsBlockEditable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool *pOnlyNotBecauseOfMatrix=nullptr, bool bNoMatrixAtAll=false) const
bool HasBlockMatrixFragment(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bNoMatrixAtAll=false) const
std::unique_ptr< ScFlatBoolRowSegments > mpFilteredRows
ScColumnsRange GetAllocatedColumnsRange(SCCOL begin, SCCOL end) const
bool HasFormulaCell(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2) const
bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, HasAttrFlags nMask) const
void EndListeningGroup(sc::EndListeningContext &rCxt, const SCCOL nCol, SCROW nRow)
OString dumpColumnRowSizes(bool bColumns)
Returns list-of-spans representation of the column-widths/row-heights in twips encoded as an OString.
std::unique_ptr< ScConditionalFormatList > mpCondFormatList
bool ValidColRow(SCCOL nCol, SCROW nRow) const
std::unique_ptr< ScBitMaskCompressedArray< SCROW, CRFlags > > pRowFlags
bool IsEditActionAllowed(sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd) const
void UpdateScriptTypes(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2)
ScColumn & CreateColumnIfNotExists(const SCCOL nScCol)
bool IsColValid(const SCCOL nScCol) const
void SetStreamValid(bool bSet, bool bIgnoreLock=false)
void GetDataArea(SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bIncludeOld, bool bOnlyDown) const
void CheckIntegrity() const
std::unique_ptr< ScFlatBoolColSegments > mpFilteredCols
std::optional< sc::ColumnIterator > GetColumnIterator(SCCOL nCol, SCROW nRow1, SCROW nRow2) const
void CopyConditionalFormat(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCCOL nDx, SCROW nDy, const ScTable *pTable)
bool HasUniformRowHeight(SCROW nRow1, SCROW nRow2) const
std::unique_ptr< ScOutlineTable > pOutlineTable
SCROW GetLOKFreezeRow() const
sc::MultiDataCellState HasMultipleDataCells(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
void PreprocessRangeNameUpdate(sc::EndListeningContext &rEndListenCxt, sc::CompileFormulaContext &rCompileCxt)
void SetNeedsListeningGroup(SCCOL nCol, SCROW nRow)
void CopyOneCellFromClip(sc::CopyFromClipContext &rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2, const SCROW nSrcRow, const ScTable *pSrcTab)
ScAddress maLOKFreezeCell
void SetValues(const SCCOL nCol, const SCROW nRow, const std::vector< double > &rVals)
void DeleteBeforeCopyFromClip(sc::CopyFromClipContext &rCxt, const ScTable &rClipTab, sc::ColumnSpanSet &rBroadcastSpans)
OString dumpSheetGeomData(bool bColumns, SheetGeomType eGeomType)
Serializes the sheet's geometry data.
void UnshareFormulaCells(SCCOL nCol, std::vector< SCROW > &rRows)
OString dumpColumnRowGroups(bool bColumns) const
Returns list-of-spans representation of the column/row groupings encoded as an OString.
void EndListeningIntersectedGroups(sc::EndListeningContext &rCxt, const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, std::vector< ScAddress > *pGroupPos)
std::unique_ptr< ScCompressedArray< SCCOL, sal_uInt16 > > mpColWidth
void RestoreFromCache(SvStream &rStrm)
SCCOL GetAllocatedColumnsCount() const
void ConvertFormulaToValue(sc::EndListeningContext &rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2, sc::TableValues *pUndo)
void SplitFormulaGroups(SCCOL nCol, std::vector< SCROW > &rRows)
bool EnsureFormulaCellResults(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bSkipRunning=false)
void SwapNonEmpty(sc::TableValues &rValues, sc::StartListeningContext &rStartCxt, sc::EndListeningContext &rEndCxt)
std::unique_ptr< ScFlatBoolRowSegments > mpHiddenRows
void finalizeOutlineImport()
std::set< SCCOL > QueryColumnsWithFormulaCells() const
void PreprocessDBDataUpdate(sc::EndListeningContext &rEndListenCxt, sc::CompileFormulaContext &rCompileCxt)
std::unique_ptr< ScFlatUInt16RowSegments > mpRowHeights
void TransferCellValuesTo(const SCCOL nCol, SCROW nRow, size_t nLen, sc::CellValues &rDest)
void CopyCellValuesFrom(const SCCOL nCol, SCROW nRow, const sc::CellValues &rSrc)
void CompileHybridFormula(sc::StartListeningContext &rStartListenCxt, sc::CompileFormulaContext &rCompileCxt)
void EndListeningIntersectedGroup(sc::EndListeningContext &rCxt, SCCOL nCol, SCROW nRow, std::vector< ScAddress > *pGroupPos)
void RegroupFormulaCells(SCCOL nCol)
void StoreToCache(SvStream &rStrm) const
OString dumpHiddenFiltered(bool bColumns, bool bHidden)
Returns list-of-spans representation of hidden/filtered states of columns/rows encoded as an OString.
bool SetLOKFreezeCol(SCCOL nFreezeCol)
bool SetLOKFreezeRow(SCROW nFreezeRow)
std::unique_ptr< ScTableProtection > pTabProtection
bool IsMerged(SCCOL nCol, SCROW nRow) const
bool ValidRow(SCROW nRow) const
SvStream & ReadUInt64(sal_uInt64 &rUInt64)
SvStream & WriteUInt64(sal_uInt64 nuInt64)
Think of this as a mini-ScColumn like storage that only stores cell values in a column.
Structure that stores segments of boolean flags per column, and perform custom action on those segmen...
InsertDeleteFlags getInsertFlag() const
void setCondFormatList(ScConditionalFormatList *pCondFormatList)
void setTableProtected(bool b)
Range getDestRange() const
ScDocument * getClipDoc()
Stores cell values for multiple tables.
const ScRange & getRange() const
SheetGeomType
Represents the type of sheet geometry data.
@ ATTRIB
Internal use only (d&d undo): do not delete caption objects of cell notes.
constexpr sal_Int32 STD_COL_WIDTH
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
ScRange getWholeRange() const
Return a single range that encompasses all individual ranges.
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW