32#include <com/sun/star/sheet/ConditionOperator.hpp>
34#include <rtl/math.hxx>
49struct RefUpdateContext;
50struct RefUpdateInsertTabContext;
51struct RefUpdateDeleteTabContext;
52struct RefUpdateMoveTabContext;
57#define SC_COND_NOBLANKS 1
90template<
typename charT,
typename traits>
91inline std::basic_ostream<charT, traits> &
operator <<(std::basic_ostream<charT, traits> & stream,
const ScConditionMode& rMode)
138 stream <<
"BOTTOMPERCENT";
147 stream <<
"ABOVEEQUALAVERAGE";
150 stream <<
"BELOWEQUALAVERAGE";
168 stream <<
"NOTCONTAINSTEXT";
174 stream <<
"?(" <<
static_cast<int>(rMode) <<
")";
203 void setCallback(
const std::function<
void()>& aCallbackFunction);
250 virtual bool IsEqual(
const ScFormatEntry&,
bool bIgnoreSrcPos )
const;
252 virtual void startRendering();
253 virtual void endRendering();
254 virtual void updateValues();
260template<
typename charT,
typename traits>
284 stream <<
"?(" <<
static_cast<int>(rType) <<
")";
295 if(nVal1 < nVal2 && !rtl::math::approxEqual(nVal1, nVal2))
330 static void SimplifyCompiledFormula( std::unique_ptr<ScTokenArray>& rFormula,
336 void Compile(
const OUString& rExpr1,
const OUString& rExpr2,
337 const OUString& rExprNmsp1,
const OUString& rExprNmsp2,
343 bool IsValid(
double nArg,
const ScAddress& rPos )
const;
344 bool IsValidStr(
const OUString& rArg,
const ScAddress& rPos )
const;
349 const OUString& rExpr1,
const OUString& rExpr2,
351 const OUString& rExprNmsp1,
const OUString& rExprNmsp2,
354 Type eType = Type::Condition );
363 bool IsEqual(
const ScFormatEntry& r,
bool bIgnoreSrcPos )
const override;
372 void SetIgnoreBlank(
bool bSet);
378 void SetSrcString(
const OUString& rNew );
383 OUString GetExpression(
const ScAddress& rCursor, sal_uInt16 nPos, sal_uInt32 nNumFmt = 0,
388 std::unique_ptr<ScTokenArray> CreateFlatCopiedTokenArray( sal_uInt16 nPos )
const;
397 bool MarkUsedExternalReferences()
const;
403 static ScConditionMode GetModeFromApi(css::sheet::ConditionOperator nOperator);
405 virtual void endRendering()
override;
406 virtual void startRendering()
override;
408 bool NeedsRepaint()
const;
418 bool IsDuplicate(
double nArg,
const OUString& rStr)
const;
419 bool IsTopNElement(
double nArg )
const;
420 bool IsTopNPercent(
double nArg )
const;
421 bool IsBottomNElement(
double nArg )
const;
422 bool IsBottomNPercent(
double nArg )
const;
423 bool IsAboveAverage(
double nArg,
bool bEqual )
const;
424 bool IsBelowAverage(
double nArg,
bool bEqual )
const;
426 bool IsError(
const ScAddress& rPos )
const;
428 void FillCache()
const;
444 mutable std::unique_ptr<ScConditionEntryCache>
mpCache;
451 Type eCondFormatType = Type::Condition;
455 const OUString& rExpr1,
const OUString& rExpr2,
458 const OUString& rExprNmsp1 = OUString(),
459 const OUString& rExprNmsp2 = OUString(),
462 Type eType = Type::Condition);
471 bool IsEqual(
const ScFormatEntry& r,
bool bIgnoreSrcPos )
const override;
473 const OUString&
GetStyle()
const {
return aStyleName; }
509 bool IsValid(
const ScAddress& rPos )
const;
515 void SetStyleName(
const OUString& rStyleName );
527 virtual void startRendering()
override;
528 virtual void endRendering()
override;
554 std::unique_ptr<ScConditionalFormat>
Clone(
ScDocument* pNewDoc =
nullptr)
const;
557 void RemoveEntry(
size_t nIndex);
563 bool IsEmpty()
const;
579 void RenameCellStyle( std::u16string_view rOld,
const OUString& rNew );
591 sal_uInt32
GetKey()
const {
return nKey; }
592 void SetKey(sal_uInt32 nNew) { nKey = nNew; }
594 bool MarkUsedExternalReferences()
const;
599 void startRendering();
611 bool operator()(std::unique_ptr<ScConditionalFormat>
const& lhs,
612 std::unique_ptr<ScConditionalFormat>
const& rhs)
const
614 return (*lhs) < (*rhs);
616 bool operator()(sal_uInt32 nKey, std::unique_ptr<ScConditionalFormat>
const& rpFormat)
const
618 return nKey < rpFormat->GetKey();
620 bool operator()(std::unique_ptr<ScConditionalFormat>
const& rpFormat, sal_uInt32 nKey)
const
622 return rpFormat->GetKey() < nKey;
630 typedef std::set<std::unique_ptr<ScConditionalFormat>,
641 void InsertNew( std::unique_ptr<ScConditionalFormat> pNew );
664 void RenameCellStyle( std::u16string_view rOld,
const OUString& rNew );
667 typedef ConditionalFormatContainer::iterator
iterator;
672 void RemoveFromDocument(
ScDocument& rDoc)
const;
686 void startRendering();
691 sal_uInt32 getMaxKey()
const;
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
std::unique_ptr< Date > mpCache
condformat::ScCondFormatDateType GetDateType() const
virtual Type GetType() const override
virtual void UpdateInsertTab(sc::RefUpdateInsertTabContext &) override
virtual void SetParent(ScConditionalFormat *) override
condformat::ScCondFormatDateType meType
virtual void UpdateReference(sc::RefUpdateContext &) override
virtual void UpdateMoveTab(sc::RefUpdateMoveTabContext &) override
virtual void UpdateDeleteTab(sc::RefUpdateDeleteTabContext &) override
const OUString & GetStyleName() const
const OUString & GetStyle() const
virtual Type GetType() const override
ScCondFormatEntry(ScConditionMode eOper, const OUString &rExpr1, const OUString &rExpr2, ScDocument &rDocument, const ScAddress &rPos, OUString aStyle, const OUString &rExprNmsp1=OUString(), const OUString &rExprNmsp2=OUString(), formula::FormulaGrammar::Grammar eGrammar1=formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::Grammar eGrammar2=formula::FormulaGrammar::GRAM_DEFAULT, Type eType=Type::Condition)
void UpdateStyleName(const OUString &rNew)
ScConditionEntry(ScConditionMode eOper, const OUString &rExpr1, const OUString &rExpr2, ScDocument &rDocument, const ScAddress &rPos, const OUString &rExprNmsp1, const OUString &rExprNmsp2, formula::FormulaGrammar::Grammar eGrammar1, formula::FormulaGrammar::Grammar eGrammar2, Type eType=Type::Condition)
const formula::FormulaGrammar::Grammar eTempGrammar1
const formula::FormulaGrammar::Grammar eTempGrammar2
std::unique_ptr< ScFormulaCell > pFCell1
virtual Type GetType() const override
std::unique_ptr< ScFormulaCell > pFCell2
std::unique_ptr< ScFormulaListener > mpListener
std::unique_ptr< ScConditionEntryCache > mpCache
std::unique_ptr< ScTokenArray > pFormula1
ScConditionMode GetOperation() const
ScDocument * GetDocument() const
ScConditionalFormat * pCondFormat
const ScAddress & GetSrcPos() const
std::unique_ptr< ScTokenArray > pFormula2
bool IsIgnoreBlank() const
const OUString & GetSrcString() const
virtual Type GetType() const =0
virtual ScFormatEntry * Clone(ScDocument *pDoc) const =0
virtual void UpdateReference(sc::RefUpdateContext &rCxt)=0
virtual void SetParent(ScConditionalFormat *pNew)=0
virtual void UpdateDeleteTab(sc::RefUpdateDeleteTabContext &rCxt)=0
virtual void UpdateMoveTab(sc::RefUpdateMoveTabContext &rCxt)=0
virtual void UpdateInsertTab(sc::RefUpdateInsertTabContext &rCxt)=0
bool operator()(double nVal1, double nVal2) const
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, const ScConditionMode &rMode)
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
Reference< XOutputStream > stream
bool operator<(const ScDPCollection::DBType &left, const ScDPCollection::DBType &right)
@ StartListening
If set, cloned formula cells will start to listen to the document.
enumrange< T >::Iterator begin(enumrange< T >)
CAUTION! The following defines must be in the same namespace as the respective type.
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
StringCacheType maStrings
std::map< double, sal_Int32, approx_less > ValueCacheType
std::map< OUString, sal_Int32 > StringCacheType
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Context for reference update during shifting, moving or copying of cell ranges.
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)