LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / sc / inc / column.hxx
blob293798fd183f27e56cd622863463d27b3a100d7a
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 mbFiltering; // it is true if there is a filtering in the column
208 friend class ScDocument; // for FillInfo
209 friend class ScTable;
210 friend class ScValueIterator;
211 friend class ScHorizontalValueIterator;
212 friend class ScDBQueryDataIterator;
213 friend class ScQueryCellIterator;
214 friend class ScCountIfCellIterator;
215 friend class ScFormulaGroupIterator;
216 friend class ScCellIterator;
217 friend class ScHorizontalCellIterator;
218 friend class ScColumnTextWidthIterator;
219 friend class ScDocumentImport;
220 friend class sc::DocumentStreamAccess;
221 friend class sc::SingleColumnSpanSet;
222 friend class sc::ColumnSpanSet;
223 friend class sc::EditTextIterator;
224 friend class sc::CellValues;
225 friend class sc::TableValues;
226 friend class sc::CellStoreEvent;
228 bool ParseString(
229 ScCellValue& rCell,
230 SCROW nRow, SCTAB nTab, const OUString& rString, formula::FormulaGrammar::AddressConvention eConv,
231 const ScSetStringParam* pParam );
233 void duplicateSparkline(sc::CopyFromClipContext& rContext, sc::ColumnBlockPosition* pBlockPos,
234 size_t nColOffset, size_t nDestSize, ScAddress aDestPosition);
236 public:
238 /** Broadcast mode for SetDirty(SCROW,SCROW,BroadcastMode). */
239 enum BroadcastMode
241 BROADCAST_NONE, ///< no broadcasting
242 BROADCAST_DATA_POSITIONS, ///< broadcast existing cells with position => does AreaBroadcast
243 BROADCAST_BROADCASTERS ///< broadcast only existing cell broadcasters => no AreaBroadcast of range!
246 ScColumn(ScSheetLimits const &);
247 ~ScColumn() COVERITY_NOEXCEPT_FALSE;
249 void Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument& rDoc, bool bEmptyAttrArray);
251 using ScColumnData::GetDoc;
252 SCTAB GetTab() const { return nTab; }
253 SCCOL GetCol() const { return nCol; }
254 bool HasFiltering() const { return mbFiltering; }
255 sc::CellStoreType& GetCellStore() { return maCells; }
256 const sc::CellStoreType& GetCellStore() const { return maCells; }
257 sc::CellTextAttrStoreType& GetCellAttrStore() { return maCellTextAttrs; }
258 const sc::CellTextAttrStoreType& GetCellAttrStore() const { return maCellTextAttrs; }
259 sc::CellNoteStoreType& GetCellNoteStore() { return maCellNotes; }
260 const sc::CellNoteStoreType& GetCellNoteStore() const { return maCellNotes; }
261 sc::SparklineStoreType& GetSparklineStore() { return maSparklines; }
262 const sc::SparklineStoreType& GetSparklineStore() const { return maSparklines; }
264 ScRefCellValue GetCellValue( SCROW nRow ) const;
265 ScRefCellValue GetCellValue( sc::ColumnBlockPosition& rBlockPos, SCROW nRow );
266 ScRefCellValue GetCellValue( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow ) const;
267 static ScRefCellValue GetCellValue( const sc::CellStoreType::const_iterator& itPos, size_t nOffset );
269 const sc::CellTextAttr* GetCellTextAttr( SCROW nRow ) const;
270 const sc::CellTextAttr* GetCellTextAttr( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow ) const;
272 void Delete( SCROW nRow );
273 void DeleteContent( SCROW nRow, bool bBroadcast = true );
274 void FreeAll();
275 void FreeNotes();
276 void Swap( ScColumn& rOther, SCROW nRow1, SCROW nRow2, bool bPattern );
278 bool HasAttribSelection( const ScMarkData& rMark, HasAttrFlags nMask ) const;
279 bool IsMerged( SCROW nRow ) const;
280 bool ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
281 SCCOL& rPaintCol, SCROW& rPaintRow,
282 bool bRefresh );
284 bool IsEmptyData() const;
285 bool IsEmptyAttr() const;
287 // data only:
288 bool IsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const;
289 SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const;
290 bool HasDataAt( SCROW nRow, ScDataAreaExtras* pDataAreaExtras = nullptr ) const;
291 bool HasDataAt( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow,
292 ScDataAreaExtras* pDataAreaExtras = nullptr ) const;
293 bool HasDataAt( sc::ColumnBlockPosition& rBlockPos, SCROW nRow,
294 ScDataAreaExtras* pDataAreaExtras = nullptr );
295 void GetDataExtrasAt( SCROW nRow, ScDataAreaExtras& rDataAreaExtras ) const;
296 bool HasVisibleDataAt(SCROW nRow) const;
297 SCROW GetFirstDataPos() const;
298 SCROW GetLastDataPos() const;
299 SCROW GetLastDataPos( SCROW nLastRow, ScDataAreaExtras* pDataAreaExtras = nullptr ) const;
300 bool GetPrevDataPos(SCROW& rRow) const;
301 bool GetNextDataPos(SCROW& rRow) const;
302 bool TrimEmptyBlocks(SCROW& rRowStart, SCROW& rRowEnd) const;
303 void FindDataAreaPos(SCROW& rRow, bool bDown) const; // (without Broadcaster)
304 void FindUsed( SCROW nStartRow, SCROW nEndRow, mdds::flat_segment_tree<SCROW, bool>& rUsed ) const;
306 SCSIZE VisibleCount( SCROW nStartRow, SCROW nEndRow ) const;
307 sc::MatrixEdge GetBlockMatrixEdges(SCROW nRow1, SCROW nRow2, sc::MatrixEdge nMask, bool bNoMatrixAtAll ) const;
308 // Repeated calls to HasSelectionMatrixFragment() repeatedly call rMark.GetMarkedRanges(),
309 // which may be quite slow. For that reason first save the result of rMark.GetMarkedRanges()
310 // pass that to HasSelectionMatrixFragment() calls.
311 bool HasSelectionMatrixFragment(const ScMarkData& rMark, const ScRangeList& rRangeList) const;
313 bool GetFirstVisibleAttr( SCROW& rFirstRow ) const;
314 bool GetLastVisibleAttr( SCROW& rLastRow ) const;
315 bool HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const;
316 bool IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const;
318 bool TestInsertCol( SCROW nStartRow, SCROW nEndRow) const;
319 bool TestInsertRow( SCROW nStartRow, SCSIZE nSize ) const;
320 void InsertRow( SCROW nStartRow, SCSIZE nSize );
321 void GetUnprotectedCells(SCROW nStartRow, SCROW nEndRow, ScRangeList& rRangeList ) const;
324 * @param nStartRow top row position
325 * @param nSize size of the segment to delete.
326 * @param pGroupPos when non-NULL, stores the top position of formula
327 * group that's been merged as a result of row deletion.
329 void DeleteRow( SCROW nStartRow, SCSIZE nSize, std::vector<ScAddress>* pGroupPos );
331 void DeleteArea(
332 SCROW nStartRow, SCROW nEndRow, InsertDeleteFlags nDelFlag,
333 bool bBroadcast = true, sc::ColumnSpanSet* pBroadcastSpans = nullptr );
335 void DeleteRanges( const std::vector<sc::RowSpan>& rRanges, InsertDeleteFlags nDelFlag );
337 void CopyToClip(
338 sc::CopyToClipContext& rCxt, SCROW nRow1, SCROW nRow2, ScColumn& rColumn ) const;
340 void CopyStaticToDocument(
341 SCROW nRow1, SCROW nRow2, const SvNumberFormatterMergeMap& rMap, ScColumn& rDestCol );
343 void CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDestCol );
344 void InitBlockPosition( sc::ColumnBlockPosition& rBlockPos );
345 void InitBlockPosition( sc::ColumnBlockConstPosition& rBlockPos ) const;
347 void DeleteBeforeCopyFromClip(
348 sc::CopyFromClipContext& rCxt, const ScColumn& rClipCol, sc::ColumnSpanSet& rBroadcastSpans );
350 void CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1, SCROW nRow2, size_t nColOffset );
352 void CopyFromClip(
353 sc::CopyFromClipContext& rCxt, SCROW nRow1, SCROW nRow2, tools::Long nDy, ScColumn& rColumn );
355 void RemoveEditAttribs( sc::ColumnBlockPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow );
357 // Selection (?) of this document
358 void MixMarked(
359 sc::MixDocContext& rCxt, const ScMarkData& rMark, ScPasteFunc nFunction,
360 bool bSkipEmpty, const ScColumn& rSrcCol );
361 void MixData(
362 sc::MixDocContext& rCxt, SCROW nRow1, SCROW nRow2, ScPasteFunc nFunction, bool bSkipEmpty,
363 const ScColumn& rSrcCol );
365 void UpdateSelectionFunction(
366 const ScRangeList& rRanges, ScFunctionData& rData, const ScFlatBoolRowSegments& rHiddenRows );
368 void CopyToColumn(
369 sc::CopyToDocContext& rCxt, SCROW nRow1, SCROW nRow2, InsertDeleteFlags nFlags, bool bMarked,
370 ScColumn& rColumn, const ScMarkData* pMarkData = nullptr, bool bAsLink = false,
371 bool bGlobalNamesToLocal = false ) const;
373 void UndoToColumn(
374 sc::CopyToDocContext& rCxt, SCROW nRow1, SCROW nRow2, InsertDeleteFlags nFlags, bool bMarked,
375 ScColumn& rColumn) const;
377 void CopyScenarioFrom( const ScColumn& rSrcCol );
378 void CopyScenarioTo( ScColumn& rDestCol ) const;
379 bool TestCopyScenarioTo( const ScColumn& rDestCol ) const;
380 void MarkScenarioIn( ScMarkData& rDestMark ) const;
382 void CopyUpdated( const ScColumn* pPosCol, ScColumn& rDestCol ) const;
384 void SwapCol(ScColumn& rCol);
385 void MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol);
387 bool HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst);
389 bool SetString(
390 SCROW nRow, SCTAB nTab, const OUString& rString, formula::FormulaGrammar::AddressConvention eConv,
391 const ScSetStringParam* pParam = nullptr );
393 void SetEditText( SCROW nRow, std::unique_ptr<EditTextObject> pEditText );
394 void SetEditText( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, std::unique_ptr<EditTextObject> pEditText );
395 void SetEditText( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, const EditTextObject& rEditText );
396 void SetEditText( SCROW nRow, const EditTextObject& rEditText, const SfxItemPool* pEditPool );
397 void SetFormula( SCROW nRow, const ScTokenArray& rArray, formula::FormulaGrammar::Grammar eGram );
398 void SetFormula( SCROW nRow, const OUString& rFormula, formula::FormulaGrammar::Grammar eGram );
401 * Takes ownership of pCell
403 * @return pCell if it was successfully inserted, NULL otherwise. pCell
404 * is deleted automatically on failure to insert.
406 ScFormulaCell* SetFormulaCell(
407 SCROW nRow, ScFormulaCell* pCell,
408 sc::StartListeningType eListenType = sc::SingleCellListening,
409 bool bInheritNumFormatIfNeeded = true);
410 void SetFormulaCell(
411 sc::ColumnBlockPosition& rBlockPos, SCROW nRow, ScFormulaCell* pCell,
412 sc::StartListeningType eListenType = sc::SingleCellListening,
413 bool bInheritNumFormatIfNeeded = true);
415 bool SetFormulaCells( SCROW nRow, std::vector<ScFormulaCell*>& rCells );
417 bool HasFormulaCell() const;
418 bool HasFormulaCell( SCROW nRow1, SCROW nRow2 ) const;
420 void CloneFormulaCell(
421 sc::ColumnBlockPosition& rBlockPos,
422 const ScFormulaCell& rSrc, const sc::CellTextAttr& rAttr,
423 const std::vector<sc::RowSpan>& rRanges );
425 void CloneFormulaCell(
426 const ScFormulaCell& rSrc, const sc::CellTextAttr& rAttr,
427 const std::vector<sc::RowSpan>& rRanges );
429 svl::SharedString GetSharedString( SCROW nRow ) const;
431 void SetRawString( SCROW nRow, const OUString& rStr );
432 void SetRawString( SCROW nRow, const svl::SharedString& rStr );
433 void SetRawString( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, const svl::SharedString& rStr, bool bBroadcast = true );
434 void SetValue( SCROW nRow, double fVal );
435 void SetValues( const SCROW nRow, const std::vector<double>& rVals );
436 void SetValue( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, double fVal, bool bBroadcast = true );
437 void SetError( SCROW nRow, const FormulaError nError);
439 OUString GetString( SCROW nRow, const ScInterpreterContext* pContext = nullptr ) const
440 { return GetString( GetCellValue( nRow ), nRow, pContext ); }
441 OUString GetString( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow,
442 const ScInterpreterContext* pContext = nullptr ) const
443 { return GetString( GetCellValue( rBlockPos, nRow ), nRow, pContext ); }
444 double* GetValueCell( SCROW nRow );
445 // Note that if pShared is set and a value is returned that way, the returned OUString is empty.
446 OUString GetInputString( SCROW nRow, const svl::SharedString** pShared = nullptr ) const
447 { return GetInputString( GetCellValue( nRow ), nRow, pShared ); }
448 OUString GetInputString( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow,
449 const svl::SharedString** pShared = nullptr ) const
450 { return GetInputString( GetCellValue( rBlockPos, nRow ), nRow, pShared ); }
451 double GetValue( SCROW nRow ) const;
452 const EditTextObject* GetEditText( SCROW nRow ) const;
453 void RemoveEditTextCharAttribs( SCROW nRow, const ScPatternAttr& rAttr );
454 OUString GetFormula( SCROW nRow ) const;
455 const ScFormulaCell* GetFormulaCell( SCROW nRow ) const;
456 ScFormulaCell* GetFormulaCell( SCROW nRow );
457 ScFormulaCell * const * GetFormulaCellBlockAddress( SCROW nRow, size_t& rBlockSize ) const;
458 CellType GetCellType( SCROW nRow ) const;
459 SCSIZE GetCellCount() const;
460 sal_uInt64 GetWeightedCount() const;
461 sal_uInt64 GetWeightedCount(SCROW nStartRow, SCROW nEndRow) const;
462 sal_uInt64 GetCodeCount() const; // RPN-Code in formulas
463 FormulaError GetErrCode( SCROW nRow ) const;
465 bool HasStringData( SCROW nRow ) const;
466 bool HasValueData( SCROW nRow ) const;
467 bool HasStringCells( SCROW nStartRow, SCROW nEndRow ) const;
469 sc::MultiDataCellState::StateType HasDataCellsInRange(
470 SCROW nRow1, SCROW nRow2, SCROW* pRow1 ) const;
472 bool IsFormulaDirty( SCROW nRow ) const;
474 void CheckVectorizationState();
475 void SetAllFormulasDirty( const sc::SetFormulaDirtyContext& rCxt );
476 void SetDirtyFromClip( SCROW nRow1, SCROW nRow2, sc::ColumnSpanSet& rBroadcastSpans );
477 void SetDirty( SCROW nRow1, SCROW nRow2, BroadcastMode );
478 void SetDirtyVar();
479 void SetDirtyAfterLoad();
480 void SetTableOpDirty( const ScRange& );
481 void CalcAll();
482 void CalcAfterLoad( sc::CompileFormulaContext& rCxt, bool bStartListening );
483 void CompileAll( sc::CompileFormulaContext& rCxt );
484 void CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rProgress );
486 /** Broadcast single broadcasters in range, without explicitly setting
487 anything dirty, not doing area broadcasts.
488 @param rHint address is modified to adapt to the actual broadcasted
489 position on each iteration and upon return points to the last
490 position broadcasted. */
491 bool BroadcastBroadcasters( SCROW nRow1, SCROW nRow2, SfxHintId nHint );
493 bool CompileErrorCells( sc::CompileFormulaContext& rCxt, FormulaError nErrCode );
495 void ResetChanged( SCROW nStartRow, SCROW nEndRow );
497 bool UpdateReferenceOnCopy( sc::RefUpdateContext& rCxt, ScDocument* pUndoDoc = nullptr );
500 * Update reference addresses in formula cell in response to mass cell
501 * movement.
503 * @return true if reference of at least one formula cell has been
504 * updated, false otherwise.
506 bool UpdateReference( sc::RefUpdateContext& rCxt, ScDocument* pUndoDoc );
508 void UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt );
509 void UpdateInsertTabOnlyCells( sc::RefUpdateInsertTabContext& rCxt );
510 void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt );
511 void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt, SCTAB nTabNo );
512 void UpdateCompile( bool bForceIfNameInUse = false );
513 void UpdateTranspose( const ScRange& rSource, const ScAddress& rDest,
514 ScDocument* pUndoDoc );
515 void UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
517 void SetTabNo(SCTAB nNewTab);
518 void FindRangeNamesInUse(SCROW nRow1, SCROW nRow2, sc::UpdatedRangeNames& rIndexes) const;
520 void PreprocessRangeNameUpdate(
521 sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
523 void CompileHybridFormula(
524 sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt );
526 void PreprocessDBDataUpdate(
527 sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
529 using ScColumnData::GetAttr;
530 using ScColumnData::GetPattern;
531 using ScColumnData::GetNumberFormat;
533 void MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, bool bDeep ) const;
534 void MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
535 ScLineFlags& rFlags,
536 SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight ) const;
537 void ApplyBlockFrame(const SvxBoxItem& rLineOuter, const SvxBoxInfoItem* pLineInner,
538 SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight);
540 void ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr );
541 void ApplyPattern( SCROW nRow, const ScPatternAttr& rPatAttr );
542 const ScPatternAttr* SetPattern( SCROW nRow, std::unique_ptr<ScPatternAttr> );
543 void SetPattern( SCROW nRow, const ScPatternAttr& );
544 void SetPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& );
545 void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
546 const ScPatternAttr& rPattern, SvNumFormatType nNewType );
548 void ApplyStyle( SCROW nRow, const ScStyleSheet* rStyle );
549 void ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& rMark);
550 void ApplySelectionLineStyle( const ScMarkData& rMark,
551 const ::editeng::SvxBorderLine* pLine, bool bColorOnly );
552 void AddCondFormat(SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex );
553 void RemoveCondFormat(SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex );
555 const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, bool& rFound ) const;
556 const ScStyleSheet* GetAreaStyle( bool& rFound, SCROW nRow1, SCROW nRow2 ) const;
558 void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset );
559 bool IsStyleSheetUsed( const ScStyleSheet& rStyle ) const;
561 /// May return -1 if not found
562 SCROW SearchStyle(
563 SCROW nRow, const ScStyleSheet* pSearchStyle, bool bUp, bool bInSelection,
564 const ScMarkData& rMark) const;
566 bool SearchStyleRange(
567 SCROW& rRow, SCROW& rEndRow, const ScStyleSheet* pSearchStyle, bool bUp,
568 bool bInSelection, const ScMarkData& rMark) const;
570 bool ApplyFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags );
571 bool RemoveFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags );
572 void ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWhich );
574 void RemoveProtected( SCROW nStartRow, SCROW nEndRow );
576 SCROW ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray, bool* const pIsChanged );
577 void DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& rMark, bool bBroadcast );
579 void ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark );
580 void ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark );
582 tools::Long GetNeededSize(
583 SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY,
584 const Fraction& rZoomX, const Fraction& rZoomY,
585 bool bWidth, const ScNeededSizeOptions& rOptions, const ScPatternAttr** pPatternChange,
586 bool bInPrintTwips = false ) const;
588 sal_uInt16 GetOptimalColWidth(
589 OutputDevice* pDev, double nPPTX, double nPPTY,
590 const Fraction& rZoomX, const Fraction& rZoomY,
591 bool bFormula, sal_uInt16 nOldWidth, const ScMarkData* pMarkData, const ScColWidthParam* pParam) const;
593 void GetOptimalHeight(
594 sc::RowHeightContext& rCxt, SCROW nStartRow, SCROW nEndRow, sal_uInt16 nMinHeight, SCROW nMinStart );
596 void GetFilterEntries(
597 sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow,
598 ScFilterEntries& rFilterEntries, bool bFiltering );
600 bool GetDataEntries( SCROW nRow, std::set<ScTypedStrData>& rStrings) const;
602 void UpdateInsertTabAbs(SCTAB nNewPos);
603 bool TestTabRefAbs(SCTAB nTable) const;
604 bool GetNextSpellingCell(SCROW& nRow, bool bInSel, const ScMarkData& rData) const;
606 void StartListeningFormulaCells(
607 sc::StartListeningContext& rStartCxt, sc::EndListeningContext& rEndCxt, SCROW nRow1, SCROW nRow2 );
609 void EndListeningFormulaCells(
610 sc::EndListeningContext& rCxt, SCROW nRow1, SCROW nRow2,
611 SCROW* pStartRow, SCROW* pEndRow );
613 void StartListening( SvtListener& rLst, SCROW nRow );
614 void EndListening( SvtListener& rLst, SCROW nRow );
615 void StartListening( sc::StartListeningContext& rCxt, const ScAddress& rAddress, SvtListener& rListener );
616 void EndListening( sc::EndListeningContext& rCxt, const ScAddress& rAddress, SvtListener& rListener );
617 void StartListeners( sc::StartListeningContext& rCxt, bool bAll );
618 void SetDirtyIfPostponed();
619 void BroadcastRecalcOnRefMove();
620 void CollectListeners( std::vector<SvtListener*>& rListeners, SCROW nRow1, SCROW nRow2 );
621 void CollectFormulaCells( std::vector<ScFormulaCell*>& rCells, SCROW nRow1, SCROW nRow2 );
623 void CompileDBFormula( sc::CompileFormulaContext& rCxt );
624 void CompileColRowNameFormula( sc::CompileFormulaContext& rCxt );
626 sal_Int32 GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, rtl_TextEncoding eCharSet ) const;
627 sal_Int32 GetMaxNumberStringLen( sal_uInt16& nPrecision,
628 SCROW nRowStart, SCROW nRowEnd ) const;
630 sal_uInt16 GetTextWidth(SCROW nRow) const;
631 void SetTextWidth(SCROW nRow, sal_uInt16 nWidth);
633 SvtScriptType GetScriptType( SCROW nRow ) const;
636 * Get combined script types of the specified range. This method may
637 * update script types on demand if they have not been determined.
639 SvtScriptType GetRangeScriptType( sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2,
640 const sc::CellStoreType::iterator& itr);
642 void SetScriptType( SCROW nRow, SvtScriptType nType );
643 void UpdateScriptTypes( SCROW nRow1, SCROW nRow2 );
645 formula::FormulaTokenRef ResolveStaticReference( SCROW nRow );
646 bool ResolveStaticReference( ScMatrix& rMat, SCCOL nMatCol, SCROW nRow1, SCROW nRow2 );
647 void FillMatrix( ScMatrix& rMat, size_t nMatCol, SCROW nRow1, SCROW nRow2, svl::SharedStringPool* pPool ) const;
648 formula::VectorRefArray FetchVectorRefArray( SCROW nRow1, SCROW nRow2 );
649 bool HandleRefArrayForParallelism( SCROW nRow1, SCROW nRow2, const ScFormulaCellGroupRef& mxGroup );
650 #ifdef DBG_UTIL
651 void AssertNoInterpretNeeded( SCROW nRow1, SCROW nRow2 );
652 #endif
653 void SetFormulaResults( SCROW nRow, const double* pResults, size_t nLen );
655 void CalculateInThread( ScInterpreterContext& rContext, SCROW nRow, size_t nLen, size_t nOffset,
656 unsigned nThisThread, unsigned nThreadsTotal );
657 void HandleStuffAfterParallelCalculation( SCROW nRow, size_t nLen, ScInterpreter* pInterpreter );
659 void SetNumberFormat( SCROW nRow, sal_uInt32 nNumberFormat );
661 SvtBroadcaster* GetBroadcaster( SCROW nRow );
662 const SvtBroadcaster* GetBroadcaster( SCROW nRow ) const;
664 void DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2 );
665 void PrepareBroadcastersForDestruction();
667 void Broadcast( SCROW nRow );
668 void BroadcastCells( const std::vector<SCROW>& rRows, SfxHintId nHint );
669 void BroadcastRows( SCROW nStartRow, SCROW nEndRow, SfxHintId nHint );
671 // Spaklines
672 sc::SparklineCell* GetSparklineCell(SCROW nRow);
673 void CreateSparklineCell(SCROW nRow, std::shared_ptr<sc::Sparkline> const& pSparkline);
674 void DeleteSparklineCells(sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2);
675 bool DeleteSparkline(SCROW nRow);
676 bool IsSparklinesEmptyBlock(SCROW nStartRow, SCROW nEndRow) const;
677 void CopyCellSparklinesToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol, SCROW nRowOffsetDest = 0) const;
678 void DuplicateSparklines(SCROW nStartRow, size_t nDataSize, ScColumn& rDestCol,
679 sc::ColumnBlockPosition& rDestBlockPos, SCROW nRowOffsetDest = 0) const;
680 bool HasSparklines() const;
681 SCROW GetSparklinesMaxRow() const;
682 SCROW GetSparklinesMinRow() const;
684 // cell notes
685 ScPostIt* GetCellNote( SCROW nRow );
686 const ScPostIt* GetCellNote( SCROW nRow ) const;
687 ScPostIt* GetCellNote( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow );
688 const ScPostIt* GetCellNote( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow ) const;
689 void DeleteCellNotes( sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2, bool bForgetCaptionOwnership );
690 bool HasCellNote(SCROW nStartRow, SCROW nEndRow) const;
691 bool HasCellNotes() const;
692 void SetCellNote( SCROW nRow, std::unique_ptr<ScPostIt> pNote);
693 bool IsNotesEmptyBlock(SCROW nStartRow, SCROW nEndRow) const;
695 std::unique_ptr<ScPostIt> ReleaseNote( SCROW nRow );
696 size_t GetNoteCount() const;
697 void CreateAllNoteCaptions();
698 void ForgetNoteCaptions( SCROW nRow1, SCROW nRow2, bool bPreserveData );
699 SCROW GetNotePosition( size_t nIndex ) const;
700 void GetAllNoteEntries( std::vector<sc::NoteEntry>& rNotes ) const;
701 void GetNotesInRange( SCROW nStartRow, SCROW nEndRow, std::vector<sc::NoteEntry>& rNotes ) const;
703 SCROW GetCellNotesMaxRow() const;
704 SCROW GetCellNotesMinRow() const;
706 void CopyCellNotesToDocument(
707 SCROW nRow1, SCROW nRow2, ScColumn& rDestCol, bool bCloneCaption = true,
708 SCROW nRowOffsetDest = 0) const;
710 void DuplicateNotes(SCROW nStartRow, size_t nDataSize, ScColumn& rDestCol,
711 sc::ColumnBlockPosition& rDestBlockPos, bool bCloneCaption, SCROW nRowOffsetDest = 0) const;
713 void UpdateNoteCaptions( SCROW nRow1, SCROW nRow2 );
715 void UpdateDrawObjects( std::vector<std::vector<SdrObject*>>& pObjects, SCROW nRowStart, SCROW nRowEnd );
716 void UpdateDrawObjectsForRow( std::vector<SdrObject*>& pObjects, SCCOL nTargetCol, SCROW nTargetRow );
717 bool IsDrawObjectsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const;
719 void InterpretDirtyCells( SCROW nRow1, SCROW nRow2 );
720 void InterpretCellsIfNeeded( SCROW nRow1, SCROW nRow2 );
722 static void JoinNewFormulaCell( const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell );
725 * Detach a formula cell that's about to be deleted, or removed from
726 * document storage (if that ever happens).
728 * @param rNewSharedRows collects possible new shared row ranges (top and
729 * bottom of shared or remaining single twice) resulting from
730 * unsharing to reestablish listeners on.
732 void DetachFormulaCell( const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell,
733 std::vector<SCROW>& rNewSharedRows );
735 /** Re-establish listeners on unshared formula groups */
736 void StartListeningUnshared( const std::vector<SCROW>& rNewSharedRows );
738 void DetachFormulaCells( const sc::CellStoreType::position_type& aPos, size_t nLength,
739 std::vector<SCROW>* pNewSharedRows );
741 void AttachFormulaCells( sc::StartListeningContext& rCxt, SCROW nRow1, SCROW nRow2 );
742 void DetachFormulaCells( sc::EndListeningContext& rCxt, SCROW nRow1, SCROW nRow2,
743 std::vector<SCROW>* pNewSharedRows );
746 * Regroup formula cells for the entire column.
748 void RegroupFormulaCells( std::vector<ScAddress>* pGroupPos = nullptr );
751 * Reset column position of formula cells within specified row range.
752 * If bUpdateRefs==true then reference positions are also adjusted to
753 * reflect the new position so that the formula cells still reference the
754 * same cells or ranges after the position change.
755 * The position of a formula cell before the call is interpreted as the old
756 * position of that cell.
758 * Caller needs to ensure that no formula groups cross the top and bottom
759 * row boundaries.
761 * @param nRow1 top row boundary
762 * @param nRow2 bottom row boundary
763 * @param bUpdateRefs whether to adjust references
765 void ResetFormulaCellPositions( SCROW nRow1, SCROW nRow2, bool bUpdateRefs );
767 void SplitFormulaGroupByRelativeRef( const ScRange& rBoundRange );
769 void TransferCellValuesTo( SCROW nRow, size_t nLen, sc::CellValues& rDest );
770 void CopyCellValuesFrom( SCROW nRow, const sc::CellValues& rSrc );
771 void ConvertFormulaToValue(
772 sc::EndListeningContext& rCxt, SCROW nRow1, SCROW nRow2, sc::TableValues* pUndo );
774 void SwapNonEmpty(
775 sc::TableValues& rValues, sc::StartListeningContext& rStartCxt, sc::EndListeningContext& rEndCxt );
777 std::optional<sc::ColumnIterator> GetColumnIterator( SCROW nRow1, SCROW nRow2 ) const;
779 bool EnsureFormulaCellResults( SCROW nRow1, SCROW nRow2, bool bSkipRunning = false );
781 void StoreToCache(SvStream& rStrm) const;
782 void RestoreFromCache(SvStream& rStrm);
784 #if DUMP_COLUMN_STORAGE
785 void DumpColumnStorage() const;
786 #endif
788 SCSIZE GetPatternCount() const;
789 SCSIZE GetPatternCount( SCROW nRow1, SCROW nRow2 ) const;
790 bool ReservePatternCount( SCSIZE nReserve );
792 void CheckIntegrity() const;
794 private:
796 sc::CellStoreType::iterator GetPositionToInsert( SCROW nRow, std::vector<SCROW>& rNewSharedRows,
797 bool bInsertFormula );
798 sc::CellStoreType::iterator GetPositionToInsert( const sc::CellStoreType::iterator& it, SCROW nRow,
799 std::vector<SCROW>& rNewSharedRows, bool bInsertFormula );
801 void AttachNewFormulaCell(
802 const sc::CellStoreType::iterator& itPos, SCROW nRow, ScFormulaCell& rCell,
803 const std::vector<SCROW>& rNewSharedRows,
804 bool bJoin = true, sc::StartListeningType eListenType = sc::SingleCellListening );
806 void AttachNewFormulaCell(
807 const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell,
808 const std::vector<SCROW>& rNewSharedRows,
809 bool bJoin = true, sc::StartListeningType eListenType = sc::SingleCellListening );
811 public:
812 void AttachNewFormulaCells(const sc::CellStoreType::position_type& aPos, size_t nLength,
813 std::vector<SCROW>& rNewSharedRows);
815 private:
816 void BroadcastNewCell( SCROW nRow );
817 bool UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, sc::CellStoreType::iterator& itr );
819 const ScFormulaCell* FetchFormulaCell( SCROW nRow ) const;
821 SCROW FindNextVisibleRowWithContent(
822 sc::CellStoreType::const_iterator& itPos, SCROW nRow, bool bForward) const;
823 SCROW FindNextVisibleRow(SCROW nRow, bool bForward) const;
825 OUString GetString( const ScRefCellValue& cell, SCROW nRow, const ScInterpreterContext* pContext = nullptr ) const;
826 OUString GetInputString( const ScRefCellValue& cell, SCROW nRow, const svl::SharedString** pShared = nullptr ) const;
829 * Called whenever the state of cell array gets modified i.e. new cell
830 * insertion, cell removal or relocation, cell value update and so on.
832 * Call this only from those methods where maCells is modified directly.
834 void CellStorageModified();
835 void CellNotesDeleting(SCROW nRow1, SCROW nRow2, bool bForgetCaptionOwnership );
837 void CopyCellTextAttrsToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol) const;
839 void DeleteCells(
840 sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2, InsertDeleteFlags nDelFlag,
841 sc::SingleColumnSpanSet& rDeleted );
844 * Get all non-grouped formula cells and formula cell groups in the whole
845 * column.
847 std::vector<sc::FormulaGroupEntry> GetFormulaGroupEntries();
849 void EndListeningIntersectedGroup(
850 sc::EndListeningContext& rCxt, SCROW nRow, std::vector<ScAddress>* pGroupPos );
852 void EndListeningIntersectedGroups(
853 sc::EndListeningContext& rCxt, SCROW nRow1, SCROW nRow2, std::vector<ScAddress>* pGroupPos );
855 void EndListeningGroup( sc::EndListeningContext& rCxt, SCROW nRow );
856 void SetNeedsListeningGroup( SCROW nRow );
859 inline bool ScColumn::IsEmptyAttr() const
861 return pAttrArray->IsEmpty();
864 inline bool ScColumnData::IsAllAttrEqual( const ScColumnData& rCol, SCROW nStartRow, SCROW nEndRow ) const
866 return pAttrArray->IsAllEqual( *rCol.pAttrArray, nStartRow, nEndRow );
869 inline bool ScColumn::IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const
871 return pAttrArray->IsVisibleEqual( *rCol.pAttrArray, nStartRow, nEndRow );
874 inline bool ScColumn::GetFirstVisibleAttr( SCROW& rFirstRow ) const
876 return pAttrArray->GetFirstVisibleAttr( rFirstRow );
879 inline bool ScColumn::GetLastVisibleAttr( SCROW& rLastRow ) const
881 // row of last cell is needed
882 SCROW nLastData = GetLastDataPos(); // always including notes, 0 if none
883 return pAttrArray->GetLastVisibleAttr( rLastRow, nLastData );
886 inline bool ScColumn::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const
888 return pAttrArray->HasVisibleAttrIn( nStartRow, nEndRow );
891 inline SCSIZE ScColumn::GetPatternCount() const
893 return pAttrArray->Count();
896 inline SCSIZE ScColumn::GetPatternCount( SCROW nRow1, SCROW nRow2 ) const
898 return pAttrArray->Count( nRow1, nRow2 );
901 inline bool ScColumn::ReservePatternCount( SCSIZE nReserve )
903 return pAttrArray && pAttrArray->Reserve( nReserve );
906 inline bool ScColumn::IsMerged( SCROW nRow ) const
908 return pAttrArray->IsMerged(nRow);
911 inline SCROW ScColumnData::GetNextUnprotected( SCROW nRow, bool bUp ) const
913 return pAttrArray->GetNextUnprotected(nRow, bUp);
916 inline bool ScColumnData::HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) const
918 return pAttrArray->HasAttrib( nRow1, nRow2, nMask );
921 inline bool ScColumnData::HasAttrib( SCROW nRow, HasAttrFlags nMask, SCROW* nStartRow, SCROW* nEndRow ) const
923 return pAttrArray->HasAttrib( nRow, nMask, nStartRow, nEndRow );
926 inline bool ScColumn::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
927 SCCOL& rPaintCol, SCROW& rPaintRow,
928 bool bRefresh )
930 return pAttrArray->ExtendMerge( nThisCol, nStartRow, nEndRow, rPaintCol, rPaintRow, bRefresh );
933 inline void ScColumnData::MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW nRow2, bool bDeep ) const
935 pAttrArray->MergePatternArea( nRow1, nRow2, rState, bDeep );
938 inline void ScColumn::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
939 ScLineFlags& rFlags,
940 SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight ) const
942 pAttrArray->MergeBlockFrame( pLineOuter, pLineInner, rFlags, nStartRow, nEndRow, bLeft, nDistRight );
945 inline void ScColumn::ApplyBlockFrame(const SvxBoxItem& rLineOuter, const SvxBoxInfoItem* pLineInner,
946 SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight)
948 pAttrArray->ApplyBlockFrame(rLineOuter, pLineInner, nStartRow, nEndRow, bLeft, nDistRight);
951 inline const ScPatternAttr* ScColumnData::GetPattern( SCROW nRow ) const
953 return pAttrArray->GetPattern( nRow );
956 inline const SfxPoolItem& ScColumnData::GetAttr( SCROW nRow, sal_uInt16 nWhich ) const
958 return pAttrArray->GetPattern( nRow )->GetItemSet().Get(nWhich);
961 inline const SfxPoolItem& ScColumnData::GetAttr( SCROW nRow, sal_uInt16 nWhich, SCROW& nStartRow, SCROW& nEndRow ) const
963 return pAttrArray->GetPatternRange( nStartRow, nEndRow, nRow )->GetItemSet().Get(nWhich);
966 inline sal_uInt32 ScColumnData::GetNumberFormat( const ScInterpreterContext& rContext, SCROW nRow ) const
968 return pAttrArray->GetPattern( nRow )->GetNumberFormat( rContext.GetFormatTable() );
971 inline void ScColumn::AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex )
973 pAttrArray->AddCondFormat( nStartRow, nEndRow, nIndex );
976 inline void ScColumn::RemoveCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex )
978 pAttrArray->RemoveCondFormat( nStartRow, nEndRow, nIndex );
981 inline void ScColumnData::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleSheet& rStyle )
983 pAttrArray->ApplyStyleArea(nStartRow, nEndRow, rStyle);
986 inline const ScStyleSheet* ScColumnData::GetStyle( SCROW nRow ) const
988 return pAttrArray->GetPattern( nRow )->GetStyleSheet();
991 inline void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset )
993 pAttrArray->FindStyleSheet( pStyleSheet, rUsedRows, bReset );
996 inline bool ScColumn::IsStyleSheetUsed( const ScStyleSheet& rStyle ) const
998 return pAttrArray->IsStyleSheetUsed( rStyle );
1001 inline bool ScColumn::ApplyFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags )
1003 return pAttrArray->ApplyFlags( nStartRow, nEndRow, nFlags );
1006 inline bool ScColumn::RemoveFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags )
1008 return pAttrArray->RemoveFlags( nStartRow, nEndRow, nFlags );
1011 inline void ScColumn::ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWhich )
1013 pAttrArray->ClearItems( nStartRow, nEndRow, pWhich );
1016 inline const ScPatternAttr* ScColumn::SetPattern( SCROW nRow, std::unique_ptr<ScPatternAttr> pPatAttr )
1018 return pAttrArray->SetPattern( nRow, std::move(pPatAttr), true/*bPutToPool*/ );
1021 inline void ScColumn::SetPattern( SCROW nRow, const ScPatternAttr& rPatAttr )
1023 pAttrArray->SetPattern( nRow, &rPatAttr, true/*bPutToPool*/ );
1026 inline void ScColumn::SetPatternArea( SCROW nStartRow, SCROW nEndRow,
1027 const ScPatternAttr& rPatAttr )
1029 pAttrArray->SetPatternArea( nStartRow, nEndRow, &rPatAttr, true/*bPutToPool*/ );
1032 inline void ScColumnData::SetAttrEntries(std::vector<ScAttrEntry> && vNewData)
1034 pAttrArray->SetAttrEntries( std::move( vNewData ));
1037 inline bool ScColumnData::TestInsertRow( SCSIZE nSize ) const
1039 return pAttrArray->TestInsertRow( nSize );
1042 inline void ScColumnData::InsertRow( SCROW nStartRow, SCSIZE nSize )
1044 pAttrArray->InsertRow( nStartRow, nSize );
1047 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */