LibreOffice Module sc (master) 1
table7.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#include <table.hxx>
11#include <clipcontext.hxx>
12#include <document.hxx>
13#include <clipparam.hxx>
14#include <segmenttree.hxx>
15#include <sharedformula.hxx>
16#include <cellvalues.hxx>
17#include <olinetab.hxx>
18#include <tabprotection.hxx>
19#include <columniterator.hxx>
20#include <drwlayer.hxx>
21#include <compressedarray.hxx>
22
23#include <osl/diagnose.h>
24#include <sal/log.hxx>
25#include <tools/stream.hxx>
26
27bool ScTable::IsMerged( SCCOL nCol, SCROW nRow ) const
28{
29 if (!ValidCol(nCol) || nCol >= GetAllocatedColumnsCount() )
30 return false;
31
32 return aCol[nCol].IsMerged(nRow);
33}
34
36{
37 if (!ValidColRow(nCol1, nRow1) || !ValidColRow(nCol2, nRow2))
39
40 if (nCol1 > nCol2 || nRow1 > nRow2)
41 // invalid range.
43
44 if (aCol.empty())
46
47 auto setFirstCell = []( sc::MultiDataCellState& rRet, SCCOL nCurCol, SCROW nCurRow )
48 {
49 if (rRet.mnCol1 < 0)
50 {
51 // First cell not yet set. Set it.
52 rRet.mnCol1 = nCurCol;
53 rRet.mnRow1 = nCurRow;
54 }
55 };
56
57 SCCOL nMaxCol = aCol.size()-1;
58 bool bHasOne = false;
60
61 for (SCCOL nCol = nCol1; nCol <= nCol2 && nCol <= nMaxCol; ++nCol)
62 {
63 SCROW nFirstDataRow = -1;
64 switch (aCol[nCol].HasDataCellsInRange(nRow1, nRow2, &nFirstDataRow))
65 {
67 {
68 setFirstCell(aRet, nCol, nFirstDataRow);
69
70 if (bHasOne)
71 {
72 // We've already found one data cell in another column.
74 return aRet;
75 }
76 bHasOne = true;
77 break;
78 }
80 {
81 setFirstCell(aRet, nCol, nFirstDataRow);
82
84 return aRet;
85 }
87 default:
88 ;
89 }
90 }
91
92 if (bHasOne)
94
95 return aRet;
96}
97
99 sc::CopyFromClipContext& rCxt, const ScTable& rClipTab, sc::ColumnSpanSet& rBroadcastSpans )
100{
102 if (!ValidCol(aRange.mnCol1) || !ValidCol(aRange.mnCol2))
103 return;
104
105 // Pass some stuff to the columns via context.
108
109 ScRange aClipRange = rCxt.getClipDoc()->GetClipParam().getWholeRange();
110 SCCOL nClipCol = aClipRange.aStart.Col();
111 {
112 const SCCOL nMaxCol2 = std::min<SCCOL>( aRange.mnCol2, aCol.size() - 1 );
113 for (SCCOL nCol = aRange.mnCol1; nCol <= nMaxCol2; ++nCol, ++nClipCol)
114 {
115 if (nClipCol > aClipRange.aEnd.Col())
116 nClipCol = aClipRange.aStart.Col(); // loop through columns.
117
118 const ScColumn& rClipCol = const_cast<ScTable&>(rClipTab).CreateColumnIfNotExists(nClipCol);
119 aCol[nCol].DeleteBeforeCopyFromClip(rCxt, rClipCol, rBroadcastSpans);
120 }
121 }
122
123 SetStreamValid(false);
124}
125
127 sc::CopyFromClipContext& rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2, const SCROW nSrcRow, const ScTable* pSrcTab )
128{
129 ScRange aSrcRange = rCxt.getClipDoc()->GetClipParam().getWholeRange();
130 SCCOL nSrcColSize = aSrcRange.aEnd.Col() - aSrcRange.aStart.Col() + 1;
131
132 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
133 {
134 SCCOL nColOffset = nCol - nCol1;
135 nColOffset = nColOffset % nSrcColSize;
136 assert(nColOffset >= 0);
137 CreateColumnIfNotExists(nCol).CopyOneCellFromClip(rCxt, nRow1, nRow2, nColOffset);
138
140 {
141 for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
142 CopyConditionalFormat(nCol, nRow, nCol, nRow, nCol - aSrcRange.aStart.Col() - nColOffset,
143 nRow - nSrcRow, pSrcTab);
144 }
145 }
146
147 if (nCol1 == 0 && nCol2 == rDocument.MaxCol() && mpRowHeights)
148 {
149 mpRowHeights->setValue(nRow1, nRow2, pSrcTab->GetOriginalHeight(nSrcRow));
150
151 if (pRowFlags && pSrcTab->pRowFlags) {
152 if (pSrcTab->pRowFlags->GetValue(nSrcRow) & CRFlags::ManualSize)
153 pRowFlags->OrValue(nRow1, CRFlags::ManualSize);
154 else
155 pRowFlags->AndValue(nRow1, ~CRFlags::ManualSize);
156 }
157 }
158
159 // Copy graphics over too
160 bool bCopyGraphics
162 if (!(bCopyGraphics && rCxt.getClipDoc()->mpDrawLayer))
163 return;
164
165 ScDrawLayer* pDrawLayer = GetDoc().GetDrawLayer();
166 OSL_ENSURE(pDrawLayer, "No drawing layer");
167 if (pDrawLayer)
168 {
169 const ScAddress aSrcStartPos
171 const ScAddress aSrcEndPos = rCxt.getClipDoc()->GetClipParam().getWholeRange().aEnd;
172 ScRange aSourceRange(aSrcStartPos, aSrcEndPos);
173 ScRange aDestRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab);
174 pDrawLayer->CopyFromClip(rCxt.getClipDoc()->mpDrawLayer.get(), aSrcStartPos.Tab(),
175 aSourceRange, ScAddress(nCol1, nRow1, nTab), aDestRange);
176 }
177}
178
179void ScTable::SetValues( const SCCOL nCol, const SCROW nRow, const std::vector<double>& rVals )
180{
181 if (!ValidCol(nCol))
182 return;
183
184 CreateColumnIfNotExists(nCol).SetValues(nRow, rVals);
185}
186
187void ScTable::TransferCellValuesTo( const SCCOL nCol, SCROW nRow, size_t nLen, sc::CellValues& rDest )
188{
189 if (!ValidCol(nCol))
190 return;
191
192 CreateColumnIfNotExists(nCol).TransferCellValuesTo(nRow, nLen, rDest);
193}
194
195void ScTable::CopyCellValuesFrom( const SCCOL nCol, SCROW nRow, const sc::CellValues& rSrc )
196{
197 if (!ValidCol(nCol))
198 return;
199
201}
202
204 sc::EndListeningContext& rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2,
205 sc::TableValues* pUndo )
206{
207 if (!ValidCol(nCol1) || !ValidCol(nCol2) || nCol1 > nCol2)
208 return;
209
210 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
211 CreateColumnIfNotExists(nCol).ConvertFormulaToValue(rCxt, nRow1, nRow2, pUndo);
212}
213
216{
217 const ScRange& rRange = rValues.getRange();
218 assert(rRange.IsValid());
219 for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol)
220 CreateColumnIfNotExists(nCol).SwapNonEmpty(rValues, rStartCxt, rEndCxt);
221}
222
224 sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt )
225{
226 for (SCCOL i = 0; i < aCol.size(); ++i)
227 aCol[i].PreprocessRangeNameUpdate(rEndListenCxt, rCompileCxt);
228}
229
231 sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt )
232{
233 for (SCCOL i = 0; i < aCol.size(); ++i)
234 aCol[i].PreprocessDBDataUpdate(rEndListenCxt, rCompileCxt);
235}
236
238 sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt )
239{
240 for (SCCOL i = 0; i < aCol.size(); ++i)
241 aCol[i].CompileHybridFormula(rStartListenCxt, rCompileCxt);
242}
243
244void ScTable::UpdateScriptTypes( const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2 )
245{
246 if (!IsColValid(nCol1) || !ValidCol(nCol2) || nCol1 > nCol2)
247 return;
248
249 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2, aCol.size() - 1 );
250
251 for (SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
252 aCol[nCol].UpdateScriptTypes(nRow1, nRow2);
253}
254
255bool ScTable::HasUniformRowHeight( SCROW nRow1, SCROW nRow2 ) const
256{
257 if (!ValidRow(nRow1) || !ValidRow(nRow2) || nRow1 > nRow2)
258 return false;
259
261 if (!mpRowHeights->getRangeData(nRow1, aData))
262 // Search failed.
263 return false;
264
265 return nRow2 <= aData.mnRow2;
266}
267
268void ScTable::SplitFormulaGroups( SCCOL nCol, std::vector<SCROW>& rRows )
269{
270 if (!IsColValid(nCol))
271 return;
272
274}
275
276void ScTable::UnshareFormulaCells( SCCOL nCol, std::vector<SCROW>& rRows )
277{
278 if (!IsColValid(nCol))
279 return;
280
282}
283
285{
286 if (!IsColValid(nCol))
287 return;
288
289 aCol[nCol].RegroupFormulaCells();
290}
291
292bool ScTable::HasFormulaCell( const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2 ) const
293{
294 if (nCol2 < nCol1 || !IsColValid(nCol1) || !ValidCol(nCol2))
295 return false;
296
297 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2, aCol.size() - 1 );
298
299 for (SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
300 if (aCol[nCol].HasFormulaCell(nRow1, nRow2))
301 return true;
302
303 return false;
304}
305
307 sc::EndListeningContext& rCxt, SCCOL nCol, SCROW nRow, std::vector<ScAddress>* pGroupPos )
308{
309 if (!IsColValid(nCol))
310 return;
311
312 aCol[nCol].EndListeningIntersectedGroup(rCxt, nRow, pGroupPos);
313}
314
316 sc::EndListeningContext& rCxt, const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2,
317 std::vector<ScAddress>* pGroupPos )
318{
319 if (nCol2 < nCol1 || !IsColValid(nCol1) || !ValidCol(nCol2))
320 return;
321
322 for (SCCOL nCol : GetAllocatedColumnsRange(nCol1, nCol2))
323 aCol[nCol].EndListeningIntersectedGroups(rCxt, nRow1, nRow2, pGroupPos);
324}
325
327{
328 if (!IsColValid(nCol))
329 return;
330
331 aCol[nCol].EndListeningGroup(rCxt, nRow);
332}
333
335{
336 if (!ValidCol(nCol))
337 return;
338
340}
341
343 sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd ) const
344{
345 if (!IsProtected())
346 {
347 SCCOL nCol1 = 0, nCol2 = aCol.size() - 1;
348 SCROW nRow1 = 0, nRow2 = rDocument.MaxRow();
349
350 switch (eAction)
351 {
355 {
356 nCol1 = nStart;
357 nCol2 = nEnd;
358 break;
359 }
363 {
364 nRow1 = nStart;
365 nRow2 = nEnd;
366 break;
367 }
368 default:
369 ;
370 }
371
372 return IsBlockEditable(nCol1, nRow1, nCol2, nRow2, nullptr);
373 }
374
375 if (IsScenario())
376 // TODO: I don't even know what this scenario thingie is. Perhaps we
377 // should check it against the scenario ranges?
378 return false;
379
380 assert(pTabProtection);
381
382 switch (eAction)
383 {
386 {
387 // TODO: improve the matrix range handling for the insert-before action.
388 if (HasBlockMatrixFragment(nStart, 0, nEnd, rDocument.MaxRow()))
389 return false;
390
391 return pTabProtection->isOptionEnabled(ScTableProtection::INSERT_COLUMNS);
392 }
395 {
396 // TODO: improve the matrix range handling for the insert-before action.
397 if (HasBlockMatrixFragment(0, nStart, rDocument.MaxCol(), nEnd))
398 return false;
399
400 return pTabProtection->isOptionEnabled(ScTableProtection::INSERT_ROWS);
401 }
403 {
405 return false;
406
407 return !HasAttrib(nStart, 0, nEnd, rDocument.MaxRow(), HasAttrFlags::Protected);
408 }
410 {
411 if (!pTabProtection->isOptionEnabled(ScTableProtection::DELETE_ROWS))
412 return false;
413
414 return !HasAttrib(0, nStart, rDocument.MaxCol(), nEnd, HasAttrFlags::Protected);
415 }
416 default:
417 ;
418 }
419
420 return false;
421}
422
423std::optional<sc::ColumnIterator> ScTable::GetColumnIterator( SCCOL nCol, SCROW nRow1, SCROW nRow2 ) const
424{
425 if (!ValidCol(nCol))
426 return {};
427
428 return const_cast<ScTable*>(this)->CreateColumnIfNotExists(nCol).GetColumnIterator(nRow1, nRow2);
429}
430
431bool ScTable::EnsureFormulaCellResults( const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bSkipRunning )
432{
433 if (nCol2 < nCol1 || !IsColValid(nCol1) || !ValidCol(nCol2))
434 return false;
435
436 const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2, aCol.size() - 1 );
437
438 bool bAnyDirty = false;
439
440 for (SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
441 {
442 bool bRet = aCol[nCol].EnsureFormulaCellResults(nRow1, nRow2, bSkipRunning);
443 bAnyDirty = bAnyDirty || bRet;
444 }
445
446 return bAnyDirty;
447}
448
450{
452 {
453 pOutlineTable->GetRowArray().finalizeImport(*this);
454 }
455}
456
458{
459 SCCOL nStartCol = 0;
460 SCCOL nEndCol = rDocument.MaxCol();
461 SCROW nStartRow = 0;
462 SCROW nEndRow = rDocument.MaxRow();
463
464 GetDataArea(nStartCol, nStartRow, nEndCol, nEndRow, false, false);
465
466 rStrm.WriteUInt64(nEndCol + 1);
467 for (SCCOL nCol = 0; nCol <= nEndCol; ++nCol)
468 {
469 aCol[nCol].StoreToCache(rStrm);
470 }
471}
472
474{
475 sal_uInt64 nCols = 0;
476 rStrm.ReadUInt64(nCols);
477 for (SCCOL nCol = 0; nCol < static_cast<SCCOL>(nCols); ++nCol)
478 {
479 aCol[nCol].RestoreFromCache(rStrm);
480 }
481}
482
483OString ScTable::dumpSheetGeomData(bool bColumns, SheetGeomType eGeomType)
484{
485 switch (eGeomType)
486 {
488 // returns a non-empty space separated list of spans with trailing space.
489 // The format of the span is <size of any row/col in the span in print twips>:<last row/col of the span>
490 // Example (for columns with three spans if MAXCOL is 1023): "1280:3 1049:50 1280:1023"
491 return dumpColumnRowSizes(bColumns);
493 // returns a non-empty space separated list of spans with trailing space.
494 // The format of the span is:
495 // 1) First span: <1 (span is hidden) / 0 (not hidden)>:<last row/col of the span>
496 // 2) Rest of the spans: <last row/col of the span>
497 // The hidden state of the spans after the first can be inferred from the first span's flag as no adjacent
498 // spans can have the same state by definition of span.
499 return dumpHiddenFiltered(bColumns, /*bHidden*/ true);
501 // has exactly the same format as 'hidden'.
502 return dumpHiddenFiltered(bColumns, /*bHidden*/ false);
504 // returns a space separated list of 'levels' with trailing space.
505 // A 'level' is a comma separated list of groups(outline entries) with trailing comma.
506 // format of a group is:
507 // <start row/col of group>:<number of rows/cols in the group>:<1/0(group is hidden?)>:<1/0(control is visible?)>
508 return dumpColumnRowGroups(bColumns);
509 default:
510 ;
511 }
512
513 return "";
514}
515
516OString ScTable::dumpColumnRowSizes(bool bColumns)
517{
518 // If the data-structures are not available, just report that all
519 // rows/cols have the default sizes.
520 static const OString aDefaultForCols
521 = OString::number(STD_COL_WIDTH) + ":" + OString::number(GetDoc().MaxCol()) + " ";
522 static const OString aDefaultForRows
523 = OString::number(GetOptimalMinRowHeight()) + ":" + OString::number(GetDoc().MaxRow()) + " ";
524
525 // ScCompressedArray is a template class and we don't want to impose
526 // the restriction that its value type should be string serializable,
527 // instead just operate on the specialized object.
528 typedef ScCompressedArray<SCCOL, sal_uInt16> ColWidthsType;
529 auto dumpColWidths = [this](const ColWidthsType& rWidths) -> OString {
530 OString aOutput;
531 OString aSegment;
532 SCCOL nStartCol = 0;
533 const SCCOL nMaxCol = std::min(rWidths.GetLastPos(), GetDoc().MaxCol());
534 size_t nDummy = 0;
535 while (nStartCol <= nMaxCol)
536 {
537 SCCOL nEndCol;
538 sal_uInt16 nWidth = rWidths.GetValue(nStartCol, nDummy, nEndCol);
539 // The last span nEndCol is always MAXCOL+1 for some reason, and we don't want that.
540 if (nEndCol > nMaxCol)
541 nEndCol = nMaxCol;
542 aSegment = OString::number(nWidth) + ":" + OString::number(nEndCol) + " ";
543 aOutput += aSegment;
544 nStartCol = nEndCol + 1;
545 }
546
547 return aOutput;
548 };
549
550 if (bColumns)
551 return mpColWidth ? dumpColWidths(*mpColWidth) : aDefaultForCols;
552
553 return mpRowHeights ? mpRowHeights->dumpAsString() : aDefaultForRows;
554}
555
556OString ScTable::dumpHiddenFiltered(bool bColumns, bool bHidden)
557{
558 // defaults to no hidden/filtered row/cols.
559 static const OString aDefaultForCols = "0:" + OString::number(GetDoc().MaxCol()) + " ";
560 static const OString aDefaultForRows = "0:" + OString::number(GetDoc().MaxRow()) + " ";
561
562 if (bHidden)
563 {
564 if (bColumns)
565 return mpHiddenCols ? mpHiddenCols->dumpAsString() : aDefaultForCols;
566
567 return mpHiddenRows ? mpHiddenRows->dumpAsString() : aDefaultForRows;
568 }
569
570 if (bColumns)
571 return mpFilteredCols ? mpFilteredCols->dumpAsString() : aDefaultForCols;
572
573 return mpFilteredRows ? mpFilteredRows->dumpAsString() : aDefaultForRows;
574}
575
576OString ScTable::dumpColumnRowGroups(bool bColumns) const
577{
578 if (!pOutlineTable)
579 return "";
580
581 if (bColumns)
582 return pOutlineTable->GetColArray().dumpAsString();
583
584 return pOutlineTable->GetRowArray().dumpAsString();
585}
586
588{
589 return maLOKFreezeCell.Col();
590}
591
593{
594 return maLOKFreezeCell.Row();
595}
596
598{
599 if (!ValidCol(nFreezeCol))
600 {
601 SAL_WARN("sc.core", "ScTable::SetLOKFreezeCol : invalid nFreezeCol = " << nFreezeCol);
602 return false;
603 }
604
605 if (maLOKFreezeCell.Col() != nFreezeCol)
606 {
607 maLOKFreezeCell.SetCol(nFreezeCol);
608 return true;
609 }
610
611 return false;
612}
613
615{
616 if (!ValidRow(nFreezeRow))
617 {
618 SAL_WARN("sc.core", "ScTable::SetLOKFreezeRow : invalid nFreezeRow = " << nFreezeRow);
619 return false;
620 }
621
622 if (maLOKFreezeCell.Row() != nFreezeRow)
623 {
624 maLOKFreezeCell.SetRow(nFreezeRow);
625 return true;
626 }
627
628 return false;
629}
630
632{
633 std::set<SCCOL> aColIndices;
634
635 for (const auto& pCol : aCol)
636 {
637 if (pCol->HasFormulaCell())
638 aColIndices.insert(pCol->GetCol());
639 }
640
641 return aColIndices;
642}
643
645{
646 for (const auto& pCol : aCol)
647 pCol->CheckIntegrity();
648}
649
651{
652 for (const auto& pCol : aCol)
653 pCol->CollectBroadcasterState(rState);
654}
655
656std::shared_ptr<sc::SolverSettings> ScTable::GetSolverSettings()
657{
659 m_pSolverSettings = std::make_shared<sc::SolverSettings>(*this);
660
661 return m_pSolverSettings;
662}
663
664/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SCTAB Tab() const
Definition: address.hxx:283
void SetCol(SCCOL nColP)
Definition: address.hxx:291
SCROW Row() const
Definition: address.hxx:274
void SetRow(SCROW nRowP)
Definition: address.hxx:287
SCCOL Col() const
Definition: address.hxx:279
SCCOL size() const
bool empty() const
void TransferCellValuesTo(SCROW nRow, size_t nLen, sc::CellValues &rDest)
Definition: column4.cxx:429
void ConvertFormulaToValue(sc::EndListeningContext &rCxt, SCROW nRow1, SCROW nRow2, sc::TableValues *pUndo)
Definition: column4.cxx:530
std::optional< sc::ColumnIterator > GetColumnIterator(SCROW nRow1, SCROW nRow2) const
Definition: column4.cxx:1773
void SwapNonEmpty(sc::TableValues &rValues, sc::StartListeningContext &rStartCxt, sc::EndListeningContext &rEndCxt)
Definition: column4.cxx:592
void SetNeedsListeningGroup(SCROW nRow)
Definition: column4.cxx:1743
void CopyOneCellFromClip(sc::CopyFromClipContext &rCxt, SCROW nRow1, SCROW nRow2, size_t nColOffset)
Definition: column4.cxx:247
void SetValues(const SCROW nRow, const std::vector< double > &rVals)
Definition: column4.cxx:399
void CopyCellValuesFrom(SCROW nRow, const sc::CellValues &rSrc)
Definition: column4.cxx:454
Compressed array of row (or column) entries, e.g.
ScClipParam & GetClipParam()
Definition: document.cxx:2564
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:892
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:893
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
Definition: document.hxx:1084
std::unique_ptr< ScDrawLayer > mpDrawLayer
Definition: document.hxx:374
void CopyFromClip(ScDrawLayer *pClipModel, SCTAB nSourceTab, const ScRange &rSourceRange, const ScAddress &rDestPos, const ScRange &rDestRange, bool bTransposing=false)
Definition: drwlayer.cxx:1912
ScAddress aEnd
Definition: address.hxx:498
bool IsValid() const
Definition: address.hxx:544
ScAddress aStart
Definition: address.hxx:497
std::unique_ptr< ScFlatBoolColSegments > mpHiddenCols
Definition: table.hxx:199
SCCOL GetLOKFreezeCol() const
Definition: table7.cxx:587
bool ValidCol(SCCOL nCol) const
Definition: table.hxx:356
sal_uInt16 GetOriginalHeight(SCROW nRow) const
Definition: table2.cxx:3661
bool IsBlockEditable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool *pOnlyNotBecauseOfMatrix=nullptr, bool bNoMatrixAtAll=false) const
Definition: table2.cxx:2641
bool HasBlockMatrixFragment(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bNoMatrixAtAll=false) const
Definition: table2.cxx:2528
std::unique_ptr< ScFlatBoolRowSegments > mpFilteredRows
Definition: table.hxx:202
ScColumnsRange GetAllocatedColumnsRange(SCCOL begin, SCCOL end) const
Definition: table1.cxx:2719
bool IsScenario() const
Definition: table.hxx:371
bool HasFormulaCell(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2) const
Definition: table7.cxx:292
bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, HasAttrFlags nMask) const
Definition: table2.cxx:2296
void EndListeningGroup(sc::EndListeningContext &rCxt, const SCCOL nCol, SCROW nRow)
Definition: table7.cxx:326
OString dumpColumnRowSizes(bool bColumns)
Returns list-of-spans representation of the column-widths/row-heights in twips encoded as an OString.
Definition: table7.cxx:516
std::unique_ptr< ScConditionalFormatList > mpCondFormatList
Definition: table.hxx:242
ScColContainer aCol
Definition: table.hxx:162
bool ValidColRow(SCCOL nCol, SCROW nRow) const
Definition: table.hxx:358
std::unique_ptr< ScBitMaskCompressedArray< SCROW, CRFlags > > pRowFlags
Definition: table.hxx:198
bool IsEditActionAllowed(sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd) const
Definition: table7.cxx:342
void UpdateScriptTypes(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2)
Definition: table7.cxx:244
ScColumn & CreateColumnIfNotExists(const SCCOL nScCol)
Definition: table.hxx:303
bool IsColValid(const SCCOL nScCol) const
Definition: table.hxx:344
void SetStreamValid(bool bSet, bool bIgnoreLock=false)
Definition: table1.cxx:382
std::shared_ptr< sc::SolverSettings > m_pSolverSettings
Definition: table.hxx:265
void GetDataArea(SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bIncludeOld, bool bOnlyDown) const
Definition: table1.cxx:891
void CheckIntegrity() const
Definition: table7.cxx:644
std::unique_ptr< ScFlatBoolColSegments > mpFilteredCols
Definition: table.hxx:201
std::optional< sc::ColumnIterator > GetColumnIterator(SCCOL nCol, SCROW nRow1, SCROW nRow2) const
Definition: table7.cxx:423
void CopyConditionalFormat(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCCOL nDx, SCROW nDy, const ScTable *pTable)
Definition: table2.cxx:636
SCTAB nTab
Definition: table.hxx:218
bool HasUniformRowHeight(SCROW nRow1, SCROW nRow2) const
Definition: table7.cxx:255
std::unique_ptr< ScOutlineTable > pOutlineTable
Definition: table.hxx:209
SCROW GetLOKFreezeRow() const
Definition: table7.cxx:592
sc::MultiDataCellState HasMultipleDataCells(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
Definition: table7.cxx:35
void PreprocessRangeNameUpdate(sc::EndListeningContext &rEndListenCxt, sc::CompileFormulaContext &rCompileCxt)
Definition: table7.cxx:223
void SetNeedsListeningGroup(SCCOL nCol, SCROW nRow)
Definition: table7.cxx:334
void CopyOneCellFromClip(sc::CopyFromClipContext &rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2, const SCROW nSrcRow, const ScTable *pSrcTab)
Definition: table7.cxx:126
ScAddress maLOKFreezeCell
Definition: table.hxx:245
bool IsProtected() const
Definition: table5.cxx:1171
void SetValues(const SCCOL nCol, const SCROW nRow, const std::vector< double > &rVals)
Definition: table7.cxx:179
void DeleteBeforeCopyFromClip(sc::CopyFromClipContext &rCxt, const ScTable &rClipTab, sc::ColumnSpanSet &rBroadcastSpans)
Definition: table7.cxx:98
SC_DLLPUBLIC std::shared_ptr< sc::SolverSettings > GetSolverSettings()
Definition: table7.cxx:656
OString dumpSheetGeomData(bool bColumns, SheetGeomType eGeomType)
Serializes the sheet's geometry data.
Definition: table7.cxx:483
void UnshareFormulaCells(SCCOL nCol, std::vector< SCROW > &rRows)
Definition: table7.cxx:276
OString dumpColumnRowGroups(bool bColumns) const
Returns list-of-spans representation of the column/row groupings encoded as an OString.
Definition: table7.cxx:576
void CollectBroadcasterState(sc::BroadcasterState &rState) const
Definition: table7.cxx:650
void EndListeningIntersectedGroups(sc::EndListeningContext &rCxt, const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, std::vector< ScAddress > *pGroupPos)
Definition: table7.cxx:315
sal_uInt16 GetOptimalMinRowHeight() const
Definition: table.hxx:879
std::unique_ptr< ScCompressedArray< SCCOL, sal_uInt16 > > mpColWidth
Definition: table.hxx:194
void RestoreFromCache(SvStream &rStrm)
Definition: table7.cxx:473
SCCOL GetAllocatedColumnsCount() const
Definition: table.hxx:1164
void ConvertFormulaToValue(sc::EndListeningContext &rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2, sc::TableValues *pUndo)
Definition: table7.cxx:203
void SplitFormulaGroups(SCCOL nCol, std::vector< SCROW > &rRows)
Definition: table7.cxx:268
bool EnsureFormulaCellResults(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bSkipRunning=false)
Definition: table7.cxx:431
void SwapNonEmpty(sc::TableValues &rValues, sc::StartListeningContext &rStartCxt, sc::EndListeningContext &rEndCxt)
Definition: table7.cxx:214
std::unique_ptr< ScFlatBoolRowSegments > mpHiddenRows
Definition: table.hxx:200
void finalizeOutlineImport()
Definition: table7.cxx:449
std::set< SCCOL > QueryColumnsWithFormulaCells() const
Definition: table7.cxx:631
void PreprocessDBDataUpdate(sc::EndListeningContext &rEndListenCxt, sc::CompileFormulaContext &rCompileCxt)
Definition: table7.cxx:230
std::unique_ptr< ScFlatUInt16RowSegments > mpRowHeights
Definition: table.hxx:195
void TransferCellValuesTo(const SCCOL nCol, SCROW nRow, size_t nLen, sc::CellValues &rDest)
Definition: table7.cxx:187
void CopyCellValuesFrom(const SCCOL nCol, SCROW nRow, const sc::CellValues &rSrc)
Definition: table7.cxx:195
void CompileHybridFormula(sc::StartListeningContext &rStartListenCxt, sc::CompileFormulaContext &rCompileCxt)
Definition: table7.cxx:237
void EndListeningIntersectedGroup(sc::EndListeningContext &rCxt, SCCOL nCol, SCROW nRow, std::vector< ScAddress > *pGroupPos)
Definition: table7.cxx:306
ScDocument & rDocument
Definition: table.hxx:219
void RegroupFormulaCells(SCCOL nCol)
Definition: table7.cxx:284
ScDocument & GetDoc()
Definition: table.hxx:297
void StoreToCache(SvStream &rStrm) const
Definition: table7.cxx:457
OString dumpHiddenFiltered(bool bColumns, bool bHidden)
Returns list-of-spans representation of hidden/filtered states of columns/rows encoded as an OString.
Definition: table7.cxx:556
bool SetLOKFreezeCol(SCCOL nFreezeCol)
Definition: table7.cxx:597
bool SetLOKFreezeRow(SCROW nFreezeRow)
Definition: table7.cxx:614
std::unique_ptr< ScTableProtection > pTabProtection
Definition: table.hxx:192
bool IsMerged(SCCOL nCol, SCROW nRow) const
Definition: table7.cxx:27
bool ValidRow(SCROW nRow) const
Definition: table.hxx:357
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.
Definition: cellvalues.hxx:42
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
Definition: clipcontext.cxx:82
ScDocument * getClipDoc()
Definition: clipcontext.cxx:97
static void unshareFormulaCells(const ScDocument &rDoc, CellStoreType &rCells, std::vector< SCROW > &rRows)
Make specified formula cells non-shared ones, and split them off from their respective adjacent formu...
static bool splitFormulaCellGroups(const ScDocument &rDoc, CellStoreType &rCells, std::vector< SCROW > &rBounds)
Split existing shared formula ranges at specified row positions.
Stores cell values for multiple tables.
Definition: cellvalues.hxx:89
const ScRange & getRange() const
Definition: cellvalues.cxx:324
SheetGeomType
Represents the type of sheet geometry data.
Definition: document.hxx:277
@ OBJECTS
Cell styles.
@ ATTRIB
Internal use only (d&d undo): do not delete caption objects of cell notes.
constexpr sal_Int32 STD_COL_WIDTH
Definition: global.hxx:87
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
int i
void SvStream & rStrm
ColRowEditAction
Definition: global.hxx:427
ScRange getWholeRange() const
Return a single range that encompasses all individual ranges.
Definition: clipparam.cxx:109
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17