nss: upgrade to release 3.73
[LibreOffice.git] / sc / inc / conditio.hxx
blobb3caae236efbdf899734aee21cb8f4b33a8c5d67
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 #ifndef INCLUDED_SC_INC_CONDITIO_HXX
21 #define INCLUDED_SC_INC_CONDITIO_HXX
23 #include "global.hxx"
24 #include <tools/solar.h>
25 #include <tools/color.hxx>
26 #include "address.hxx"
27 #include <formula/grammar.hxx>
28 #include "scdllapi.h"
29 #include "rangelst.hxx"
30 #include "tokenarray.hxx"
32 #include <svl/listener.hxx>
34 #include <com/sun/star/sheet/ConditionOperator.hpp>
36 #include <rtl/math.hxx>
37 #include <tools/date.hxx>
38 #include <tools/link.hxx>
40 #include <optional>
41 #include <map>
42 #include <memory>
43 #include <set>
45 class ScFormulaCell;
46 class ScTokenArray;
47 struct ScRefCellValue;
49 namespace sc {
51 struct RefUpdateContext;
52 struct RefUpdateInsertTabContext;
53 struct RefUpdateDeleteTabContext;
54 struct RefUpdateMoveTabContext;
58 // nOptions Flags
59 #define SC_COND_NOBLANKS 1
61 enum class ScConditionMode
63 Equal,
64 Less,
65 Greater,
66 EqLess,
67 EqGreater,
68 NotEqual,
69 Between,
70 NotBetween,
71 Duplicate,
72 NotDuplicate,
73 Direct,
74 Top10,
75 Bottom10,
76 TopPercent,
77 BottomPercent,
78 AboveAverage,
79 BelowAverage,
80 AboveEqualAverage,
81 BelowEqualAverage,
82 Error,
83 NoError,
84 BeginsWith,
85 EndsWith,
86 ContainsText,
87 NotContainsText,
88 NONE
91 // For use in SAL_DEBUG etc. Output format not guaranteed to be stable.
92 template<typename charT, typename traits>
93 inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> & stream, const ScConditionMode& rMode)
95 switch (rMode)
97 case ScConditionMode::Equal:
98 stream << "EQUAL";
99 break;
100 case ScConditionMode::Less:
101 stream << "LESS";
102 break;
103 case ScConditionMode::Greater:
104 stream << "GREATER";
105 break;
106 case ScConditionMode::EqLess:
107 stream << "EQLESS";
108 break;
109 case ScConditionMode::EqGreater:
110 stream << "EQGREATER";
111 break;
112 case ScConditionMode::NotEqual:
113 stream << "NOTEQUAL";
114 break;
115 case ScConditionMode::Between:
116 stream << "BETWEEN";
117 break;
118 case ScConditionMode::NotBetween:
119 stream << "NOTBETWEEN";
120 break;
121 case ScConditionMode::Duplicate:
122 stream << "DUPLICATE";
123 break;
124 case ScConditionMode::NotDuplicate:
125 stream << "NOTDUPLICATE";
126 break;
127 case ScConditionMode::Direct:
128 stream << "DIRECT";
129 break;
130 case ScConditionMode::Top10:
131 stream << "TOP10";
132 break;
133 case ScConditionMode::Bottom10:
134 stream << "BOTTOM10";
135 break;
136 case ScConditionMode::TopPercent:
137 stream << "TOPPERCENT";
138 break;
139 case ScConditionMode::BottomPercent:
140 stream << "BOTTOMPERCENT";
141 break;
142 case ScConditionMode::AboveAverage:
143 stream << "ABOVEAVERAGE";
144 break;
145 case ScConditionMode::BelowAverage:
146 stream << "BELOWAVERAGE";
147 break;
148 case ScConditionMode::AboveEqualAverage:
149 stream << "ABOVEEQUALAVERAGE";
150 break;
151 case ScConditionMode::BelowEqualAverage:
152 stream << "BELOWEQUALAVERAGE";
153 break;
154 case ScConditionMode::Error:
155 stream << "ERROR";
156 break;
157 case ScConditionMode::NoError:
158 stream << "NOERROR";
159 break;
160 case ScConditionMode::BeginsWith:
161 stream << "BEGINSWITH";
162 break;
163 case ScConditionMode::EndsWith:
164 stream << "ENDSWITH";
165 break;
166 case ScConditionMode::ContainsText:
167 stream << "CONTAINSTEXT";
168 break;
169 case ScConditionMode::NotContainsText:
170 stream << "NOTCONTAINSTEXT";
171 break;
172 case ScConditionMode::NONE:
173 stream << "NONE";
174 break;
175 default:
176 stream << "?(" << static_cast<int>(rMode) << ")";
177 break;
180 return stream;
183 class ScFormulaListener final : public SvtListener
185 private:
186 mutable bool mbDirty;
187 ScDocument& mrDoc;
188 std::function<void()> maCallbackFunction;
190 void startListening(const ScTokenArray* pTokens, const ScRange& rPos);
191 void startListening(const ScRangeList& rPos);
193 public:
194 explicit ScFormulaListener(ScFormulaCell* pCell);
195 explicit ScFormulaListener(ScDocument& rDoc);
196 explicit ScFormulaListener(ScDocument& rDoc, const ScRangeList& rRange);
197 virtual ~ScFormulaListener() override;
199 void Notify( const SfxHint& rHint ) override;
201 bool NeedsRepaint() const;
203 void addTokenArray(const ScTokenArray* pTokens, const ScRange& rRange);
204 void stopListening();
205 void setCallback(const std::function<void()>& aCallbackFunction);
209 class ScConditionalFormat;
210 struct ScDataBarInfo;
211 struct ScIconSetInfo;
213 struct ScCondFormatData
215 ScCondFormatData();
216 ScCondFormatData(ScCondFormatData&&);
217 ~ScCondFormatData();
219 std::optional<Color> mxColorScale;
220 std::unique_ptr<ScDataBarInfo> pDataBar;
221 std::unique_ptr<ScIconSetInfo> pIconSet;
222 OUString aStyleName;
225 class SC_DLLPUBLIC ScFormatEntry
227 public:
228 ScFormatEntry(ScDocument* pDoc);
229 virtual ~ScFormatEntry() {}
231 enum class Type
233 Condition,
234 ExtCondition,
235 Colorscale,
236 Databar,
237 Iconset,
238 Date
241 virtual Type GetType() const = 0;
242 virtual void UpdateReference( sc::RefUpdateContext& rCxt ) = 0;
243 virtual void UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt ) = 0;
244 virtual void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt ) = 0;
245 virtual void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt ) = 0;
247 virtual ScFormatEntry* Clone( ScDocument* pDoc ) const = 0;
249 virtual void SetParent( ScConditionalFormat* pNew ) = 0;
251 bool operator==( const ScFormatEntry& ) const;
252 virtual bool IsEqual( const ScFormatEntry&, bool bIgnoreSrcPos ) const;
254 virtual void startRendering();
255 virtual void endRendering();
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;
448 // single condition entry for conditional formatting
449 class SC_DLLPUBLIC ScCondFormatEntry final : public ScConditionEntry
451 OUString aStyleName;
452 Type eCondFormatType = Type::Condition;
454 public:
455 ScCondFormatEntry( ScConditionMode eOper,
456 const OUString& rExpr1, const OUString& rExpr2,
457 ScDocument& rDocument, const ScAddress& rPos,
458 const OUString& rStyle,
459 const OUString& rExprNmsp1 = EMPTY_OUSTRING,
460 const OUString& rExprNmsp2 = EMPTY_OUSTRING,
461 formula::FormulaGrammar::Grammar eGrammar1 = formula::FormulaGrammar::GRAM_DEFAULT,
462 formula::FormulaGrammar::Grammar eGrammar2 = formula::FormulaGrammar::GRAM_DEFAULT,
463 Type eType = Type::Condition);
464 ScCondFormatEntry( ScConditionMode eOper,
465 const ScTokenArray* pArr1, const ScTokenArray* pArr2,
466 ScDocument& rDocument, const ScAddress& rPos,
467 const OUString& rStyle );
468 ScCondFormatEntry( const ScCondFormatEntry& r );
469 ScCondFormatEntry( ScDocument& rDocument, const ScCondFormatEntry& r );
470 virtual ~ScCondFormatEntry() override;
472 bool IsEqual( const ScFormatEntry& r, bool bIgnoreSrcPos ) const override;
474 const OUString& GetStyle() const { return aStyleName; }
475 void UpdateStyleName(const OUString& rNew) { aStyleName=rNew; }
476 virtual ScFormatEntry* Clone(ScDocument* pDoc) const override;
477 virtual Type GetType() const override { return eCondFormatType; }
479 private:
480 virtual void DataChanged() const override;
483 namespace condformat {
485 enum ScCondFormatDateType
487 TODAY,
488 YESTERDAY,
489 TOMORROW,
490 LAST7DAYS,
491 THISWEEK,
492 LASTWEEK,
493 NEXTWEEK,
494 THISMONTH,
495 LASTMONTH,
496 NEXTMONTH,
497 THISYEAR,
498 LASTYEAR,
499 NEXTYEAR
504 class SC_DLLPUBLIC ScCondDateFormatEntry final : public ScFormatEntry
506 public:
507 ScCondDateFormatEntry(ScDocument* pDoc);
508 ScCondDateFormatEntry(ScDocument* pDoc, const ScCondDateFormatEntry& rEntry);
510 bool IsValid( const ScAddress& rPos ) const;
512 void SetDateType(condformat::ScCondFormatDateType eType);
513 condformat::ScCondFormatDateType GetDateType() const { return meType;}
515 const OUString& GetStyleName() const { return maStyleName;}
516 void SetStyleName( const OUString& rStyleName );
518 virtual Type GetType() const override { return Type::Date; }
519 virtual void UpdateReference( sc::RefUpdateContext& ) override {}
520 virtual void UpdateInsertTab( sc::RefUpdateInsertTabContext& ) override {}
521 virtual void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& ) override {}
522 virtual void UpdateMoveTab( sc::RefUpdateMoveTabContext& ) override {}
524 virtual ScFormatEntry* Clone( ScDocument* pDoc ) const override;
526 virtual void SetParent( ScConditionalFormat* ) override {}
528 virtual void startRendering() override;
529 virtual void endRendering() override;
531 private:
532 condformat::ScCondFormatDateType meType;
534 mutable std::unique_ptr<Date> mpCache;
536 OUString maStyleName;
539 // complete conditional formatting
540 class SC_DLLPUBLIC ScConditionalFormat
542 ScDocument* pDoc;
543 sal_uInt32 nKey; // Index in attributes
545 std::vector<std::unique_ptr<ScFormatEntry>> maEntries;
546 ScRangeList maRanges; // Ranges for conditional format
548 public:
549 ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocument);
550 ~ScConditionalFormat();
551 ScConditionalFormat(const ScConditionalFormat&) = delete;
552 const ScConditionalFormat& operator=(const ScConditionalFormat&) = delete;
554 // true copy of formulas (for Ref-Undo / between documents)
555 std::unique_ptr<ScConditionalFormat> Clone(ScDocument* pNewDoc = nullptr) const;
557 void AddEntry( ScFormatEntry* pNew );
558 void RemoveEntry(size_t nIndex);
559 void SetRange( const ScRangeList& rRanges );
560 const ScRangeList& GetRange() const { return maRanges; }
561 // don't use the same name as for the const version
562 ScRangeList& GetRangeList() { return maRanges; }
564 bool IsEmpty() const;
565 size_t size() const;
567 ScDocument* GetDocument();
569 void CompileAll();
570 void CompileXML();
571 void UpdateReference( sc::RefUpdateContext& rCxt, bool bCopyAsMove = false );
572 void UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt );
573 void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt );
574 void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt );
576 void InsertRow(SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW nRowStart, SCSIZE nSize);
577 void InsertCol(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, SCCOL nColStart, SCSIZE nSize);
579 void DeleteArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
580 void RenameCellStyle( const OUString& rOld, const OUString& rNew );
582 const ScFormatEntry* GetEntry( sal_uInt16 nPos ) const;
584 const OUString& GetCellStyle( ScRefCellValue& rCell, const ScAddress& rPos ) const;
586 ScCondFormatData GetData( ScRefCellValue& rCell, const ScAddress& rPos ) const;
588 bool EqualEntries( const ScConditionalFormat& r, bool bIgnoreSrcPos = false ) const;
590 void DoRepaint();
592 sal_uInt32 GetKey() const { return nKey; }
593 void SetKey(sal_uInt32 nNew) { nKey = nNew; } // only if not inserted!
595 bool MarkUsedExternalReferences() const;
597 // sorted (via std::set) by Index
598 bool operator < ( const ScConditionalFormat& r ) const { return nKey < r.nKey; }
600 void startRendering();
601 void endRendering();
603 // Forced recalculation for formulas
604 void CalcAll();
607 struct CompareScConditionalFormat
609 using is_transparent = void;
610 bool operator()(std::unique_ptr<ScConditionalFormat> const& lhs,
611 std::unique_ptr<ScConditionalFormat> const& rhs) const
613 return (*lhs) < (*rhs);
615 bool operator()(sal_uInt32 nKey, std::unique_ptr<ScConditionalFormat> const& rpFormat) const
617 return nKey < rpFormat->GetKey();
619 bool operator()(std::unique_ptr<ScConditionalFormat> const& rpFormat, sal_uInt32 nKey) const
621 return rpFormat->GetKey() < nKey;
625 // List of all conditional formats in a sheet
626 class SC_DLLPUBLIC ScConditionalFormatList
628 private:
629 typedef std::set<std::unique_ptr<ScConditionalFormat>,
630 CompareScConditionalFormat> ConditionalFormatContainer;
631 ConditionalFormatContainer m_ConditionalFormats;
633 void operator =(ScConditionalFormatList const &) = delete;
635 public:
636 ScConditionalFormatList() {}
637 ScConditionalFormatList(const ScConditionalFormatList& rList);
638 ScConditionalFormatList(ScDocument& rDoc, const ScConditionalFormatList& rList);
640 void InsertNew( std::unique_ptr<ScConditionalFormat> pNew );
643 * Checks that all cond formats have a non empty range.
644 * Deletes empty cond formats. Optionally call rLink
645 * on the empty format before deleting it.
646 * @return true if all cond formats were valid
648 bool CheckAllEntries(const Link<ScConditionalFormat*,void>& rLink = Link<ScConditionalFormat*,void>());
650 ScConditionalFormat* GetFormat( sal_uInt32 nKey );
651 const ScConditionalFormat* GetFormat( sal_uInt32 nKey ) const;
653 void CompileAll();
654 void CompileXML();
655 void UpdateReference( sc::RefUpdateContext& rCxt );
656 void UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt );
657 void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt );
658 void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt );
660 void InsertRow(SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW nRowStart, SCSIZE nSize);
661 void InsertCol(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, SCCOL nColStart, SCSIZE nSize);
663 void RenameCellStyle( const OUString& rOld, const OUString& rNew );
664 void DeleteArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
666 typedef ConditionalFormatContainer::iterator iterator;
667 typedef ConditionalFormatContainer::const_iterator const_iterator;
669 ScRangeList GetCombinedRange() const;
671 void RemoveFromDocument(ScDocument& rDoc) const;
672 void AddToDocument(ScDocument& rDoc) const;
674 iterator begin();
675 const_iterator begin() const;
676 iterator end();
677 const_iterator end() const;
679 size_t size() const;
680 bool empty() const;
682 void erase(sal_uLong nIndex);
683 void clear();
685 void startRendering();
686 void endRendering();
688 sal_uInt32 getMaxKey() const;
690 /// Forced recalculation of formulas
691 void CalcAll();
694 #endif
696 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */