Version 7.5.1.1, tag libreoffice-7.5.1.1
[LibreOffice.git] / sc / inc / column.hxx
blob69f0d12d82730101f582af7e2d37286853e83c4d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include "global.hxx"
23 #include "address.hxx"
24 #include "cellvalue.hxx"
25 #include "rangelst.hxx"
26 #include "types.hxx"
27 #include "mtvelements.hxx"
28 #include <formula/types.hxx>
29 #include <svl/zforlist.hxx>
30 #include <svx/svdobj.hxx>
31 #include "attarray.hxx"
33 #include <optional>
34 #include <set>
35 #include <vector>
37 #include <mdds/flat_segment_tree.hpp>
39 namespace editeng { class SvxBorderLine; }
40 namespace formula { struct VectorRefArray; }
42 namespace sc {
44 struct FormulaGroupEntry;
45 class StartListeningContext;
46 class EndListeningContext;
47 class CopyFromClipContext;
48 class CopyToClipContext;
49 class CopyToDocContext;
50 class MixDocContext;
51 class ColumnSpanSet;
52 class SingleColumnSpanSet;
53 struct RefUpdateContext;
54 struct RefUpdateInsertTabContext;
55 struct RefUpdateDeleteTabContext;
56 struct RefUpdateMoveTabContext;
57 class EditTextIterator;
58 struct NoteEntry;
59 class DocumentStreamAccess;
60 class CellValues;
61 class TableValues;
62 struct RowSpan;
63 class RowHeightContext;
64 class CompileFormulaContext;
65 struct SetFormulaDirtyContext;
66 enum class MatrixEdge;
67 class ColumnIterator;
68 class Sparkline;
72 class Fraction;
73 class OutputDevice;
74 class SfxItemPoolCache;
75 class SvtListener;
76 class SfxPoolItem;
77 class SfxStyleSheetBase;
78 class SvxBoxInfoItem;
79 class SvxBoxItem;
81 class ScDocument;
82 class ScEditDataArray;
83 class ScFormulaCell;
84 class ScMarkData;
85 class ScPatternAttr;
86 class ScStyleSheet;
87 class SvtBroadcaster;
88 class ScTypedStrData;
89 class ScProgress;
90 class ScFunctionData;
91 class ScFlatBoolRowSegments;
92 struct ScSetStringParam;
93 struct ScColWidthParam;
94 struct ScRefCellValue;
95 struct ScCellValue;
96 class ScHint;
97 enum class ScMF;
98 struct ScFilterEntries;
99 struct ScInterpreterContext;
101 struct ScNeededSizeOptions
103 const ScPatternAttr* pPattern;
104 bool bFormula;
105 bool bSkipMerged;
106 bool bGetFont;
107 bool bTotalSize;
109 ScNeededSizeOptions();
112 // A shared implementation of some column code and data.
113 // This is used by ScColumn, but also by ScTable for the unallocated
114 // columns (one instance that is the default for all not-yet allocated columns).
115 class ScColumnData
117 protected:
118 std::unique_ptr<ScAttrArray> pAttrArray;
120 ScColumnData(const ScColumnData&) = delete;
121 ScColumnData& operator= (const ScColumnData&) = delete;
123 public:
124 ScColumnData() = default;
125 void InitAttrArray(ScAttrArray* attrArray) { pAttrArray.reset(attrArray); }
127 ScDocument& GetDoc() const { return pAttrArray->GetDoc(); }
129 ScAttrArray& AttrArray() { return *pAttrArray; }
130 const ScAttrArray& AttrArray() const { return *pAttrArray; }
132 const SfxPoolItem& GetAttr( SCROW nRow, sal_uInt16 nWhich ) const;
133 template<class T> const T& GetAttr( SCROW nRow, TypedWhichId<T> nWhich ) const
135 return static_cast<const T&>(GetAttr(nRow, sal_uInt16(nWhich)));
137 const SfxPoolItem& GetAttr( SCROW nRow, sal_uInt16 nWhich, SCROW& nStartRow, SCROW& nEndRow ) const;
138 template<class T> const T& GetAttr( SCROW nRow, TypedWhichId<T> nWhich, SCROW& nStartRow, SCROW& nEndRow ) const
140 return static_cast<const T&>(GetAttr(nRow, sal_uInt16(nWhich), nStartRow, nEndRow));
143 void SetAttrEntries(std::vector<ScAttrEntry> && vNewData);
145 const ScPatternAttr* GetPattern( SCROW nRow ) const;
146 const ScPatternAttr* GetMostUsedPattern( SCROW nStartRow, SCROW nEndRow ) const;
147 SCROW ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray, bool* const pIsChanged,
148 SCCOL nCol );
149 void ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr,
150 ScEditDataArray* pDataArray = nullptr,
151 bool* const pIsChanged = nullptr);
152 void MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW nRow2, bool bDeep ) const;
154 sal_uInt32 GetNumberFormat( const ScInterpreterContext& rContext, SCROW nRow ) const;
155 sal_uInt32 GetNumberFormat( SCROW nStartRow, SCROW nEndRow ) const;
157 /// Including current, may return -1
158 SCROW GetNextUnprotected( SCROW nRow, bool bUp ) const;
160 const ScStyleSheet* GetStyle( SCROW nRow ) const;
161 void ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleSheet& rStyle );
163 bool HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) const;
164 bool HasAttrib( SCROW nRow, HasAttrFlags nMask, SCROW* nStartRow = nullptr, SCROW* nEndRow = nullptr ) const;
166 std::unique_ptr<ScAttrIterator> CreateAttrIterator( SCROW nStartRow, SCROW nEndRow ) const;
168 bool IsAllAttrEqual( const ScColumnData& rCol, SCROW nStartRow, SCROW nEndRow ) const;
170 void ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark, SCCOL nCol );
171 void ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark, SCCOL nCol );
173 bool TestInsertRow( SCSIZE nSize ) const;
174 void InsertRow( SCROW nStartRow, SCSIZE nSize );
177 // Use protected inheritance to prevent publishing some internal ScColumnData
178 // functions as part of ScColumn. If they should be public in ScColumn,
179 // use 'using' to make them public.
180 class ScColumn : protected ScColumnData
182 // Empty values correspond with empty cells. All non-empty cell positions
183 // must have non-empty elements. For text width, the value should be
184 // either the real text width, or TEXTWIDTH_DIRTY in case it hasn't been
185 // calculated yet. For script type, it should be either the real script
186 // type value or SvtScriptType::UNKNOWN.
187 sc::CellTextAttrStoreType maCellTextAttrs;
189 // Cell notes
190 sc::CellNoteStoreType maCellNotes;
192 // Broadcasters for formula cells.
193 sc::BroadcasterStoreType maBroadcasters;
195 // Cell values.
196 sc::CellStoreType maCells;
198 // Sparklines
199 sc::SparklineStoreType maSparklines;
201 size_t mnBlkCountFormula;
203 SCCOL nCol;
204 SCTAB nTab;
206 bool mbEmptyBroadcastersPending : 1; // a broadcaster not removed during EnableDelayDeletingBroadcasters()
208 friend class ScDocument; // for FillInfo
209 friend class ScTable;
210 friend class ScValueIterator;
211 friend class ScHorizontalValueIterator;
212 friend class ScDBQueryDataIterator;
213 template< ScQueryCellIteratorAccess accessType, ScQueryCellIteratorType queryType >
214 friend class ScQueryCellIteratorBase;
215 template< ScQueryCellIteratorAccess accessType >
216 friend class ScQueryCellIteratorAccessSpecific;
217 friend class ScFormulaGroupIterator;
218 friend class ScCellIterator;
219 friend class ScHorizontalCellIterator;
220 friend class ScColumnTextWidthIterator;
221 friend class ScDocumentImport;
222 friend class sc::DocumentStreamAccess;
223 friend class sc::SingleColumnSpanSet;
224 friend class sc::ColumnSpanSet;
225 friend class sc::EditTextIterator;
226 friend class sc::CellValues;
227 friend class sc::TableValues;
228 friend class sc::CellStoreEvent;
230 bool ParseString(
231 ScCellValue& rCell,
232 SCROW nRow, SCTAB nTab, const OUString& rString, formula::FormulaGrammar::AddressConvention eConv,
233 const ScSetStringParam* pParam );
235 void duplicateSparkline(sc::CopyFromClipContext& rContext, sc::ColumnBlockPosition* pBlockPos,
236 size_t nColOffset, size_t nDestSize, ScAddress aDestPosition);
238 public:
240 /** Broadcast mode for SetDirty(SCROW,SCROW,BroadcastMode). */
241 enum BroadcastMode
243 BROADCAST_NONE, ///< no broadcasting
244 BROADCAST_DATA_POSITIONS, ///< broadcast existing cells with position => does AreaBroadcast
245 BROADCAST_BROADCASTERS ///< broadcast only existing cell broadcasters => no AreaBroadcast of range!
248 ScColumn(ScSheetLimits const &);
249 ~ScColumn() COVERITY_NOEXCEPT_FALSE;
251 void Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument& rDoc, bool bEmptyAttrArray);
253 using ScColumnData::GetDoc;
254 SCTAB GetTab() const { return nTab; }
255 SCCOL GetCol() const { return nCol; }
256 sc::CellStoreType& GetCellStore() { return maCells; }
257 const sc::CellStoreType& GetCellStore() const { return maCells; }
258 sc::CellTextAttrStoreType& GetCellAttrStore() { return maCellTextAttrs; }
259 const sc::CellTextAttrStoreType& GetCellAttrStore() const { return maCellTextAttrs; }
260 sc::CellNoteStoreType& GetCellNoteStore() { return maCellNotes; }
261 const sc::CellNoteStoreType& GetCellNoteStore() const { return maCellNotes; }
262 sc::SparklineStoreType& GetSparklineStore() { return maSparklines; }
263 const sc::SparklineStoreType& GetSparklineStore() const { return maSparklines; }
265 ScRefCellValue GetCellValue( SCROW nRow ) const;
266 ScRefCellValue GetCellValue( sc::ColumnBlockPosition& rBlockPos, SCROW nRow );
267 ScRefCellValue GetCellValue( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow ) const;
268 static ScRefCellValue GetCellValue( const sc::CellStoreType::const_iterator& itPos, size_t nOffset );
270 const sc::CellTextAttr* GetCellTextAttr( SCROW nRow ) const;
271 const sc::CellTextAttr* GetCellTextAttr( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow ) const;
273 void Delete( SCROW nRow );
274 void DeleteContent( SCROW nRow, bool bBroadcast = true );
275 void FreeAll();
276 void FreeNotes();
277 void Swap( ScColumn& rOther, SCROW nRow1, SCROW nRow2, bool bPattern );
279 bool HasAttribSelection( const ScMarkData& rMark, HasAttrFlags nMask ) const;
280 bool IsMerged( SCROW nRow ) const;
281 bool ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
282 SCCOL& rPaintCol, SCROW& rPaintRow,
283 bool bRefresh );
285 bool IsEmptyData() const;
286 bool IsEmptyAttr() const;
288 // data only:
289 bool IsEmptyData(SCROW nStartRow, SCROW nEndRow) const;
290 SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const;
291 bool HasDataAt( SCROW nRow, ScDataAreaExtras* pDataAreaExtras = nullptr ) const;
292 bool HasDataAt( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow,
293 ScDataAreaExtras* pDataAreaExtras = nullptr ) const;
294 bool HasDataAt( sc::ColumnBlockPosition& rBlockPos, SCROW nRow,
295 ScDataAreaExtras* pDataAreaExtras = nullptr );
296 void GetDataExtrasAt( SCROW nRow, ScDataAreaExtras& rDataAreaExtras ) const;
297 bool HasVisibleDataAt(SCROW nRow) const;
298 SCROW GetFirstDataPos() const;
299 SCROW GetLastDataPos() const;
300 SCROW GetLastDataPos( SCROW nLastRow, ScDataAreaExtras* pDataAreaExtras = nullptr ) const;
301 bool GetPrevDataPos(SCROW& rRow) const;
302 bool GetNextDataPos(SCROW& rRow) const;
303 bool TrimEmptyBlocks(SCROW& rRowStart, SCROW& rRowEnd) const;
304 void FindDataAreaPos(SCROW& rRow, bool bDown) const; // (without Broadcaster)
305 void FindUsed( SCROW nStartRow, SCROW nEndRow, mdds::flat_segment_tree<SCROW, bool>& rUsed ) const;
307 SCSIZE VisibleCount( SCROW nStartRow, SCROW nEndRow ) const;
308 sc::MatrixEdge GetBlockMatrixEdges(SCROW nRow1, SCROW nRow2, sc::MatrixEdge nMask, bool bNoMatrixAtAll ) const;
309 // Repeated calls to HasSelectionMatrixFragment() repeatedly call rMark.GetMarkedRanges(),
310 // which may be quite slow. For that reason first save the result of rMark.GetMarkedRanges()
311 // pass that to HasSelectionMatrixFragment() calls.
312 bool HasSelectionMatrixFragment(const ScMarkData& rMark, const ScRangeList& rRangeList) const;
314 bool GetFirstVisibleAttr( SCROW& rFirstRow ) const;
315 bool GetLastVisibleAttr( SCROW& rLastRow ) const;
316 bool HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const;
317 bool IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const;
319 bool TestInsertCol( SCROW nStartRow, SCROW nEndRow) const;
320 bool TestInsertRow( SCROW nStartRow, SCSIZE nSize ) const;
321 void InsertRow( SCROW nStartRow, SCSIZE nSize );
322 void GetUnprotectedCells(SCROW nStartRow, SCROW nEndRow, ScRangeList& rRangeList ) const;
325 * @param nStartRow top row position
326 * @param nSize size of the segment to delete.
327 * @param pGroupPos when non-NULL, stores the top position of formula
328 * group that's been merged as a result of row deletion.
330 void DeleteRow( SCROW nStartRow, SCSIZE nSize, std::vector<ScAddress>* pGroupPos );
332 void DeleteArea(
333 SCROW nStartRow, SCROW nEndRow, InsertDeleteFlags nDelFlag,
334 bool bBroadcast = true, sc::ColumnSpanSet* pBroadcastSpans = nullptr );
336 void DeleteRanges( const std::vector<sc::RowSpan>& rRanges, InsertDeleteFlags nDelFlag );
338 void CopyToClip(
339 sc::CopyToClipContext& rCxt, SCROW nRow1, SCROW nRow2, ScColumn& rColumn ) const;
341 void CopyStaticToDocument(
342 SCROW nRow1, SCROW nRow2, const SvNumberFormatterMergeMap& rMap, ScColumn& rDestCol );
344 void CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDestCol );
345 void InitBlockPosition( sc::ColumnBlockPosition& rBlockPos );
346 void InitBlockPosition( sc::ColumnBlockConstPosition& rBlockPos ) const;
348 void DeleteBeforeCopyFromClip(
349 sc::CopyFromClipContext& rCxt, const ScColumn& rClipCol, sc::ColumnSpanSet& rBroadcastSpans );
351 void CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1, SCROW nRow2, size_t nColOffset );
353 void CopyFromClip(
354 sc::CopyFromClipContext& rCxt, SCROW nRow1, SCROW nRow2, tools::Long nDy, ScColumn& rColumn );
356 void RemoveEditAttribs( sc::ColumnBlockPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow );
358 // Selection (?) of this document
359 void MixMarked(
360 sc::MixDocContext& rCxt, const ScMarkData& rMark, ScPasteFunc nFunction,
361 bool bSkipEmpty, const ScColumn& rSrcCol );
362 void MixData(
363 sc::MixDocContext& rCxt, SCROW nRow1, SCROW nRow2, ScPasteFunc nFunction, bool bSkipEmpty,
364 const ScColumn& rSrcCol );
366 void UpdateSelectionFunction(
367 const ScRangeList& rRanges, ScFunctionData& rData, const ScFlatBoolRowSegments& rHiddenRows );
369 void CopyToColumn(
370 sc::CopyToDocContext& rCxt, SCROW nRow1, SCROW nRow2, InsertDeleteFlags nFlags, bool bMarked,
371 ScColumn& rColumn, const ScMarkData* pMarkData = nullptr, bool bAsLink = false,
372 bool bGlobalNamesToLocal = false ) const;
374 void UndoToColumn(
375 sc::CopyToDocContext& rCxt, SCROW nRow1, SCROW nRow2, InsertDeleteFlags nFlags, bool bMarked,
376 ScColumn& rColumn) const;
378 void CopyScenarioFrom( const ScColumn& rSrcCol );
379 void CopyScenarioTo( ScColumn& rDestCol ) const;
380 bool TestCopyScenarioTo( const ScColumn& rDestCol ) const;
381 void MarkScenarioIn( ScMarkData& rDestMark ) const;
383 void CopyUpdated( const ScColumn* pPosCol, ScColumn& rDestCol ) const;
385 void SwapCol(ScColumn& rCol);
386 void MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol);
388 bool HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst);
390 bool SetString(
391 SCROW nRow, SCTAB nTab, const OUString& rString, formula::FormulaGrammar::AddressConvention eConv,
392 const ScSetStringParam* pParam = nullptr );
394 void SetEditText( SCROW nRow, std::unique_ptr<EditTextObject> pEditText );
395 void SetEditText( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, std::unique_ptr<EditTextObject> pEditText );
396 void SetEditText( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, const EditTextObject& rEditText );
397 void SetEditText( SCROW nRow, const EditTextObject& rEditText, const SfxItemPool* pEditPool );
398 void SetFormula( SCROW nRow, const ScTokenArray& rArray, formula::FormulaGrammar::Grammar eGram );
399 void SetFormula( SCROW nRow, const OUString& rFormula, formula::FormulaGrammar::Grammar eGram );
402 * Takes ownership of pCell
404 * @return pCell if it was successfully inserted, NULL otherwise. pCell
405 * is deleted automatically on failure to insert.
407 ScFormulaCell* SetFormulaCell(
408 SCROW nRow, ScFormulaCell* pCell,
409 sc::StartListeningType eListenType = sc::SingleCellListening,
410 bool bInheritNumFormatIfNeeded = true);
411 void SetFormulaCell(
412 sc::ColumnBlockPosition& rBlockPos, SCROW nRow, ScFormulaCell* pCell,
413 sc::StartListeningType eListenType = sc::SingleCellListening,
414 bool bInheritNumFormatIfNeeded = true);
416 bool SetFormulaCells( SCROW nRow, std::vector<ScFormulaCell*>& rCells );
418 bool HasFormulaCell() const;
419 bool HasFormulaCell( SCROW nRow1, SCROW nRow2 ) const;
421 void CloneFormulaCell(
422 sc::ColumnBlockPosition& rBlockPos,
423 const ScFormulaCell& rSrc, const sc::CellTextAttr& rAttr,
424 const std::vector<sc::RowSpan>& rRanges );
426 void CloneFormulaCell(
427 const ScFormulaCell& rSrc, const sc::CellTextAttr& rAttr,
428 const std::vector<sc::RowSpan>& rRanges );
430 svl::SharedString GetSharedString( SCROW nRow ) const;
432 void SetRawString( SCROW nRow, const OUString& rStr );
433 void SetRawString( SCROW nRow, const svl::SharedString& rStr );
434 void SetRawString( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, const svl::SharedString& rStr, bool bBroadcast = true );
435 void SetValue( SCROW nRow, double fVal );
436 void SetValues( const SCROW nRow, const std::vector<double>& rVals );
437 void SetValue( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, double fVal, bool bBroadcast = true );
438 void SetError( SCROW nRow, const FormulaError nError);
440 OUString GetString( SCROW nRow, const ScInterpreterContext* pContext = nullptr ) const
441 { return GetString( GetCellValue( nRow ), nRow, pContext ); }
442 OUString GetString( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow,
443 const ScInterpreterContext* pContext = nullptr ) const
444 { return GetString( GetCellValue( rBlockPos, nRow ), nRow, pContext ); }
445 double* GetValueCell( SCROW nRow );
446 // Note that if pShared is set and a value is returned that way, the returned OUString is empty.
447 OUString GetInputString( SCROW nRow, bool bForceSystemLocale = false ) const
448 { return GetInputString( GetCellValue( nRow ), nRow, bForceSystemLocale ); }
449 OUString GetInputString( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow,
450 bool bForceSystemLocale = false ) const
451 { return GetInputString( GetCellValue( rBlockPos, nRow ), nRow, bForceSystemLocale ); }
452 double GetValue( SCROW nRow ) const;
453 const EditTextObject* GetEditText( SCROW nRow ) const;
454 void RemoveEditTextCharAttribs( SCROW nRow, const ScPatternAttr& rAttr );
455 OUString GetFormula( SCROW nRow ) const;
456 const ScFormulaCell* GetFormulaCell( SCROW nRow ) const;
457 ScFormulaCell* GetFormulaCell( SCROW nRow );
458 ScFormulaCell * const * GetFormulaCellBlockAddress( SCROW nRow, size_t& rBlockSize ) const;
459 CellType GetCellType( SCROW nRow ) const;
460 SCSIZE GetCellCount() const;
461 sal_uInt64 GetWeightedCount() const;
462 sal_uInt64 GetWeightedCount(SCROW nStartRow, SCROW nEndRow) const;
463 sal_uInt64 GetCodeCount() const; // RPN-Code in formulas
464 FormulaError GetErrCode( SCROW nRow ) const;
466 bool HasStringData( SCROW nRow ) const;
467 bool HasValueData( SCROW nRow ) const;
468 bool HasStringCells( SCROW nStartRow, SCROW nEndRow ) const;
470 sc::MultiDataCellState::StateType HasDataCellsInRange(
471 SCROW nRow1, SCROW nRow2, SCROW* pRow1 ) const;
473 bool IsFormulaDirty( SCROW nRow ) const;
475 void CheckVectorizationState();
476 void SetAllFormulasDirty( const sc::SetFormulaDirtyContext& rCxt );
477 void SetDirtyFromClip( SCROW nRow1, SCROW nRow2, sc::ColumnSpanSet& rBroadcastSpans );
478 void SetDirty( SCROW nRow1, SCROW nRow2, BroadcastMode );
479 void SetDirtyVar();
480 void SetDirtyAfterLoad();
481 void SetTableOpDirty( const ScRange& );
482 void CalcAll();
483 void CalcAfterLoad( sc::CompileFormulaContext& rCxt, bool bStartListening );
484 void CompileAll( sc::CompileFormulaContext& rCxt );
485 void CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rProgress );
487 /** Broadcast single broadcasters in range, without explicitly setting
488 anything dirty, not doing area broadcasts.
489 @param rHint address is modified to adapt to the actual broadcasted
490 position on each iteration and upon return points to the last
491 position broadcasted. */
492 bool BroadcastBroadcasters( SCROW nRow1, SCROW nRow2, SfxHintId nHint );
494 bool CompileErrorCells( sc::CompileFormulaContext& rCxt, FormulaError nErrCode );
496 void ResetChanged( SCROW nStartRow, SCROW nEndRow );
498 bool UpdateReferenceOnCopy( sc::RefUpdateContext& rCxt, ScDocument* pUndoDoc = nullptr );
501 * Update reference addresses in formula cell in response to mass cell
502 * movement.
504 * @return true if reference of at least one formula cell has been
505 * updated, false otherwise.
507 bool UpdateReference( sc::RefUpdateContext& rCxt, ScDocument* pUndoDoc );
509 void UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt );
510 void UpdateInsertTabOnlyCells( sc::RefUpdateInsertTabContext& rCxt );
511 void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt );
512 void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt, SCTAB nTabNo );
513 void UpdateCompile( bool bForceIfNameInUse = false );
514 void UpdateTranspose( const ScRange& rSource, const ScAddress& rDest,
515 ScDocument* pUndoDoc );
516 void UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
518 void SetTabNo(SCTAB nNewTab);
519 void FindRangeNamesInUse(SCROW nRow1, SCROW nRow2, sc::UpdatedRangeNames& rIndexes) const;
521 void PreprocessRangeNameUpdate(
522 sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
524 void CompileHybridFormula(
525 sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt );
527 void PreprocessDBDataUpdate(
528 sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
530 using ScColumnData::GetAttr;
531 using ScColumnData::GetPattern;
532 using ScColumnData::GetNumberFormat;
534 void MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, bool bDeep ) const;
535 void MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
536 ScLineFlags& rFlags,
537 SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight ) const;
538 void ApplyBlockFrame(const SvxBoxItem& rLineOuter, const SvxBoxInfoItem* pLineInner,
539 SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight);
541 void ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr );
542 void ApplyPattern( SCROW nRow, const ScPatternAttr& rPatAttr );
543 const ScPatternAttr* SetPattern( SCROW nRow, std::unique_ptr<ScPatternAttr> );
544 void SetPattern( SCROW nRow, const ScPatternAttr& );
545 void SetPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& );
546 void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
547 const ScPatternAttr& rPattern, SvNumFormatType nNewType );
549 void ApplyStyle( SCROW nRow, const ScStyleSheet* rStyle );
550 void ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& rMark);
551 void ApplySelectionLineStyle( const ScMarkData& rMark,
552 const ::editeng::SvxBorderLine* pLine, bool bColorOnly );
553 void AddCondFormat(SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex );
554 void RemoveCondFormat(SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex );
556 const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, bool& rFound ) const;
557 const ScStyleSheet* GetAreaStyle( bool& rFound, SCROW nRow1, SCROW nRow2 ) const;
559 void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset );
560 bool IsStyleSheetUsed( const ScStyleSheet& rStyle ) const;
562 /// May return -1 if not found
563 SCROW SearchStyle(
564 SCROW nRow, const ScStyleSheet* pSearchStyle, bool bUp, bool bInSelection,
565 const ScMarkData& rMark) const;
567 bool SearchStyleRange(
568 SCROW& rRow, SCROW& rEndRow, const ScStyleSheet* pSearchStyle, bool bUp,
569 bool bInSelection, const ScMarkData& rMark) const;
571 bool ApplyFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags );
572 bool RemoveFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags );
573 void ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWhich );
575 void RemoveProtected( SCROW nStartRow, SCROW nEndRow );
577 SCROW ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray, bool* const pIsChanged );
578 void DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& rMark, bool bBroadcast );
580 void ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark );
581 void ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark );
583 tools::Long GetNeededSize(
584 SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY,
585 const Fraction& rZoomX, const Fraction& rZoomY,
586 bool bWidth, const ScNeededSizeOptions& rOptions, const ScPatternAttr** pPatternChange,
587 bool bInPrintTwips = false ) const;
589 sal_uInt16 GetOptimalColWidth(
590 OutputDevice* pDev, double nPPTX, double nPPTY,
591 const Fraction& rZoomX, const Fraction& rZoomY,
592 bool bFormula, sal_uInt16 nOldWidth, const ScMarkData* pMarkData, const ScColWidthParam* pParam) const;
594 void GetOptimalHeight(
595 sc::RowHeightContext& rCxt, SCROW nStartRow, SCROW nEndRow, sal_uInt16 nMinHeight, SCROW nMinStart );
597 void GetFilterEntries(
598 sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow,
599 ScFilterEntries& rFilterEntries, bool bFiltering, bool bFilteredRow );
601 bool GetDataEntries( SCROW nRow, std::set<ScTypedStrData>& rStrings) const;
603 void UpdateInsertTabAbs(SCTAB nNewPos);
604 bool TestTabRefAbs(SCTAB nTable) const;
605 bool GetNextSpellingCell(SCROW& nRow, bool bInSel, const ScMarkData& rData) const;
607 void StartListeningFormulaCells(
608 sc::StartListeningContext& rStartCxt, sc::EndListeningContext& rEndCxt, SCROW nRow1, SCROW nRow2 );
610 void EndListeningFormulaCells(
611 sc::EndListeningContext& rCxt, SCROW nRow1, SCROW nRow2,
612 SCROW* pStartRow, SCROW* pEndRow );
614 void StartListening( SvtListener& rLst, SCROW nRow );
615 void EndListening( SvtListener& rLst, SCROW nRow );
616 void StartListening( sc::StartListeningContext& rCxt, const ScAddress& rAddress, SvtListener& rListener );
617 void EndListening( sc::EndListeningContext& rCxt, const ScAddress& rAddress, SvtListener& rListener );
618 void StartListeners( sc::StartListeningContext& rCxt, bool bAll );
619 void SetDirtyIfPostponed();
620 void BroadcastRecalcOnRefMove();
621 void CollectListeners( std::vector<SvtListener*>& rListeners, SCROW nRow1, SCROW nRow2 );
622 void CollectFormulaCells( std::vector<ScFormulaCell*>& rCells, SCROW nRow1, SCROW nRow2 );
624 void CompileDBFormula( sc::CompileFormulaContext& rCxt );
625 void CompileColRowNameFormula( sc::CompileFormulaContext& rCxt );
627 sal_Int32 GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, rtl_TextEncoding eCharSet ) const;
628 sal_Int32 GetMaxNumberStringLen( sal_uInt16& nPrecision,
629 SCROW nRowStart, SCROW nRowEnd ) const;
631 sal_uInt16 GetTextWidth(SCROW nRow) const;
632 void SetTextWidth(SCROW nRow, sal_uInt16 nWidth);
634 SvtScriptType GetScriptType( SCROW nRow ) const;
637 * Get combined script types of the specified range. This method may
638 * update script types on demand if they have not been determined.
640 SvtScriptType GetRangeScriptType( sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2,
641 const sc::CellStoreType::iterator& itr);
643 void SetScriptType( SCROW nRow, SvtScriptType nType );
644 void UpdateScriptTypes( SCROW nRow1, SCROW nRow2 );
646 formula::FormulaTokenRef ResolveStaticReference( SCROW nRow );
647 bool ResolveStaticReference( ScMatrix& rMat, SCCOL nMatCol, SCROW nRow1, SCROW nRow2 );
648 void FillMatrix( ScMatrix& rMat, size_t nMatCol, SCROW nRow1, SCROW nRow2, svl::SharedStringPool* pPool ) const;
649 formula::VectorRefArray FetchVectorRefArray( SCROW nRow1, SCROW nRow2 );
650 bool HandleRefArrayForParallelism( SCROW nRow1, SCROW nRow2, const ScFormulaCellGroupRef& mxGroup );
651 #ifdef DBG_UTIL
652 void AssertNoInterpretNeeded( SCROW nRow1, SCROW nRow2 );
653 #endif
654 void SetFormulaResults( SCROW nRow, const double* pResults, size_t nLen );
656 void CalculateInThread( ScInterpreterContext& rContext, SCROW nRow, size_t nLen, size_t nOffset,
657 unsigned nThisThread, unsigned nThreadsTotal );
658 void HandleStuffAfterParallelCalculation( SCROW nRow, size_t nLen, ScInterpreter* pInterpreter );
660 void SetNumberFormat( SCROW nRow, sal_uInt32 nNumberFormat );
662 SvtBroadcaster* GetBroadcaster( SCROW nRow );
663 const SvtBroadcaster* GetBroadcaster( SCROW nRow ) const;
665 void DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2 );
666 void PrepareBroadcastersForDestruction();
667 void DeleteEmptyBroadcasters();
669 void Broadcast( SCROW nRow );
670 void BroadcastCells( const std::vector<SCROW>& rRows, SfxHintId nHint );
671 void BroadcastRows( SCROW nStartRow, SCROW nEndRow, SfxHintId nHint );
673 // Spaklines
674 sc::SparklineCell* GetSparklineCell(SCROW nRow);
675 void CreateSparklineCell(SCROW nRow, std::shared_ptr<sc::Sparkline> const& pSparkline);
676 void DeleteSparklineCells(sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2);
677 bool DeleteSparkline(SCROW nRow);
678 bool IsSparklinesEmptyBlock(SCROW nStartRow, SCROW nEndRow) const;
679 void CopyCellSparklinesToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol, SCROW nRowOffsetDest = 0) const;
680 void DuplicateSparklines(SCROW nStartRow, size_t nDataSize, ScColumn& rDestCol,
681 sc::ColumnBlockPosition& rDestBlockPos, SCROW nRowOffsetDest = 0) const;
682 bool HasSparklines() const;
683 SCROW GetSparklinesMaxRow() const;
684 SCROW GetSparklinesMinRow() const;
686 // cell notes
687 ScPostIt* GetCellNote( SCROW nRow );
688 const ScPostIt* GetCellNote( SCROW nRow ) const;
689 ScPostIt* GetCellNote( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow );
690 const ScPostIt* GetCellNote( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow ) const;
691 void DeleteCellNotes( sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2, bool bForgetCaptionOwnership );
692 bool HasCellNote(SCROW nStartRow, SCROW nEndRow) const;
693 bool HasCellNotes() const;
694 void SetCellNote( SCROW nRow, std::unique_ptr<ScPostIt> pNote);
695 bool IsNotesEmptyBlock(SCROW nStartRow, SCROW nEndRow) const;
697 std::unique_ptr<ScPostIt> ReleaseNote( SCROW nRow );
698 size_t GetNoteCount() const;
699 void CreateAllNoteCaptions();
700 void ForgetNoteCaptions( SCROW nRow1, SCROW nRow2, bool bPreserveData );
701 SCROW GetNotePosition( size_t nIndex ) const;
702 void GetAllNoteEntries( std::vector<sc::NoteEntry>& rNotes ) const;
703 void GetNotesInRange( SCROW nStartRow, SCROW nEndRow, std::vector<sc::NoteEntry>& rNotes ) const;
705 SCROW GetCellNotesMaxRow() const;
706 SCROW GetCellNotesMinRow() const;
708 void CopyCellNotesToDocument(
709 SCROW nRow1, SCROW nRow2, ScColumn& rDestCol, bool bCloneCaption = true,
710 SCROW nRowOffsetDest = 0) const;
712 void DuplicateNotes(SCROW nStartRow, size_t nDataSize, ScColumn& rDestCol,
713 sc::ColumnBlockPosition& rDestBlockPos, bool bCloneCaption, SCROW nRowOffsetDest = 0) const;
715 void UpdateNoteCaptions( SCROW nRow1, SCROW nRow2 );
717 void UpdateDrawObjects( std::vector<std::vector<SdrObject*>>& pObjects, SCROW nRowStart, SCROW nRowEnd );
718 void UpdateDrawObjectsForRow( std::vector<SdrObject*>& pObjects, SCCOL nTargetCol, SCROW nTargetRow );
719 bool IsDrawObjectsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const;
721 void InterpretDirtyCells( SCROW nRow1, SCROW nRow2 );
722 bool InterpretCellsIfNeeded( SCROW nRow1, SCROW nRow2 );
724 static void JoinNewFormulaCell( const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell );
727 * Detach a formula cell that's about to be deleted, or removed from
728 * document storage (if that ever happens).
730 * @param rNewSharedRows collects possible new shared row ranges (top and
731 * bottom of shared or remaining single twice) resulting from
732 * unsharing to reestablish listeners on.
734 void DetachFormulaCell( const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell,
735 std::vector<SCROW>& rNewSharedRows );
737 /** Re-establish listeners on unshared formula groups */
738 void StartListeningUnshared( const std::vector<SCROW>& rNewSharedRows );
740 void DetachFormulaCells( const sc::CellStoreType::position_type& aPos, size_t nLength,
741 std::vector<SCROW>* pNewSharedRows );
743 void AttachFormulaCells( sc::StartListeningContext& rCxt, SCROW nRow1, SCROW nRow2 );
744 void DetachFormulaCells( sc::EndListeningContext& rCxt, SCROW nRow1, SCROW nRow2 );
747 * Regroup formula cells for the entire column.
749 void RegroupFormulaCells( std::vector<ScAddress>* pGroupPos = nullptr );
752 * Reset column position of formula cells within specified row range.
753 * If bUpdateRefs==true then reference positions are also adjusted to
754 * reflect the new position so that the formula cells still reference the
755 * same cells or ranges after the position change.
756 * The position of a formula cell before the call is interpreted as the old
757 * position of that cell.
759 * Caller needs to ensure that no formula groups cross the top and bottom
760 * row boundaries.
762 * @param nRow1 top row boundary
763 * @param nRow2 bottom row boundary
764 * @param bUpdateRefs whether to adjust references
766 void ResetFormulaCellPositions( SCROW nRow1, SCROW nRow2, bool bUpdateRefs );
768 void SplitFormulaGroupByRelativeRef( const ScRange& rBoundRange );
770 void TransferCellValuesTo( SCROW nRow, size_t nLen, sc::CellValues& rDest );
771 void CopyCellValuesFrom( SCROW nRow, const sc::CellValues& rSrc );
772 void ConvertFormulaToValue(
773 sc::EndListeningContext& rCxt, SCROW nRow1, SCROW nRow2, sc::TableValues* pUndo );
775 void SwapNonEmpty(
776 sc::TableValues& rValues, sc::StartListeningContext& rStartCxt, sc::EndListeningContext& rEndCxt );
778 std::optional<sc::ColumnIterator> GetColumnIterator( SCROW nRow1, SCROW nRow2 ) const;
780 bool EnsureFormulaCellResults( SCROW nRow1, SCROW nRow2, bool bSkipRunning = false );
782 void StoreToCache(SvStream& rStrm) const;
783 void RestoreFromCache(SvStream& rStrm);
785 #if DUMP_COLUMN_STORAGE
786 void DumpColumnStorage() const;
787 #endif
789 SCSIZE GetPatternCount() const;
790 SCSIZE GetPatternCount( SCROW nRow1, SCROW nRow2 ) const;
791 bool ReservePatternCount( SCSIZE nReserve );
793 void CheckIntegrity() const;
795 private:
797 sc::CellStoreType::iterator GetPositionToInsert( SCROW nRow, std::vector<SCROW>& rNewSharedRows,
798 bool bInsertFormula );
799 sc::CellStoreType::iterator GetPositionToInsert( const sc::CellStoreType::iterator& it, SCROW nRow,
800 std::vector<SCROW>& rNewSharedRows, bool bInsertFormula );
802 void AttachNewFormulaCell(
803 const sc::CellStoreType::iterator& itPos, SCROW nRow, ScFormulaCell& rCell,
804 const std::vector<SCROW>& rNewSharedRows,
805 bool bJoin = true, sc::StartListeningType eListenType = sc::SingleCellListening );
807 void AttachNewFormulaCell(
808 const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell,
809 const std::vector<SCROW>& rNewSharedRows,
810 bool bJoin = true, sc::StartListeningType eListenType = sc::SingleCellListening );
812 public:
813 void AttachNewFormulaCells(const sc::CellStoreType::position_type& aPos, size_t nLength,
814 std::vector<SCROW>& rNewSharedRows);
816 private:
817 void BroadcastNewCell( SCROW nRow );
818 bool UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, sc::CellStoreType::iterator& itr );
820 const ScFormulaCell* FetchFormulaCell( SCROW nRow ) const;
822 SCROW FindNextVisibleRowWithContent(
823 sc::CellStoreType::const_iterator& itPos, SCROW nRow, bool bForward) const;
824 SCROW FindNextVisibleRow(SCROW nRow, bool bForward) const;
826 OUString GetString( const ScRefCellValue& cell, SCROW nRow, const ScInterpreterContext* pContext = nullptr ) const;
827 OUString GetInputString( const ScRefCellValue& cell, SCROW nRow, bool bForceSystemLocale = false ) const;
830 * Called whenever the state of cell array gets modified i.e. new cell
831 * insertion, cell removal or relocation, cell value update and so on.
833 * Call this only from those methods where maCells is modified directly.
835 void CellStorageModified();
836 void CellNotesDeleting(SCROW nRow1, SCROW nRow2, bool bForgetCaptionOwnership );
838 void CopyCellTextAttrsToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol) const;
840 void DeleteCells(
841 sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2, InsertDeleteFlags nDelFlag,
842 sc::SingleColumnSpanSet& rDeleted );
845 * Get all non-grouped formula cells and formula cell groups in the whole
846 * column.
848 std::vector<sc::FormulaGroupEntry> GetFormulaGroupEntries();
850 void EndListeningIntersectedGroup(
851 sc::EndListeningContext& rCxt, SCROW nRow, std::vector<ScAddress>* pGroupPos );
853 void EndListeningIntersectedGroups(
854 sc::EndListeningContext& rCxt, SCROW nRow1, SCROW nRow2, std::vector<ScAddress>* pGroupPos );
856 void EndListeningGroup( sc::EndListeningContext& rCxt, SCROW nRow );
857 void SetNeedsListeningGroup( SCROW nRow );
860 inline bool ScColumn::IsEmptyAttr() const
862 return pAttrArray->IsEmpty();
865 inline bool ScColumnData::IsAllAttrEqual( const ScColumnData& rCol, SCROW nStartRow, SCROW nEndRow ) const
867 return pAttrArray->IsAllEqual( *rCol.pAttrArray, nStartRow, nEndRow );
870 inline bool ScColumn::IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const
872 return pAttrArray->IsVisibleEqual( *rCol.pAttrArray, nStartRow, nEndRow );
875 inline bool ScColumn::GetFirstVisibleAttr( SCROW& rFirstRow ) const
877 return pAttrArray->GetFirstVisibleAttr( rFirstRow );
880 inline bool ScColumn::GetLastVisibleAttr( SCROW& rLastRow ) const
882 // row of last cell is needed
883 SCROW nLastData = GetLastDataPos(); // always including notes, 0 if none
884 return pAttrArray->GetLastVisibleAttr( rLastRow, nLastData );
887 inline bool ScColumn::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const
889 return pAttrArray->HasVisibleAttrIn( nStartRow, nEndRow );
892 inline SCSIZE ScColumn::GetPatternCount() const
894 return pAttrArray->Count();
897 inline SCSIZE ScColumn::GetPatternCount( SCROW nRow1, SCROW nRow2 ) const
899 return pAttrArray->Count( nRow1, nRow2 );
902 inline bool ScColumn::ReservePatternCount( SCSIZE nReserve )
904 return pAttrArray && pAttrArray->Reserve( nReserve );
907 inline bool ScColumn::IsMerged( SCROW nRow ) const
909 return pAttrArray->IsMerged(nRow);
912 inline SCROW ScColumnData::GetNextUnprotected( SCROW nRow, bool bUp ) const
914 return pAttrArray->GetNextUnprotected(nRow, bUp);
917 inline bool ScColumnData::HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) const
919 return pAttrArray->HasAttrib( nRow1, nRow2, nMask );
922 inline bool ScColumnData::HasAttrib( SCROW nRow, HasAttrFlags nMask, SCROW* nStartRow, SCROW* nEndRow ) const
924 return pAttrArray->HasAttrib( nRow, nMask, nStartRow, nEndRow );
927 inline bool ScColumn::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
928 SCCOL& rPaintCol, SCROW& rPaintRow,
929 bool bRefresh )
931 return pAttrArray->ExtendMerge( nThisCol, nStartRow, nEndRow, rPaintCol, rPaintRow, bRefresh );
934 inline void ScColumnData::MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW nRow2, bool bDeep ) const
936 pAttrArray->MergePatternArea( nRow1, nRow2, rState, bDeep );
939 inline void ScColumn::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
940 ScLineFlags& rFlags,
941 SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight ) const
943 pAttrArray->MergeBlockFrame( pLineOuter, pLineInner, rFlags, nStartRow, nEndRow, bLeft, nDistRight );
946 inline void ScColumn::ApplyBlockFrame(const SvxBoxItem& rLineOuter, const SvxBoxInfoItem* pLineInner,
947 SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight)
949 pAttrArray->ApplyBlockFrame(rLineOuter, pLineInner, nStartRow, nEndRow, bLeft, nDistRight);
952 inline const ScPatternAttr* ScColumnData::GetPattern( SCROW nRow ) const
954 return pAttrArray->GetPattern( nRow );
957 inline const SfxPoolItem& ScColumnData::GetAttr( SCROW nRow, sal_uInt16 nWhich ) const
959 return pAttrArray->GetPattern( nRow )->GetItemSet().Get(nWhich);
962 inline const SfxPoolItem& ScColumnData::GetAttr( SCROW nRow, sal_uInt16 nWhich, SCROW& nStartRow, SCROW& nEndRow ) const
964 return pAttrArray->GetPatternRange( nStartRow, nEndRow, nRow )->GetItemSet().Get(nWhich);
967 inline sal_uInt32 ScColumnData::GetNumberFormat( const ScInterpreterContext& rContext, SCROW nRow ) const
969 return pAttrArray->GetPattern( nRow )->GetNumberFormat( rContext.GetFormatTable() );
972 inline void ScColumn::AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex )
974 pAttrArray->AddCondFormat( nStartRow, nEndRow, nIndex );
977 inline void ScColumn::RemoveCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex )
979 pAttrArray->RemoveCondFormat( nStartRow, nEndRow, nIndex );
982 inline void ScColumnData::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleSheet& rStyle )
984 pAttrArray->ApplyStyleArea(nStartRow, nEndRow, rStyle);
987 inline const ScStyleSheet* ScColumnData::GetStyle( SCROW nRow ) const
989 return pAttrArray->GetPattern( nRow )->GetStyleSheet();
992 inline void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset )
994 pAttrArray->FindStyleSheet( pStyleSheet, rUsedRows, bReset );
997 inline bool ScColumn::IsStyleSheetUsed( const ScStyleSheet& rStyle ) const
999 return pAttrArray->IsStyleSheetUsed( rStyle );
1002 inline bool ScColumn::ApplyFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags )
1004 return pAttrArray->ApplyFlags( nStartRow, nEndRow, nFlags );
1007 inline bool ScColumn::RemoveFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags )
1009 return pAttrArray->RemoveFlags( nStartRow, nEndRow, nFlags );
1012 inline void ScColumn::ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWhich )
1014 pAttrArray->ClearItems( nStartRow, nEndRow, pWhich );
1017 inline const ScPatternAttr* ScColumn::SetPattern( SCROW nRow, std::unique_ptr<ScPatternAttr> pPatAttr )
1019 return pAttrArray->SetPattern( nRow, std::move(pPatAttr), true/*bPutToPool*/ );
1022 inline void ScColumn::SetPattern( SCROW nRow, const ScPatternAttr& rPatAttr )
1024 pAttrArray->SetPattern( nRow, &rPatAttr, true/*bPutToPool*/ );
1027 inline void ScColumn::SetPatternArea( SCROW nStartRow, SCROW nEndRow,
1028 const ScPatternAttr& rPatAttr )
1030 pAttrArray->SetPatternArea( nStartRow, nEndRow, &rPatAttr, true/*bPutToPool*/ );
1033 inline void ScColumnData::SetAttrEntries(std::vector<ScAttrEntry> && vNewData)
1035 pAttrArray->SetAttrEntries( std::move( vNewData ));
1038 inline bool ScColumnData::TestInsertRow( SCSIZE nSize ) const
1040 return pAttrArray->TestInsertRow( nSize );
1043 inline void ScColumnData::InsertRow( SCROW nStartRow, SCSIZE nSize )
1045 pAttrArray->InsertRow( nStartRow, nSize );
1048 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */