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 <sal/log.hxx>
24 #include <tools/stream.hxx>
25 
26 bool ScTable::IsMerged( SCCOL nCol, SCROW nRow ) const
27 {
28  if (!ValidCol(nCol) || nCol >= GetAllocatedColumnsCount() )
29  return false;
30 
31  return aCol[nCol].IsMerged(nRow);
32 }
33 
35 {
36  if (!ValidColRow(nCol1, nRow1) || !ValidColRow(nCol2, nRow2))
37  return sc::MultiDataCellState();
38 
39  if (nCol1 > nCol2 || nRow1 > nRow2)
40  // invalid range.
41  return sc::MultiDataCellState();
42 
43  if (aCol.empty())
45 
46  auto setFirstCell = []( sc::MultiDataCellState& rRet, SCCOL nCurCol, SCROW nCurRow )
47  {
48  if (rRet.mnCol1 < 0)
49  {
50  // First cell not yet set. Set it.
51  rRet.mnCol1 = nCurCol;
52  rRet.mnRow1 = nCurRow;
53  }
54  };
55 
56  SCCOL nMaxCol = aCol.size()-1;
57  bool bHasOne = false;
59 
60  for (SCCOL nCol = nCol1; nCol <= nCol2 && nCol <= nMaxCol; ++nCol)
61  {
62  SCROW nFirstDataRow = -1;
63  switch (aCol[nCol].HasDataCellsInRange(nRow1, nRow2, &nFirstDataRow))
64  {
66  {
67  setFirstCell(aRet, nCol, nFirstDataRow);
68 
69  if (bHasOne)
70  {
71  // We've already found one data cell in another column.
73  return aRet;
74  }
75  bHasOne = true;
76  break;
77  }
79  {
80  setFirstCell(aRet, nCol, nFirstDataRow);
81 
83  return aRet;
84  }
86  default:
87  ;
88  }
89  }
90 
91  if (bHasOne)
93 
94  return aRet;
95 }
96 
98  sc::CopyFromClipContext& rCxt, const ScTable& rClipTab, sc::ColumnSpanSet& rBroadcastSpans )
99 {
101  if (!ValidCol(aRange.mnCol1) || !ValidCol(aRange.mnCol2))
102  return;
103 
104  // Pass some stuff to the columns via context.
107 
108  ScRange aClipRange = rCxt.getClipDoc()->GetClipParam().getWholeRange();
109  SCCOL nClipCol = aClipRange.aStart.Col();
110  {
111  for (SCCOL nCol = aRange.mnCol1; nCol <= aRange.mnCol2; ++nCol, ++nClipCol)
112  {
113  if (nClipCol > aClipRange.aEnd.Col())
114  nClipCol = aClipRange.aStart.Col(); // loop through columns.
115 
116  const ScColumn& rClipCol = rClipTab.aCol[nClipCol];
117  aCol[nCol].DeleteBeforeCopyFromClip(rCxt, rClipCol, rBroadcastSpans);
118  }
119  }
120 
121  SetStreamValid(false);
122 }
123 
125  sc::CopyFromClipContext& rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2, const SCROW nSrcRow, const ScTable* pSrcTab )
126 {
127  ScRange aSrcRange = rCxt.getClipDoc()->GetClipParam().getWholeRange();
128  SCCOL nSrcColSize = aSrcRange.aEnd.Col() - aSrcRange.aStart.Col() + 1;
129 
130  for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
131  {
132  SCCOL nColOffset = nCol - nCol1;
133  nColOffset = nColOffset % nSrcColSize;
134  assert(nColOffset >= 0);
135  CreateColumnIfNotExists(nCol).CopyOneCellFromClip(rCxt, nRow1, nRow2, nColOffset);
136 
138  {
139  for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
140  CopyConditionalFormat(nCol, nRow, nCol, nRow, nCol - aSrcRange.aStart.Col() - nColOffset,
141  nRow - nSrcRow, pSrcTab);
142  }
143  }
144 
145  if (nCol1 == 0 && nCol2 == rDocument.MaxCol() && mpRowHeights)
146  {
147  mpRowHeights->setValue(nRow1, nRow2, pSrcTab->GetOriginalHeight(nSrcRow));
148 
149  if (pRowFlags && pSrcTab->pRowFlags) {
150  if (pSrcTab->pRowFlags->GetValue(nSrcRow) & CRFlags::ManualSize)
151  pRowFlags->OrValue(nRow1, CRFlags::ManualSize);
152  else
153  pRowFlags->AndValue(nRow1, ~CRFlags::ManualSize);
154  }
155  }
156 
157  // Copy graphics over too
158  bool bCopyGraphics
160  if (!(bCopyGraphics && rCxt.getClipDoc()->mpDrawLayer))
161  return;
162 
163  ScDrawLayer* pDrawLayer = GetDoc().GetDrawLayer();
164  OSL_ENSURE(pDrawLayer, "No drawing layer");
165  if (pDrawLayer)
166  {
167  const ScAddress aSrcStartPos
169  const ScAddress aSrcEndPos = rCxt.getClipDoc()->GetClipParam().getWholeRange().aEnd;
170  tools::Rectangle aSourceRect = rCxt.getClipDoc()->GetMMRect(
171  aSrcStartPos.Col(), aSrcStartPos.Row(), aSrcEndPos.Col(), aSrcEndPos.Row(),
172  aSrcStartPos.Tab());
173  tools::Rectangle aDestRect = GetDoc().GetMMRect(nCol1, nRow1, nCol2, nRow2, nTab);
174  pDrawLayer->CopyFromClip(rCxt.getClipDoc()->mpDrawLayer.get(), aSrcStartPos.Tab(),
175  aSourceRect, ScAddress(nCol1, nRow1, nTab), aDestRect);
176  }
177 }
178 
179 void 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 
187 void 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 
195 void 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 
215  sc::TableValues& rValues, sc::StartListeningContext& rStartCxt, sc::EndListeningContext& rEndCxt )
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 
244 void 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 
255 bool 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 
268 void ScTable::SplitFormulaGroups( SCCOL nCol, std::vector<SCROW>& rRows )
269 {
270  if (!IsColValid(nCol))
271  return;
272 
274 }
275 
276 void 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 
292 bool 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 : GetColumnsRange(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 
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  {
404  if (!pTabProtection->isOptionEnabled(ScTableProtection::DELETE_COLUMNS))
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 
423 std::unique_ptr<sc::ColumnIterator> ScTable::GetColumnIterator( SCCOL nCol, SCROW nRow1, SCROW nRow2 ) const
424 {
425  if (!ValidCol(nCol))
426  return std::unique_ptr<sc::ColumnIterator>();
427 
428  return CreateColumnIfNotExists(nCol).GetColumnIterator(nRow1, nRow2);
429 }
430 
431 bool 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 {
451  if (pOutlineTable && pRowFlags)
452  {
453  pOutlineTable->GetRowArray().finalizeImport(*this);
454  }
455 }
456 
457 void ScTable::StoreToCache(SvStream& rStrm) const
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 
483 OString 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 
516 OString 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(MAXCOL) + " ";
522  static const OString aDefaultForRows
523  = OString::number(ScGlobal::nStdRowHeight) + ":" + OString::number(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 = [](const ColWidthsType& rWidths) -> OString {
530  OString aOutput;
531  OString aSegment;
532  SCCOL nStartCol = 0;
533  const SCCOL nMaxCol = std::min(rWidths.GetLastPos(), 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 
556 OString ScTable::dumpHiddenFiltered(bool bColumns, bool bHidden)
557 {
558  // defaults to no hidden/filtered row/cols.
559  static const OString aDefaultForCols = "0:" + OString::number(MAXCOL) + " ";
560  static const OString aDefaultForRows = "0:" + OString::number(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 
576 OString 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 
631 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SCTAB nTab
Definition: table.hxx:201
SvStream & WriteUInt64(sal_uInt64 nuInt64)
bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, HasAttrFlags nMask) const
Definition: table2.cxx:2070
ScAddress aStart
Definition: address.hxx:500
void TransferCellValuesTo(const SCCOL nCol, SCROW nRow, size_t nLen, sc::CellValues &rDest)
Definition: table7.cxx:187
bool HasBlockMatrixFragment(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bNoMatrixAtAll=false) const
Definition: table2.cxx:2301
std::unique_ptr< ScFlatUInt16RowSegments > mpRowHeights
Definition: table.hxx:180
SCROW Row() const
Definition: address.hxx:262
void SetValues(const SCCOL nCol, const SCROW nRow, const std::vector< double > &rVals)
Definition: table7.cxx:179
const char aData[]
void SwapNonEmpty(sc::TableValues &rValues, sc::StartListeningContext &rStartCxt, sc::EndListeningContext &rEndCxt)
Definition: column4.cxx:495
void UpdateScriptTypes(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2)
Definition: table7.cxx:244
bool HasFormulaCell(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2) const
Definition: table7.cxx:292
Think of this as a mini-ScColumn like storage that only stores cell values in a column.
Definition: cellvalues.hxx:42
SCCOL size() const
std::unique_ptr< ScFlatBoolColSegments > mpFilteredCols
Definition: table.hxx:186
void TransferCellValuesTo(SCROW nRow, size_t nLen, sc::CellValues &rDest)
Definition: column4.cxx:341
InsertDeleteFlags getInsertFlag() const
Stores cell values for multiple tables.
Definition: cellvalues.hxx:87
ScAddress aEnd
Definition: address.hxx:501
void CopyFromClip(ScDrawLayer *pClipModel, SCTAB nSourceTab, const tools::Rectangle &rSourceRange, const ScAddress &rDestPos, const tools::Rectangle &rDestRange)
Definition: drwlayer.cxx:1610
sal_uInt16 GetOriginalHeight(SCROW nRow) const
Definition: table2.cxx:3347
bool empty() const
SvStream & ReadUInt64(sal_uInt64 &rUInt64)
void CompileHybridFormula(sc::StartListeningContext &rStartListenCxt, sc::CompileFormulaContext &rCompileCxt)
Definition: table7.cxx:237
void RestoreFromCache(SvStream &rStrm)
Definition: table7.cxx:473
void PreprocessDBDataUpdate(sc::EndListeningContext &rEndListenCxt, sc::CompileFormulaContext &rCompileCxt)
Definition: table7.cxx:230
Internal use only (d&d undo): do not delete caption objects of cell notes.
bool ValidRow(SCROW nRow) const
Definition: table.hxx:327
void SetStreamValid(bool bSet, bool bIgnoreLock=false)
Definition: table1.cxx:368
ScColumn & CreateColumnIfNotExists(const SCCOL nScCol) const
Definition: table.hxx:281
bool IsEditActionAllowed(sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd) const
Definition: table7.cxx:342
#define STD_COL_WIDTH
Definition: global.hxx:93
ScClipParam & GetClipParam()
Definition: document.cxx:2549
bool IsBlockEditable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool *pOnlyNotBecauseOfMatrix=nullptr, bool bNoMatrixAtAll=false) const
Definition: table2.cxx:2413
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:873
void finalizeOutlineImport()
Definition: table7.cxx:449
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:24
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void setCondFormatList(ScConditionalFormatList *pCondFormatList)
const SCROW MAXROW
Definition: address.hxx:69
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 PreprocessRangeNameUpdate(sc::EndListeningContext &rEndListenCxt, sc::CompileFormulaContext &rCompileCxt)
Definition: table7.cxx:223
SCTAB Tab() const
Definition: address.hxx:271
void SetRow(SCROW nRowP)
Definition: address.hxx:275
void CopyCellValuesFrom(const SCCOL nCol, SCROW nRow, const sc::CellValues &rSrc)
Definition: table7.cxx:195
void EndListeningIntersectedGroups(sc::EndListeningContext &rCxt, const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, std::vector< ScAddress > *pGroupPos)
Definition: table7.cxx:315
bool HasUniformRowHeight(SCROW nRow1, SCROW nRow2) const
Definition: table7.cxx:255
std::unique_ptr< ScOutlineTable > pOutlineTable
Definition: table.hxx:194
void SetNeedsListeningGroup(SCCOL nCol, SCROW nRow)
Definition: table7.cxx:334
void SetCol(SCCOL nColP)
Definition: address.hxx:279
std::unique_ptr< ScDrawLayer > mpDrawLayer
Definition: document.hxx:379
bool IsColValid(const SCCOL nScCol) const
Definition: table.hxx:314
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:124
static SC_DLLPUBLIC sal_uInt16 nStdRowHeight
Definition: global.hxx:583
OString dumpColumnRowGroups(bool bColumns) const
Returns list-of-spans representation of the column/row groupings encoded as an OString.
Definition: table7.cxx:576
std::unique_ptr< ScFlatBoolColSegments > mpHiddenCols
Definition: table.hxx:184
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
Definition: document.hxx:1059
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:872
bool IsProtected() const
Definition: table5.cxx:1040
bool ValidCol(SCCOL nCol) const
Definition: table.hxx:326
ScDocument & GetDoc()
Definition: table.hxx:275
int i
void SetValues(const SCROW nRow, const std::vector< double > &rVals)
Definition: column4.cxx:311
sal_Int16 SCCOL
Definition: types.hxx:22
void UnshareFormulaCells(SCCOL nCol, std::vector< SCROW > &rRows)
Definition: table7.cxx:276
const SCCOL MAXCOL
Definition: address.hxx:70
sc::MultiDataCellState HasMultipleDataCells(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
Definition: table7.cxx:34
ScAddress maLOKFreezeCell
Definition: table.hxx:227
std::unique_ptr< ScTableProtection > pTabProtection
Definition: table.hxx:177
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...
Definition: table7.cxx:556
const ScRange & getRange() const
Definition: cellvalues.cxx:317
ScColContainer aCol
Definition: table.hxx:156
std::unique_ptr< ScConditionalFormatList > mpCondFormatList
Definition: table.hxx:225
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: documen3.cxx:1972
bool IsValid() const
Definition: address.hxx:547
bool IsScenario() const
Definition: table.hxx:341
SCCOL Col() const
Definition: address.hxx:267
void setTableProtected(bool b)
SheetGeomType
Represents the type of sheet geometry data.
Definition: document.hxx:266
void EndListeningGroup(sc::EndListeningContext &rCxt, const SCCOL nCol, SCROW nRow)
Definition: table7.cxx:326
SCROW GetLOKFreezeRow() const
Definition: table7.cxx:592
bool SetLOKFreezeCol(SCCOL nFreezeCol)
Definition: table7.cxx:597
const D & GetValue(A nPos) const
sal_Int32 SCROW
Definition: types.hxx:18
ScRange getWholeRange() const
Return a single range that encompasses all individual ranges.
Definition: clipparam.cxx:103
ColRowEditAction
Definition: global.hxx:435
std::unique_ptr< ScFlatBoolRowSegments > mpFilteredRows
Definition: table.hxx:187
std::unique_ptr< sc::ColumnIterator > GetColumnIterator(SCCOL nCol, SCROW nRow1, SCROW nRow2) const
Definition: table7.cxx:423
void CopyCellValuesFrom(SCROW nRow, const sc::CellValues &rSrc)
Definition: column4.cxx:366
void GetDataArea(SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bIncludeOld, bool bOnlyDown) const
Definition: table1.cxx:788
bool ValidColRow(SCCOL nCol, SCROW nRow) const
Definition: table.hxx:328
void CopyConditionalFormat(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCCOL nDx, SCROW nDy, const ScTable *pTable)
Definition: table2.cxx:621
ScColumnsRange GetColumnsRange(SCCOL begin, SCCOL end) const
Definition: table1.cxx:2585
std::unique_ptr< sc::ColumnIterator > GetColumnIterator(SCROW nRow1, SCROW nRow2) const
Definition: column4.cxx:1634
void CopyOneCellFromClip(sc::CopyFromClipContext &rCxt, SCROW nRow1, SCROW nRow2, size_t nColOffset)
Definition: column4.cxx:195
std::unique_ptr< ScCompressedArray< SCCOL, sal_uInt16 > > mpColWidth
Definition: table.hxx:179
static bool splitFormulaCellGroups(const ScDocument &rDoc, CellStoreType &rCells, std::vector< SCROW > &rBounds)
Split existing shared formula ranges at specified row positions.
ScDocument * getClipDoc()
Definition: clipcontext.cxx:96
bool SetLOKFreezeRow(SCROW nFreezeRow)
Definition: table7.cxx:614
Compressed array of row (or column) entries, e.g.
void ConvertFormulaToValue(sc::EndListeningContext &rCxt, SCROW nRow1, SCROW nRow2, sc::TableValues *pUndo)
Definition: column4.cxx:432
bool EnsureFormulaCellResults(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bSkipRunning=false)
Definition: table7.cxx:431
void RegroupFormulaCells(SCCOL nCol)
Definition: table7.cxx:284
Range getDestRange() const
Definition: clipcontext.cxx:81
#define SAL_WARN(area, stream)
ScDocument & rDocument
Definition: table.hxx:202
void DeleteBeforeCopyFromClip(sc::CopyFromClipContext &rCxt, const ScTable &rClipTab, sc::ColumnSpanSet &rBroadcastSpans)
Definition: table7.cxx:97
void EndListeningIntersectedGroup(sc::EndListeningContext &rCxt, SCCOL nCol, SCROW nRow, std::vector< ScAddress > *pGroupPos)
Definition: table7.cxx:306
std::unique_ptr< ScBitMaskCompressedArray< SCROW, CRFlags > > pRowFlags
Definition: table.hxx:183
void SwapNonEmpty(sc::TableValues &rValues, sc::StartListeningContext &rStartCxt, sc::EndListeningContext &rEndCxt)
Definition: table7.cxx:214
void StoreToCache(SvStream &rStrm) const
Definition: table7.cxx:457
std::unique_ptr< ScFlatBoolRowSegments > mpHiddenRows
Definition: table.hxx:185
SCCOL GetAllocatedColumnsCount() const
Definition: table.hxx:1085
void SetNeedsListeningGroup(SCROW nRow)
Definition: column4.cxx:1604
SCCOL GetLOKFreezeCol() const
Definition: table7.cxx:587
bool IsMerged(SCCOL nCol, SCROW nRow) const
Definition: table7.cxx:26
void SplitFormulaGroups(SCCOL nCol, std::vector< SCROW > &rRows)
Definition: table7.cxx:268
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...
OString dumpSheetGeomData(bool bColumns, SheetGeomType eGeomType)
Serializes the sheet's geometry data.
Definition: table7.cxx:483
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