Avoid potential negative array index access to cached text.
[LibreOffice.git] / sc / inc / conditio.hxx
blobba5e0289bab837a26bbe3919d7a5132867d26dfa
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 <tools/solar.h>
23 #include <tools/color.hxx>
24 #include "address.hxx"
25 #include <formula/grammar.hxx>
26 #include "scdllapi.h"
27 #include "rangelst.hxx"
28 #include "tokenarray.hxx"
30 #include <svl/listener.hxx>
32 #include <com/sun/star/sheet/ConditionOperator.hpp>
34 #include <rtl/math.hxx>
35 #include <tools/date.hxx>
36 #include <tools/link.hxx>
38 #include <optional>
39 #include <map>
40 #include <memory>
41 #include <set>
43 class RepaintInIdle;
44 class ScFormulaCell;
45 class ScTokenArray;
46 struct ScRefCellValue;
48 namespace sc {
50 struct RefUpdateContext;
51 struct RefUpdateInsertTabContext;
52 struct RefUpdateDeleteTabContext;
53 struct RefUpdateMoveTabContext;
57 // nOptions Flags
58 #define SC_COND_NOBLANKS 1
60 enum class ScConditionMode
62 Equal,
63 Less,
64 Greater,
65 EqLess,
66 EqGreater,
67 NotEqual,
68 Between,
69 NotBetween,
70 Duplicate,
71 NotDuplicate,
72 Direct,
73 Top10,
74 Bottom10,
75 TopPercent,
76 BottomPercent,
77 AboveAverage,
78 BelowAverage,
79 AboveEqualAverage,
80 BelowEqualAverage,
81 Error,
82 NoError,
83 BeginsWith,
84 EndsWith,
85 ContainsText,
86 NotContainsText,
87 NONE
90 // For use in SAL_DEBUG etc. Output format not guaranteed to be stable.
91 template<typename charT, typename traits>
92 inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> & stream, const ScConditionMode& rMode)
94 switch (rMode)
96 case ScConditionMode::Equal:
97 stream << "EQUAL";
98 break;
99 case ScConditionMode::Less:
100 stream << "LESS";
101 break;
102 case ScConditionMode::Greater:
103 stream << "GREATER";
104 break;
105 case ScConditionMode::EqLess:
106 stream << "EQLESS";
107 break;
108 case ScConditionMode::EqGreater:
109 stream << "EQGREATER";
110 break;
111 case ScConditionMode::NotEqual:
112 stream << "NOTEQUAL";
113 break;
114 case ScConditionMode::Between:
115 stream << "BETWEEN";
116 break;
117 case ScConditionMode::NotBetween:
118 stream << "NOTBETWEEN";
119 break;
120 case ScConditionMode::Duplicate:
121 stream << "DUPLICATE";
122 break;
123 case ScConditionMode::NotDuplicate:
124 stream << "NOTDUPLICATE";
125 break;
126 case ScConditionMode::Direct:
127 stream << "DIRECT";
128 break;
129 case ScConditionMode::Top10:
130 stream << "TOP10";
131 break;
132 case ScConditionMode::Bottom10:
133 stream << "BOTTOM10";
134 break;
135 case ScConditionMode::TopPercent:
136 stream << "TOPPERCENT";
137 break;
138 case ScConditionMode::BottomPercent:
139 stream << "BOTTOMPERCENT";
140 break;
141 case ScConditionMode::AboveAverage:
142 stream << "ABOVEAVERAGE";
143 break;
144 case ScConditionMode::BelowAverage:
145 stream << "BELOWAVERAGE";
146 break;
147 case ScConditionMode::AboveEqualAverage:
148 stream << "ABOVEEQUALAVERAGE";
149 break;
150 case ScConditionMode::BelowEqualAverage:
151 stream << "BELOWEQUALAVERAGE";
152 break;
153 case ScConditionMode::Error:
154 stream << "ERROR";
155 break;
156 case ScConditionMode::NoError:
157 stream << "NOERROR";
158 break;
159 case ScConditionMode::BeginsWith:
160 stream << "BEGINSWITH";
161 break;
162 case ScConditionMode::EndsWith:
163 stream << "ENDSWITH";
164 break;
165 case ScConditionMode::ContainsText:
166 stream << "CONTAINSTEXT";
167 break;
168 case ScConditionMode::NotContainsText:
169 stream << "NOTCONTAINSTEXT";
170 break;
171 case ScConditionMode::NONE:
172 stream << "NONE";
173 break;
174 default:
175 stream << "?(" << static_cast<int>(rMode) << ")";
176 break;
179 return stream;
182 class ScFormulaListener final : public SvtListener
184 private:
185 mutable bool mbDirty;
186 ScDocument& mrDoc;
187 std::function<void()> maCallbackFunction;
189 void startListening(const ScTokenArray* pTokens, const ScRange& rPos);
190 void startListening(const ScRangeList& rPos);
192 public:
193 explicit ScFormulaListener(ScFormulaCell* pCell);
194 explicit ScFormulaListener(ScDocument& rDoc);
195 explicit ScFormulaListener(ScDocument& rDoc, const ScRangeList& rRange);
196 virtual ~ScFormulaListener() override;
198 void Notify( const SfxHint& rHint ) override;
200 bool NeedsRepaint() const;
202 void addTokenArray(const ScTokenArray* pTokens, const ScRange& rRange);
203 void stopListening();
204 void setCallback(const std::function<void()>& aCallbackFunction);
208 class ScConditionalFormat;
209 struct ScDataBarInfo;
210 struct ScIconSetInfo;
212 struct SC_DLLPUBLIC ScCondFormatData
214 ScCondFormatData();
215 ScCondFormatData(ScCondFormatData&&);
216 ~ScCondFormatData();
218 std::optional<Color> mxColorScale;
219 std::unique_ptr<ScDataBarInfo> pDataBar;
220 std::unique_ptr<ScIconSetInfo> pIconSet;
221 OUString aStyleName;
224 class SC_DLLPUBLIC ScFormatEntry
226 public:
227 ScFormatEntry(ScDocument* pDoc);
228 virtual ~ScFormatEntry() {}
230 enum class Type
232 Condition,
233 ExtCondition,
234 Colorscale,
235 Databar,
236 Iconset,
237 Date
240 virtual Type GetType() const = 0;
241 virtual void UpdateReference( sc::RefUpdateContext& rCxt ) = 0;
242 virtual void UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt ) = 0;
243 virtual void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt ) = 0;
244 virtual void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt ) = 0;
246 virtual ScFormatEntry* Clone( ScDocument* pDoc ) const = 0;
248 virtual void SetParent( ScConditionalFormat* pNew ) = 0;
250 bool operator==( const ScFormatEntry& ) const;
251 virtual bool IsEqual( const ScFormatEntry&, bool bIgnoreSrcPos ) const;
253 virtual void startRendering();
254 virtual void endRendering();
255 virtual void updateValues();
256 protected:
257 ScDocument* mpDoc;
261 template<typename charT, typename traits>
262 inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> & stream, const ScFormatEntry::Type& rType)
264 switch (rType)
266 case ScFormatEntry::Type::Condition:
267 stream << "Condition";
268 break;
269 case ScFormatEntry::Type::ExtCondition:
270 stream << "ExtCondition";
271 break;
272 case ScFormatEntry::Type::Colorscale:
273 stream << "Colorscale";
274 break;
275 case ScFormatEntry::Type::Databar:
276 stream << "Databar";
277 break;
278 case ScFormatEntry::Type::Iconset:
279 stream << "Iconset";
280 break;
281 case ScFormatEntry::Type::Date:
282 stream << "Date";
283 break;
284 default:
285 stream << "?(" << static_cast<int>(rType) << ")";
286 break;
288 return stream;
291 class approx_less
293 public:
294 bool operator() (double nVal1, double nVal2) const
296 if(nVal1 < nVal2 && !rtl::math::approxEqual(nVal1, nVal2))
297 return true;
299 return false;
303 class SC_DLLPUBLIC ScConditionEntry : public ScFormatEntry
305 // stored data:
306 ScConditionMode eOp;
307 sal_uInt16 nOptions;
308 double nVal1; // input or calculated
309 double nVal2;
310 OUString aStrVal1; // input or calculated
311 OUString aStrVal2;
312 const OUString aStrNmsp1; // namespace to be used on (re)compilation, e.g. in XML import
313 const OUString aStrNmsp2; // namespace to be used on (re)compilation, e.g. in XML import
314 const formula::FormulaGrammar::Grammar eTempGrammar1; // grammar to be used on (re)compilation, e.g. in XML import
315 const formula::FormulaGrammar::Grammar eTempGrammar2; // grammar to be used on (re)compilation, e.g. in XML import
316 bool bIsStr1; // for recognition of empty strings
317 bool bIsStr2;
318 std::unique_ptr<ScTokenArray> pFormula1; // entered formula
319 std::unique_ptr<ScTokenArray> pFormula2;
320 ScAddress aSrcPos; // source position for formulas
321 // temporary data:
322 OUString aSrcString; // formula source position as text during XML import
323 std::unique_ptr<ScFormulaCell> pFCell1;
324 std::unique_ptr<ScFormulaCell> pFCell2;
325 bool bRelRef1;
326 bool bRelRef2;
327 bool bFirstRun;
328 std::unique_ptr<ScFormulaListener> mpListener;
329 Type eConditionType; //It can be Condition or ExtCondition
331 static void SimplifyCompiledFormula( std::unique_ptr<ScTokenArray>& rFormula,
332 double& rVal,
333 bool& rIsStr,
334 OUString& rStrVal );
336 void MakeCells( const ScAddress& rPos );
337 void Compile( const OUString& rExpr1, const OUString& rExpr2,
338 const OUString& rExprNmsp1, const OUString& rExprNmsp2,
339 formula::FormulaGrammar::Grammar eGrammar1,
340 formula::FormulaGrammar::Grammar eGrammar2,
341 bool bTextToReal );
342 void Interpret( const ScAddress& rPos );
344 bool IsValid( double nArg, const ScAddress& rPos ) const;
345 bool IsValidStr( const OUString& rArg, const ScAddress& rPos ) const;
346 void StartListening();
348 public:
349 ScConditionEntry( ScConditionMode eOper,
350 const OUString& rExpr1, const OUString& rExpr2,
351 ScDocument& rDocument, const ScAddress& rPos,
352 const OUString& rExprNmsp1, const OUString& rExprNmsp2,
353 formula::FormulaGrammar::Grammar eGrammar1,
354 formula::FormulaGrammar::Grammar eGrammar2,
355 Type eType = Type::Condition );
356 ScConditionEntry( ScConditionMode eOper,
357 const ScTokenArray* pArr1, const ScTokenArray* pArr2,
358 ScDocument& rDocument, const ScAddress& rPos );
359 ScConditionEntry( const ScConditionEntry& r ); // flat copy of formulas
360 // true copy of formulas (for Ref-Undo):
361 ScConditionEntry( ScDocument& rDocument, const ScConditionEntry& r );
362 virtual ~ScConditionEntry() override;
364 bool IsEqual( const ScFormatEntry& r, bool bIgnoreSrcPos ) const override;
366 virtual void SetParent( ScConditionalFormat* pNew ) override;
368 bool IsCellValid( ScRefCellValue& rCell, const ScAddress& rPos ) const;
370 ScConditionMode GetOperation() const { return eOp; }
371 void SetOperation(ScConditionMode eMode);
372 bool IsIgnoreBlank() const { return ( nOptions & SC_COND_NOBLANKS ) == 0; }
373 void SetIgnoreBlank(bool bSet);
374 const OUString& GetSrcString() const { return aSrcString; }
375 const ScAddress& GetSrcPos() const { return aSrcPos; }
377 ScAddress GetValidSrcPos() const; // adjusted to allow textual representation of expressions
379 void SetSrcString( const OUString& rNew ); // for XML import
381 void SetFormula1( const ScTokenArray& rArray );
382 void SetFormula2( const ScTokenArray& rArray );
384 OUString GetExpression( const ScAddress& rCursor, sal_uInt16 nPos, sal_uInt32 nNumFmt = 0,
385 const formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
387 /** Create a flat copy using ScTokenArray copy-ctor with
388 shared tokens. */
389 std::unique_ptr<ScTokenArray> CreateFlatCopiedTokenArray( sal_uInt16 nPos ) const;
391 void CompileAll();
392 void CompileXML();
393 virtual void UpdateReference( sc::RefUpdateContext& rCxt ) override;
394 virtual void UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt ) override;
395 virtual void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt ) override;
396 virtual void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt ) override;
398 bool MarkUsedExternalReferences() const;
400 virtual Type GetType() const override { return eConditionType; }
402 virtual ScFormatEntry* Clone(ScDocument* pDoc) const override;
404 static ScConditionMode GetModeFromApi(css::sheet::ConditionOperator nOperator);
406 virtual void endRendering() override;
407 virtual void startRendering() override;
409 bool NeedsRepaint() const;
410 void CalcAll();
412 protected:
413 virtual void DataChanged() const;
414 ScDocument* GetDocument() const { return mpDoc; }
415 ScConditionalFormat* pCondFormat;
417 private:
419 bool IsDuplicate(double nArg, const OUString& rStr) const;
420 bool IsTopNElement( double nArg ) const;
421 bool IsTopNPercent( double nArg ) const;
422 bool IsBottomNElement( double nArg ) const;
423 bool IsBottomNPercent( double nArg ) const;
424 bool IsAboveAverage( double nArg, bool bEqual ) const;
425 bool IsBelowAverage( double nArg, bool bEqual ) const;
427 bool IsError( const ScAddress& rPos ) const;
429 void FillCache() const;
431 struct ScConditionEntryCache
433 typedef std::map<OUString, sal_Int32> StringCacheType;
434 StringCacheType maStrings;
435 typedef std::map<double, sal_Int32, approx_less> ValueCacheType;
436 ValueCacheType maValues;
438 // cache them for easier access
439 size_t nValueItems;
441 ScConditionEntryCache():
442 nValueItems(0) {}
445 mutable std::unique_ptr<ScConditionEntryCache> mpCache;
447 std::unique_ptr<RepaintInIdle> mpRepaintTask;
450 // single condition entry for conditional formatting
451 class SC_DLLPUBLIC ScCondFormatEntry final : public ScConditionEntry
453 OUString aStyleName;
454 Type eCondFormatType = Type::Condition;
456 public:
457 ScCondFormatEntry( ScConditionMode eOper,
458 const OUString& rExpr1, const OUString& rExpr2,
459 ScDocument& rDocument, const ScAddress& rPos,
460 OUString aStyle,
461 const OUString& rExprNmsp1 = OUString(),
462 const OUString& rExprNmsp2 = OUString(),
463 formula::FormulaGrammar::Grammar eGrammar1 = formula::FormulaGrammar::GRAM_DEFAULT,
464 formula::FormulaGrammar::Grammar eGrammar2 = formula::FormulaGrammar::GRAM_DEFAULT,
465 Type eType = Type::Condition);
466 ScCondFormatEntry( ScConditionMode eOper,
467 const ScTokenArray* pArr1, const ScTokenArray* pArr2,
468 ScDocument& rDocument, const ScAddress& rPos,
469 OUString aStyle );
470 ScCondFormatEntry( const ScCondFormatEntry& r );
471 ScCondFormatEntry( ScDocument& rDocument, const ScCondFormatEntry& r );
472 virtual ~ScCondFormatEntry() override;
474 bool IsEqual( const ScFormatEntry& r, bool bIgnoreSrcPos ) const override;
476 const OUString& GetStyle() const { return aStyleName; }
477 void UpdateStyleName(const OUString& rNew) { aStyleName=rNew; }
478 virtual ScFormatEntry* Clone(ScDocument* pDoc) const override;
479 virtual Type GetType() const override { return eCondFormatType; }
481 private:
482 virtual void DataChanged() const override;
485 namespace condformat {
487 enum ScCondFormatDateType
489 TODAY,
490 YESTERDAY,
491 TOMORROW,
492 LAST7DAYS,
493 THISWEEK,
494 LASTWEEK,
495 NEXTWEEK,
496 THISMONTH,
497 LASTMONTH,
498 NEXTMONTH,
499 THISYEAR,
500 LASTYEAR,
501 NEXTYEAR
506 class SC_DLLPUBLIC ScCondDateFormatEntry final : public ScFormatEntry
508 public:
509 ScCondDateFormatEntry(ScDocument* pDoc);
510 ScCondDateFormatEntry(ScDocument* pDoc, const ScCondDateFormatEntry& rEntry);
512 bool IsValid( const ScAddress& rPos ) const;
514 void SetDateType(condformat::ScCondFormatDateType eType);
515 condformat::ScCondFormatDateType GetDateType() const { return meType;}
517 const OUString& GetStyleName() const { return maStyleName;}
518 void SetStyleName( const OUString& rStyleName );
520 virtual Type GetType() const override { return Type::Date; }
521 virtual void UpdateReference( sc::RefUpdateContext& ) override {}
522 virtual void UpdateInsertTab( sc::RefUpdateInsertTabContext& ) override {}
523 virtual void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& ) override {}
524 virtual void UpdateMoveTab( sc::RefUpdateMoveTabContext& ) override {}
526 virtual ScFormatEntry* Clone( ScDocument* pDoc ) const override;
528 virtual void SetParent( ScConditionalFormat* ) override {}
530 virtual void startRendering() override;
531 virtual void endRendering() override;
533 private:
534 condformat::ScCondFormatDateType meType;
536 mutable std::unique_ptr<Date> mpCache;
538 OUString maStyleName;
541 class ScColorFormatCache final : public SvtListener
543 private:
544 ScDocument& mrDoc;
546 public:
547 explicit ScColorFormatCache(ScDocument& rDoc, const ScRangeList& rRanges);
548 virtual ~ScColorFormatCache() override;
550 void Notify( const SfxHint& rHint ) override;
552 std::vector<double> maValues;
555 // complete conditional formatting
556 class SC_DLLPUBLIC ScConditionalFormat
558 ScDocument* pDoc;
559 sal_uInt32 nKey; // Index in attributes
561 std::vector<std::unique_ptr<ScFormatEntry>> maEntries;
562 ScRangeList maRanges; // Ranges for conditional format
564 mutable std::unique_ptr<ScColorFormatCache> mpCache;
566 public:
567 ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocument);
568 ~ScConditionalFormat();
569 ScConditionalFormat(const ScConditionalFormat&) = delete;
570 const ScConditionalFormat& operator=(const ScConditionalFormat&) = delete;
572 // true copy of formulas (for Ref-Undo / between documents)
573 std::unique_ptr<ScConditionalFormat> Clone(ScDocument* pNewDoc = nullptr) const;
575 void AddEntry( ScFormatEntry* pNew );
576 void RemoveEntry(size_t nIndex);
577 void SetRange( const ScRangeList& rRanges );
578 const ScRangeList& GetRange() const { return maRanges; }
579 // don't use the same name as for the const version
580 ScRangeList& GetRangeList() { return maRanges; }
582 bool IsEmpty() const;
583 size_t size() const;
585 ScDocument* GetDocument();
587 void CompileAll();
588 void CompileXML();
589 void UpdateReference( sc::RefUpdateContext& rCxt, bool bCopyAsMove = false );
590 void UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt );
591 void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt );
592 void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt );
594 void InsertRow(SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW nRowStart, SCSIZE nSize);
595 void InsertCol(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, SCCOL nColStart, SCSIZE nSize);
597 void DeleteArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
598 void RenameCellStyle( std::u16string_view rOld, const OUString& rNew );
600 const ScFormatEntry* GetEntry( sal_uInt16 nPos ) const;
602 OUString GetCellStyle( ScRefCellValue& rCell, const ScAddress& rPos ) const;
604 ScCondFormatData GetData( ScRefCellValue& rCell, const ScAddress& rPos ) const;
606 bool EqualEntries( const ScConditionalFormat& r, bool bIgnoreSrcPos = false ) const;
608 void DoRepaint();
610 sal_uInt32 GetKey() const { return nKey; }
611 void SetKey(sal_uInt32 nNew) { nKey = nNew; } // only if not inserted!
613 bool MarkUsedExternalReferences() const;
615 // sorted (via std::set) by Index
616 bool operator < ( const ScConditionalFormat& r ) const { return nKey < r.nKey; }
618 void startRendering();
619 void endRendering();
621 void updateValues();
623 // Forced recalculation for formulas
624 void CalcAll();
626 void ResetCache() const;
627 void SetCache(const std::vector<double>& aValues) const;
628 std::vector<double>* GetCache() const;
631 class RepaintInIdle final : public Idle
633 ScConditionalFormat* mpCondFormat;
635 public:
636 RepaintInIdle(ScConditionalFormat* pCondFormat)
637 : Idle("Conditional Format Repaint Idle")
638 , mpCondFormat(pCondFormat)
641 void Invoke() override
643 if (mpCondFormat)
644 mpCondFormat->DoRepaint();
648 struct CompareScConditionalFormat
650 using is_transparent = void;
651 bool operator()(std::unique_ptr<ScConditionalFormat> const& lhs,
652 std::unique_ptr<ScConditionalFormat> const& rhs) const
654 return (*lhs) < (*rhs);
656 bool operator()(sal_uInt32 nKey, std::unique_ptr<ScConditionalFormat> const& rpFormat) const
658 return nKey < rpFormat->GetKey();
660 bool operator()(std::unique_ptr<ScConditionalFormat> const& rpFormat, sal_uInt32 nKey) const
662 return rpFormat->GetKey() < nKey;
666 // List of all conditional formats in a sheet
667 class SC_DLLPUBLIC ScConditionalFormatList
669 private:
670 typedef std::set<std::unique_ptr<ScConditionalFormat>,
671 CompareScConditionalFormat> ConditionalFormatContainer;
672 ConditionalFormatContainer m_ConditionalFormats;
674 void operator =(ScConditionalFormatList const &) = delete;
676 public:
677 ScConditionalFormatList() {}
678 ScConditionalFormatList(const ScConditionalFormatList& rList);
679 ScConditionalFormatList(ScDocument& rDoc, const ScConditionalFormatList& rList);
681 void InsertNew( std::unique_ptr<ScConditionalFormat> pNew );
684 * Checks that all cond formats have a non empty range.
685 * Deletes empty cond formats. Optionally call rLink
686 * on the empty format before deleting it.
687 * @return true if all cond formats were valid
689 bool CheckAllEntries(const Link<ScConditionalFormat*,void>& rLink = Link<ScConditionalFormat*,void>());
691 ScConditionalFormat* GetFormat( sal_uInt32 nKey );
692 const ScConditionalFormat* GetFormat( sal_uInt32 nKey ) const;
694 void CompileAll();
695 void CompileXML();
696 void UpdateReference( sc::RefUpdateContext& rCxt );
697 void UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt );
698 void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt );
699 void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt );
701 void InsertRow(SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW nRowStart, SCSIZE nSize);
702 void InsertCol(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, SCCOL nColStart, SCSIZE nSize);
704 void RenameCellStyle( std::u16string_view rOld, const OUString& rNew );
705 void DeleteArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
707 typedef ConditionalFormatContainer::iterator iterator;
708 typedef ConditionalFormatContainer::const_iterator const_iterator;
710 ScRangeList GetCombinedRange() const;
712 void RemoveFromDocument(ScDocument& rDoc) const;
713 void AddToDocument(ScDocument& rDoc) const;
715 iterator begin();
716 const_iterator begin() const;
717 iterator end();
718 const_iterator end() const;
720 size_t size() const;
721 bool empty() const;
723 void erase(sal_uLong nIndex);
724 void clear();
726 void startRendering();
727 void endRendering();
729 void updateValues();
731 sal_uInt32 getMaxKey() const;
733 /// Forced recalculation of formulas
734 void CalcAll();
737 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */