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");
172 ScRange aSourceRange(aSrcStartPos, aSrcEndPos);
210 for (
SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
249 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
251 for (
SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
265 return nRow2 <=
aData.mnRow2;
289 aCol[nCol].RegroupFormulaCells();
297 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
299 for (
SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
312 aCol[nCol].EndListeningIntersectedGroup(rCxt, nRow, pGroupPos);
317 std::vector<ScAddress>* pGroupPos )
323 aCol[nCol].EndListeningIntersectedGroups(rCxt, nRow1, nRow2, pGroupPos);
331 aCol[nCol].EndListeningGroup(rCxt, nRow);
436 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2,
aCol.
size() - 1 );
438 bool bAnyDirty =
false;
440 for (
SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
442 bool bRet =
aCol[nCol].EnsureFormulaCellResults(nRow1, nRow2, bSkipRunning);
443 bAnyDirty = bAnyDirty || bRet;
464 GetDataArea(nStartCol, nStartRow, nEndCol, nEndRow,
false,
false);
467 for (
SCCOL nCol = 0; nCol <= nEndCol; ++nCol)
475 sal_uInt64 nCols = 0;
477 for (
SCCOL nCol = 0; nCol < static_cast<SCCOL>(nCols); ++nCol)
520 static const OString aDefaultForCols
522 static const OString aDefaultForRows
529 auto dumpColWidths = [
this](
const ColWidthsType& rWidths) -> OString {
533 const SCCOL nMaxCol = std::min(rWidths.GetLastPos(),
GetDoc().MaxCol());
535 while (nStartCol <= nMaxCol)
538 sal_uInt16 nWidth = rWidths.GetValue(nStartCol, nDummy, nEndCol);
540 if (nEndCol > nMaxCol)
542 aSegment = OString::number(nWidth) +
":" + OString::number(nEndCol) +
" ";
544 nStartCol = nEndCol + 1;
559 static const OString aDefaultForCols =
"0:" + OString::number(
GetDoc().MaxCol()) +
" ";
560 static const OString aDefaultForRows =
"0:" + OString::number(
GetDoc().MaxRow()) +
" ";
601 SAL_WARN(
"sc.core",
"ScTable::SetLOKFreezeCol : invalid nFreezeCol = " << nFreezeCol);
618 SAL_WARN(
"sc.core",
"ScTable::SetLOKFreezeRow : invalid nFreezeRow = " << nFreezeRow);
633 std::set<SCCOL> aColIndices;
635 for (
const auto& pCol :
aCol)
637 if (pCol->HasFormulaCell())
638 aColIndices.insert(pCol->GetCol());
646 for (
const auto& pCol :
aCol)
647 pCol->CheckIntegrity();
652 for (
const auto& pCol :
aCol)
653 pCol->CollectBroadcasterState(rState);
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
void CopyFromClip(ScDrawLayer *pClipModel, SCTAB nSourceTab, const ScRange &rSourceRange, const ScAddress &rDestPos, const ScRange &rDestRange, bool bTransposing=false)
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)
std::shared_ptr< sc::SolverSettings > m_pSolverSettings
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)
SC_DLLPUBLIC std::shared_ptr< sc::SolverSettings > GetSolverSettings()
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 CollectBroadcasterState(sc::BroadcasterState &rState) const
void EndListeningIntersectedGroups(sc::EndListeningContext &rCxt, const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, std::vector< ScAddress > *pGroupPos)
sal_uInt16 GetOptimalMinRowHeight() const
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