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 
27 bool 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))
38  return sc::MultiDataCellState();
39 
40  if (nCol1 > nCol2 || nRow1 > nRow2)
41  // invalid range.
42  return sc::MultiDataCellState();
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  for (SCCOL nCol = aRange.mnCol1; nCol <= aRange.mnCol2; ++nCol, ++nClipCol)
113  {
114  if (nClipCol > aClipRange.aEnd.Col())
115  nClipCol = aClipRange.aStart.Col(); // loop through columns.
116 
117  const ScColumn& rClipCol = rClipTab.aCol[nClipCol];
118  aCol[nCol].DeleteBeforeCopyFromClip(rCxt, rClipCol, rBroadcastSpans);
119  }
120  }
121 
122  SetStreamValid(false);
123 }
124 
126  sc::CopyFromClipContext& rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2, const SCROW nSrcRow, const ScTable* pSrcTab )
127 {
128  ScRange aSrcRange = rCxt.getClipDoc()->GetClipParam().getWholeRange();
129  SCCOL nSrcColSize = aSrcRange.aEnd.Col() - aSrcRange.aStart.Col() + 1;
130 
131  for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
132  {
133  SCCOL nColOffset = nCol - nCol1;
134  nColOffset = nColOffset % nSrcColSize;
135  assert(nColOffset >= 0);
136  CreateColumnIfNotExists(nCol).CopyOneCellFromClip(rCxt, nRow1, nRow2, nColOffset);
137 
139  {
140  for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
141  CopyConditionalFormat(nCol, nRow, nCol, nRow, nCol - aSrcRange.aStart.Col() - nColOffset,
142  nRow - nSrcRow, pSrcTab);
143  }
144  }
145 
146  if (nCol1 == 0 && nCol2 == rDocument.MaxCol() && mpRowHeights)
147  {
148  mpRowHeights->setValue(nRow1, nRow2, pSrcTab->GetOriginalHeight(nSrcRow));
149 
150  if (pRowFlags && pSrcTab->pRowFlags) {
151  if (pSrcTab->pRowFlags->GetValue(nSrcRow) & CRFlags::ManualSize)
152  pRowFlags->OrValue(nRow1, CRFlags::ManualSize);
153  else
154  pRowFlags->AndValue(nRow1, ~CRFlags::ManualSize);
155  }
156  }
157 
158  // Copy graphics over too
159  bool bCopyGraphics
161  if (!(bCopyGraphics && rCxt.getClipDoc()->mpDrawLayer))
162  return;
163 
164  ScDrawLayer* pDrawLayer = GetDoc().GetDrawLayer();
165  OSL_ENSURE(pDrawLayer, "No drawing layer");
166  if (pDrawLayer)
167  {
168  const ScAddress aSrcStartPos
170  const ScAddress aSrcEndPos = rCxt.getClipDoc()->GetClipParam().getWholeRange().aEnd;
171  tools::Rectangle aSourceRect = rCxt.getClipDoc()->GetMMRect(
172  aSrcStartPos.Col(), aSrcStartPos.Row(), aSrcEndPos.Col(), aSrcEndPos.Row(),
173  aSrcStartPos.Tab());
174  tools::Rectangle aDestRect = GetDoc().GetMMRect(nCol1, nRow1, nCol2, nRow2, nTab);
175  pDrawLayer->CopyFromClip(rCxt.getClipDoc()->mpDrawLayer.get(), aSrcStartPos.Tab(),
176  aSourceRect, ScAddress(nCol1, nRow1, nTab), aDestRect);
177  }
178 }
179 
180 void ScTable::SetValues( const SCCOL nCol, const SCROW nRow, const std::vector<double>& rVals )
181 {
182  if (!ValidCol(nCol))
183  return;
184 
185  CreateColumnIfNotExists(nCol).SetValues(nRow, rVals);
186 }
187 
188 void ScTable::TransferCellValuesTo( const SCCOL nCol, SCROW nRow, size_t nLen, sc::CellValues& rDest )
189 {
190  if (!ValidCol(nCol))
191  return;
192 
193  CreateColumnIfNotExists(nCol).TransferCellValuesTo(nRow, nLen, rDest);
194 }
195 
196 void ScTable::CopyCellValuesFrom( const SCCOL nCol, SCROW nRow, const sc::CellValues& rSrc )
197 {
198  if (!ValidCol(nCol))
199  return;
200 
202 }
203 
205  sc::EndListeningContext& rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2,
206  sc::TableValues* pUndo )
207 {
208  if (!ValidCol(nCol1) || !ValidCol(nCol2) || nCol1 > nCol2)
209  return;
210 
211  for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
212  CreateColumnIfNotExists(nCol).ConvertFormulaToValue(rCxt, nRow1, nRow2, pUndo);
213 }
214 
216  sc::TableValues& rValues, sc::StartListeningContext& rStartCxt, sc::EndListeningContext& rEndCxt )
217 {
218  const ScRange& rRange = rValues.getRange();
219  assert(rRange.IsValid());
220  for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol)
221  CreateColumnIfNotExists(nCol).SwapNonEmpty(rValues, rStartCxt, rEndCxt);
222 }
223 
225  sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt )
226 {
227  for (SCCOL i = 0; i < aCol.size(); ++i)
228  aCol[i].PreprocessRangeNameUpdate(rEndListenCxt, rCompileCxt);
229 }
230 
232  sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt )
233 {
234  for (SCCOL i = 0; i < aCol.size(); ++i)
235  aCol[i].PreprocessDBDataUpdate(rEndListenCxt, rCompileCxt);
236 }
237 
239  sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt )
240 {
241  for (SCCOL i = 0; i < aCol.size(); ++i)
242  aCol[i].CompileHybridFormula(rStartListenCxt, rCompileCxt);
243 }
244 
245 void ScTable::UpdateScriptTypes( const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2 )
246 {
247  if (!IsColValid(nCol1) || !ValidCol(nCol2) || nCol1 > nCol2)
248  return;
249 
250  const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2, aCol.size() - 1 );
251 
252  for (SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
253  aCol[nCol].UpdateScriptTypes(nRow1, nRow2);
254 }
255 
256 bool ScTable::HasUniformRowHeight( SCROW nRow1, SCROW nRow2 ) const
257 {
258  if (!ValidRow(nRow1) || !ValidRow(nRow2) || nRow1 > nRow2)
259  return false;
260 
262  if (!mpRowHeights->getRangeData(nRow1, aData))
263  // Search failed.
264  return false;
265 
266  return nRow2 <= aData.mnRow2;
267 }
268 
269 void ScTable::SplitFormulaGroups( SCCOL nCol, std::vector<SCROW>& rRows )
270 {
271  if (!IsColValid(nCol))
272  return;
273 
275 }
276 
277 void ScTable::UnshareFormulaCells( SCCOL nCol, std::vector<SCROW>& rRows )
278 {
279  if (!IsColValid(nCol))
280  return;
281 
283 }
284 
286 {
287  if (!IsColValid(nCol))
288  return;
289 
290  aCol[nCol].RegroupFormulaCells();
291 }
292 
293 bool ScTable::HasFormulaCell( const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2 ) const
294 {
295  if (nCol2 < nCol1 || !IsColValid(nCol1) || !ValidCol(nCol2))
296  return false;
297 
298  const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2, aCol.size() - 1 );
299 
300  for (SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
301  if (aCol[nCol].HasFormulaCell(nRow1, nRow2))
302  return true;
303 
304  return false;
305 }
306 
308  sc::EndListeningContext& rCxt, SCCOL nCol, SCROW nRow, std::vector<ScAddress>* pGroupPos )
309 {
310  if (!IsColValid(nCol))
311  return;
312 
313  aCol[nCol].EndListeningIntersectedGroup(rCxt, nRow, pGroupPos);
314 }
315 
317  sc::EndListeningContext& rCxt, const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2,
318  std::vector<ScAddress>* pGroupPos )
319 {
320  if (nCol2 < nCol1 || !IsColValid(nCol1) || !ValidCol(nCol2))
321  return;
322 
323  for (SCCOL nCol : GetColumnsRange(nCol1, nCol2))
324  aCol[nCol].EndListeningIntersectedGroups(rCxt, nRow1, nRow2, pGroupPos);
325 }
326 
328 {
329  if (!IsColValid(nCol))
330  return;
331 
332  aCol[nCol].EndListeningGroup(rCxt, nRow);
333 }
334 
336 {
337  if (!ValidCol(nCol))
338  return;
339 
341 }
342 
344  sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd ) const
345 {
346  if (!IsProtected())
347  {
348  SCCOL nCol1 = 0, nCol2 = aCol.size() - 1;
349  SCROW nRow1 = 0, nRow2 = rDocument.MaxRow();
350 
351  switch (eAction)
352  {
356  {
357  nCol1 = nStart;
358  nCol2 = nEnd;
359  break;
360  }
364  {
365  nRow1 = nStart;
366  nRow2 = nEnd;
367  break;
368  }
369  default:
370  ;
371  }
372 
373  return IsBlockEditable(nCol1, nRow1, nCol2, nRow2, nullptr);
374  }
375 
376  if (IsScenario())
377  // TODO: I don't even know what this scenario thingie is. Perhaps we
378  // should check it against the scenario ranges?
379  return false;
380 
382 
383  switch (eAction)
384  {
387  {
388  // TODO: improve the matrix range handling for the insert-before action.
389  if (HasBlockMatrixFragment(nStart, 0, nEnd, rDocument.MaxRow()))
390  return false;
391 
392  return pTabProtection->isOptionEnabled(ScTableProtection::INSERT_COLUMNS);
393  }
396  {
397  // TODO: improve the matrix range handling for the insert-before action.
398  if (HasBlockMatrixFragment(0, nStart, rDocument.MaxCol(), nEnd))
399  return false;
400 
401  return pTabProtection->isOptionEnabled(ScTableProtection::INSERT_ROWS);
402  }
404  {
405  if (!pTabProtection->isOptionEnabled(ScTableProtection::DELETE_COLUMNS))
406  return false;
407 
408  return !HasAttrib(nStart, 0, nEnd, rDocument.MaxRow(), HasAttrFlags::Protected);
409  }
411  {
412  if (!pTabProtection->isOptionEnabled(ScTableProtection::DELETE_ROWS))
413  return false;
414 
415  return !HasAttrib(0, nStart, rDocument.MaxCol(), nEnd, HasAttrFlags::Protected);
416  }
417  default:
418  ;
419  }
420 
421  return false;
422 }
423 
424 std::unique_ptr<sc::ColumnIterator> ScTable::GetColumnIterator( SCCOL nCol, SCROW nRow1, SCROW nRow2 ) const
425 {
426  if (!ValidCol(nCol))
427  return std::unique_ptr<sc::ColumnIterator>();
428 
429  return CreateColumnIfNotExists(nCol).GetColumnIterator(nRow1, nRow2);
430 }
431 
432 bool ScTable::EnsureFormulaCellResults( const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bSkipRunning )
433 {
434  if (nCol2 < nCol1 || !IsColValid(nCol1) || !ValidCol(nCol2))
435  return false;
436 
437  const SCCOL nMaxCol2 = std::min<SCCOL>( nCol2, aCol.size() - 1 );
438 
439  bool bAnyDirty = false;
440 
441  for (SCCOL nCol = nCol1; nCol <= nMaxCol2; ++nCol)
442  {
443  bool bRet = aCol[nCol].EnsureFormulaCellResults(nRow1, nRow2, bSkipRunning);
444  bAnyDirty = bAnyDirty || bRet;
445  }
446 
447  return bAnyDirty;
448 }
449 
451 {
452  if (pOutlineTable && pRowFlags)
453  {
454  pOutlineTable->GetRowArray().finalizeImport(*this);
455  }
456 }
457 
458 void ScTable::StoreToCache(SvStream& rStrm) const
459 {
460  SCCOL nStartCol = 0;
461  SCCOL nEndCol = rDocument.MaxCol();
462  SCROW nStartRow = 0;
463  SCROW nEndRow = rDocument.MaxRow();
464 
465  GetDataArea(nStartCol, nStartRow, nEndCol, nEndRow, false, false);
466 
467  rStrm.WriteUInt64(nEndCol + 1);
468  for (SCCOL nCol = 0; nCol <= nEndCol; ++nCol)
469  {
470  aCol[nCol].StoreToCache(rStrm);
471  }
472 }
473 
475 {
476  sal_uInt64 nCols = 0;
477  rStrm.ReadUInt64(nCols);
478  for (SCCOL nCol = 0; nCol < static_cast<SCCOL>(nCols); ++nCol)
479  {
480  aCol[nCol].RestoreFromCache(rStrm);
481  }
482 }
483 
484 OString ScTable::dumpSheetGeomData(bool bColumns, SheetGeomType eGeomType)
485 {
486  switch (eGeomType)
487  {
489  // returns a non-empty space separated list of spans with trailing space.
490  // The format of the span is <size of any row/col in the span in print twips>:<last row/col of the span>
491  // Example (for columns with three spans if MAXCOL is 1023): "1280:3 1049:50 1280:1023"
492  return dumpColumnRowSizes(bColumns);
494  // returns a non-empty space separated list of spans with trailing space.
495  // The format of the span is:
496  // 1) First span: <1 (span is hidden) / 0 (not hidden)>:<last row/col of the span>
497  // 2) Rest of the spans: <last row/col of the span>
498  // The hidden state of the spans after the first can be inferred from the first span's flag as no adjacent
499  // spans can have the same state by definition of span.
500  return dumpHiddenFiltered(bColumns, /*bHidden*/ true);
502  // has exactly the same format as 'hidden'.
503  return dumpHiddenFiltered(bColumns, /*bHidden*/ false);
505  // returns a space separated list of 'levels' with trailing space.
506  // A 'level' is a comma separated list of groups(outline entries) with trailing comma.
507  // format of a group is:
508  // <start row/col of group>:<number of rows/cols in the group>:<1/0(group is hidden?)>:<1/0(control is visible?)>
509  return dumpColumnRowGroups(bColumns);
510  default:
511  ;
512  }
513 
514  return "";
515 }
516 
517 OString ScTable::dumpColumnRowSizes(bool bColumns)
518 {
519  // If the data-structures are not available, just report that all
520  // rows/cols have the default sizes.
521  static const OString aDefaultForCols
522  = OString::number(STD_COL_WIDTH) + ":" + OString::number(MAXCOL) + " ";
523  static const OString aDefaultForRows
524  = OString::number(ScGlobal::nStdRowHeight) + ":" + OString::number(MAXROW) + " ";
525 
526  // ScCompressedArray is a template class and we don't want to impose
527  // the restriction that its value type should be string serializable,
528  // instead just operate on the specialized object.
529  typedef ScCompressedArray<SCCOL, sal_uInt16> ColWidthsType;
530  auto dumpColWidths = [](const ColWidthsType& rWidths) -> OString {
531  OString aOutput;
532  OString aSegment;
533  SCCOL nStartCol = 0;
534  const SCCOL nMaxCol = std::min(rWidths.GetLastPos(), MAXCOL);
535  size_t nDummy = 0;
536  while (nStartCol <= nMaxCol)
537  {
538  SCCOL nEndCol;
539  sal_uInt16 nWidth = rWidths.GetValue(nStartCol, nDummy, nEndCol);
540  // The last span nEndCol is always MAXCOL+1 for some reason, and we don't want that.
541  if (nEndCol > nMaxCol)
542  nEndCol = nMaxCol;
543  aSegment = OString::number(nWidth) + ":" + OString::number(nEndCol) + " ";
544  aOutput += aSegment;
545  nStartCol = nEndCol + 1;
546  }
547 
548  return aOutput;
549  };
550 
551  if (bColumns)
552  return mpColWidth ? dumpColWidths(*mpColWidth) : aDefaultForCols;
553 
554  return mpRowHeights ? mpRowHeights->dumpAsString() : aDefaultForRows;
555 }
556 
557 OString ScTable::dumpHiddenFiltered(bool bColumns, bool bHidden)
558 {
559  // defaults to no hidden/filtered row/cols.
560  static const OString aDefaultForCols = "0:" + OString::number(MAXCOL) + " ";
561  static const OString aDefaultForRows = "0:" + OString::number(MAXROW) + " ";
562 
563  if (bHidden)
564  {
565  if (bColumns)
566  return mpHiddenCols ? mpHiddenCols->dumpAsString() : aDefaultForCols;
567 
568  return mpHiddenRows ? mpHiddenRows->dumpAsString() : aDefaultForRows;
569  }
570 
571  if (bColumns)
572  return mpFilteredCols ? mpFilteredCols->dumpAsString() : aDefaultForCols;
573 
574  return mpFilteredRows ? mpFilteredRows->dumpAsString() : aDefaultForRows;
575 }
576 
577 OString ScTable::dumpColumnRowGroups(bool bColumns) const
578 {
579  if (!pOutlineTable)
580  return "";
581 
582  if (bColumns)
583  return pOutlineTable->GetColArray().dumpAsString();
584 
585  return pOutlineTable->GetRowArray().dumpAsString();
586 }
587 
589 {
590  return maLOKFreezeCell.Col();
591 }
592 
594 {
595  return maLOKFreezeCell.Row();
596 }
597 
599 {
600  if (!ValidCol(nFreezeCol))
601  {
602  SAL_WARN("sc.core", "ScTable::SetLOKFreezeCol : invalid nFreezeCol = " << nFreezeCol);
603  return false;
604  }
605 
606  if (maLOKFreezeCell.Col() != nFreezeCol)
607  {
608  maLOKFreezeCell.SetCol(nFreezeCol);
609  return true;
610  }
611 
612  return false;
613 }
614 
616 {
617  if (!ValidRow(nFreezeRow))
618  {
619  SAL_WARN("sc.core", "ScTable::SetLOKFreezeRow : invalid nFreezeRow = " << nFreezeRow);
620  return false;
621  }
622 
623  if (maLOKFreezeCell.Row() != nFreezeRow)
624  {
625  maLOKFreezeCell.SetRow(nFreezeRow);
626  return true;
627  }
628 
629  return false;
630 }
631 
632 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SCTAB nTab
Definition: table.hxx:203
SvStream & WriteUInt64(sal_uInt64 nuInt64)
bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, HasAttrFlags nMask) const
Definition: table2.cxx:2072
ScAddress aStart
Definition: address.hxx:499
void TransferCellValuesTo(const SCCOL nCol, SCROW nRow, size_t nLen, sc::CellValues &rDest)
Definition: table7.cxx:188
bool HasBlockMatrixFragment(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, bool bNoMatrixAtAll=false) const
Definition: table2.cxx:2303
std::unique_ptr< ScFlatUInt16RowSegments > mpRowHeights
Definition: table.hxx:180
SCROW Row() const
Definition: address.hxx:261
void SetValues(const SCCOL nCol, const SCROW nRow, const std::vector< double > &rVals)
Definition: table7.cxx:180
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:245
bool HasFormulaCell(const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2) const
Definition: table7.cxx:293
Think of this as a mini-ScColumn like storage that only stores cell values in a column.
Definition: cellvalues.hxx:40
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:85
ScAddress aEnd
Definition: address.hxx:500
void CopyFromClip(ScDrawLayer *pClipModel, SCTAB nSourceTab, const tools::Rectangle &rSourceRange, const ScAddress &rDestPos, const tools::Rectangle &rDestRange)
Definition: drwlayer.cxx:1786
sal_uInt16 GetOriginalHeight(SCROW nRow) const
Definition: table2.cxx:3357
bool empty() const
SvStream & ReadUInt64(sal_uInt64 &rUInt64)
void CompileHybridFormula(sc::StartListeningContext &rStartListenCxt, sc::CompileFormulaContext &rCompileCxt)
Definition: table7.cxx:238
void RestoreFromCache(SvStream &rStrm)
Definition: table7.cxx:474
void PreprocessDBDataUpdate(sc::EndListeningContext &rEndListenCxt, sc::CompileFormulaContext &rCompileCxt)
Definition: table7.cxx:231
Internal use only (d&d undo): do not delete caption objects of cell notes.
bool ValidRow(SCROW nRow) const
Definition: table.hxx:330
void SetStreamValid(bool bSet, bool bIgnoreLock=false)
Definition: table1.cxx:374
ScColumn & CreateColumnIfNotExists(const SCCOL nScCol) const
Definition: table.hxx:284
bool IsEditActionAllowed(sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd) const
Definition: table7.cxx:343
#define STD_COL_WIDTH
Definition: global.hxx:94
ScClipParam & GetClipParam()
Definition: document.cxx:2541
bool IsBlockEditable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool *pOnlyNotBecauseOfMatrix=nullptr, bool bNoMatrixAtAll=false) const
Definition: table2.cxx:2415
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:871
void finalizeOutlineImport()
Definition: table7.cxx:450
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void setCondFormatList(ScConditionalFormatList *pCondFormatList)
const SCROW MAXROW
Definition: address.hxx:68
void ConvertFormulaToValue(sc::EndListeningContext &rCxt, const SCCOL nCol1, const SCROW nRow1, const SCCOL nCol2, const SCROW nRow2, sc::TableValues *pUndo)
Definition: table7.cxx:204
void PreprocessRangeNameUpdate(sc::EndListeningContext &rEndListenCxt, sc::CompileFormulaContext &rCompileCxt)
Definition: table7.cxx:224
SCTAB Tab() const
Definition: address.hxx:270
void SetRow(SCROW nRowP)
Definition: address.hxx:274
void CopyCellValuesFrom(const SCCOL nCol, SCROW nRow, const sc::CellValues &rSrc)
Definition: table7.cxx:196
void EndListeningIntersectedGroups(sc::EndListeningContext &rCxt, const SCCOL nCol1, SCROW nRow1, const SCCOL nCol2, SCROW nRow2, std::vector< ScAddress > *pGroupPos)
Definition: table7.cxx:316
bool HasUniformRowHeight(SCROW nRow1, SCROW nRow2) const
Definition: table7.cxx:256
std::unique_ptr< ScOutlineTable > pOutlineTable
Definition: table.hxx:194
void SetNeedsListeningGroup(SCCOL nCol, SCROW nRow)
Definition: table7.cxx:335
void SetCol(SCCOL nColP)
Definition: address.hxx:278
std::unique_ptr< ScDrawLayer > mpDrawLayer
Definition: document.hxx:370
bool IsColValid(const SCCOL nScCol) const
Definition: table.hxx:317
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)
Definition: table7.cxx:125
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:577
std::unique_ptr< ScFlatBoolColSegments > mpHiddenCols
Definition: table.hxx:184
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
Definition: document.hxx:1057
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:870
bool IsProtected() const
Definition: table5.cxx:1088
bool ValidCol(SCCOL nCol) const
Definition: table.hxx:329
ScDocument & GetDoc()
Definition: table.hxx:278
int i
void SetValues(const SCROW nRow, const std::vector< double > &rVals)
Definition: column4.cxx:311
sal_Int16 SCCOL
Definition: types.hxx:21
void UnshareFormulaCells(SCCOL nCol, std::vector< SCROW > &rRows)
Definition: table7.cxx:277
const SCCOL MAXCOL
Definition: address.hxx:69
sc::MultiDataCellState HasMultipleDataCells(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
Definition: table7.cxx:35
ScAddress maLOKFreezeCell
Definition: table.hxx:229
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:557
const ScRange & getRange() const
Definition: cellvalues.cxx:317
ScColContainer aCol
Definition: table.hxx:156
std::unique_ptr< ScConditionalFormatList > mpCondFormatList
Definition: table.hxx:227
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: documen3.cxx:1988
bool IsValid() const
Definition: address.hxx:546
bool IsScenario() const
Definition: table.hxx:344
SCCOL Col() const
Definition: address.hxx:266
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:327
SCROW GetLOKFreezeRow() const
Definition: table7.cxx:593
bool SetLOKFreezeCol(SCCOL nFreezeCol)
Definition: table7.cxx:598
const D & GetValue(A nPos) const
sal_Int32 SCROW
Definition: types.hxx:17
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:424
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:813
bool ValidColRow(SCCOL nCol, SCROW nRow) const
Definition: table.hxx:331
void CopyConditionalFormat(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCCOL nDx, SCROW nDy, const ScTable *pTable)
Definition: table2.cxx:623
ScColumnsRange GetColumnsRange(SCCOL begin, SCCOL end) const
Definition: table1.cxx:2626
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:615
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:432
void RegroupFormulaCells(SCCOL nCol)
Definition: table7.cxx:285
Range getDestRange() const
Definition: clipcontext.cxx:81
#define SAL_WARN(area, stream)
ScDocument & rDocument
Definition: table.hxx:204
void DeleteBeforeCopyFromClip(sc::CopyFromClipContext &rCxt, const ScTable &rClipTab, sc::ColumnSpanSet &rBroadcastSpans)
Definition: table7.cxx:98
void EndListeningIntersectedGroup(sc::EndListeningContext &rCxt, SCCOL nCol, SCROW nRow, std::vector< ScAddress > *pGroupPos)
Definition: table7.cxx:307
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:215
void StoreToCache(SvStream &rStrm) const
Definition: table7.cxx:458
std::unique_ptr< ScFlatBoolRowSegments > mpHiddenRows
Definition: table.hxx:185
SCCOL GetAllocatedColumnsCount() const
Definition: table.hxx:1091
void SetNeedsListeningGroup(SCROW nRow)
Definition: column4.cxx:1604
SCCOL GetLOKFreezeCol() const
Definition: table7.cxx:588
bool IsMerged(SCCOL nCol, SCROW nRow) const
Definition: table7.cxx:27
void SplitFormulaGroups(SCCOL nCol, std::vector< SCROW > &rRows)
Definition: table7.cxx:269
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:484
OString dumpColumnRowSizes(bool bColumns)
Returns list-of-spans representation of the column-widths/row-heights in twips encoded as an OString...
Definition: table7.cxx:517