LibreOffice Module sc (master) 1
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ScConditionEntry Class Reference

#include <conditio.hxx>

Inheritance diagram for ScConditionEntry:
[legend]
Collaboration diagram for ScConditionEntry:
[legend]

Classes

struct  ScConditionEntryCache
 

Public Member Functions

 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)
 
 ScConditionEntry (ScConditionMode eOper, const ScTokenArray *pArr1, const ScTokenArray *pArr2, ScDocument &rDocument, const ScAddress &rPos)
 
 ScConditionEntry (const ScConditionEntry &r)
 
 ScConditionEntry (ScDocument &rDocument, const ScConditionEntry &r)
 
virtual ~ScConditionEntry () override
 
bool IsEqual (const ScFormatEntry &r, bool bIgnoreSrcPos) const override
 
virtual void SetParent (ScConditionalFormat *pNew) override
 
bool IsCellValid (ScRefCellValue &rCell, const ScAddress &rPos) const
 
ScConditionMode GetOperation () const
 
void SetOperation (ScConditionMode eMode)
 
bool IsIgnoreBlank () const
 
void SetIgnoreBlank (bool bSet)
 
const OUString & GetSrcString () const
 
const ScAddressGetSrcPos () const
 
ScAddress GetValidSrcPos () const
 Return a position that's adjusted to allow textual representation of expressions if possible. More...
 
void SetSrcString (const OUString &rNew)
 
void SetFormula1 (const ScTokenArray &rArray)
 
void SetFormula2 (const ScTokenArray &rArray)
 
OUString GetExpression (const ScAddress &rCursor, sal_uInt16 nPos, sal_uInt32 nNumFmt=0, const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT) const
 
std::unique_ptr< ScTokenArrayCreateFlatCopiedTokenArray (sal_uInt16 nPos) const
 Create a flat copy using ScTokenArray copy-ctor with shared tokens. More...
 
void CompileAll ()
 Delete formula cells, so we re-compile at the next IsValid. More...
 
void CompileXML ()
 
virtual void UpdateReference (sc::RefUpdateContext &rCxt) override
 
virtual void UpdateInsertTab (sc::RefUpdateInsertTabContext &rCxt) override
 
virtual void UpdateDeleteTab (sc::RefUpdateDeleteTabContext &rCxt) override
 
virtual void UpdateMoveTab (sc::RefUpdateMoveTabContext &rCxt) override
 
bool MarkUsedExternalReferences () const
 
virtual Type GetType () const override
 
virtual ScFormatEntryClone (ScDocument *pDoc) const override
 
virtual void endRendering () override
 
virtual void startRendering () override
 
bool NeedsRepaint () const
 
void CalcAll ()
 
- Public Member Functions inherited from ScFormatEntry
 ScFormatEntry (ScDocument *pDoc)
 
virtual ~ScFormatEntry ()
 
virtual Type GetType () const =0
 
virtual void UpdateReference (sc::RefUpdateContext &rCxt)=0
 
virtual void UpdateInsertTab (sc::RefUpdateInsertTabContext &rCxt)=0
 
virtual void UpdateDeleteTab (sc::RefUpdateDeleteTabContext &rCxt)=0
 
virtual void UpdateMoveTab (sc::RefUpdateMoveTabContext &rCxt)=0
 
virtual ScFormatEntryClone (ScDocument *pDoc) const =0
 
virtual void SetParent (ScConditionalFormat *pNew)=0
 
bool operator== (const ScFormatEntry &) const
 
virtual bool IsEqual (const ScFormatEntry &, bool bIgnoreSrcPos) const
 
virtual void startRendering ()
 
virtual void endRendering ()
 

Static Public Member Functions

static ScConditionMode GetModeFromApi (css::sheet::ConditionOperator nOperator)
 

Protected Member Functions

virtual void DataChanged () const
 
ScDocumentGetDocument () const
 

Protected Attributes

ScConditionalFormatpCondFormat
 
- Protected Attributes inherited from ScFormatEntry
ScDocumentmpDoc
 

Private Member Functions

void MakeCells (const ScAddress &rPos)
 Create formula cells. More...
 
void Compile (const OUString &rExpr1, const OUString &rExpr2, const OUString &rExprNmsp1, const OUString &rExprNmsp2, formula::FormulaGrammar::Grammar eGrammar1, formula::FormulaGrammar::Grammar eGrammar2, bool bTextToReal)
 
void Interpret (const ScAddress &rPos)
 
bool IsValid (double nArg, const ScAddress &rPos) const
 
bool IsValidStr (const OUString &rArg, const ScAddress &rPos) const
 
void StartListening ()
 
bool IsDuplicate (double nArg, const OUString &rStr) const
 
bool IsTopNElement (double nArg) const
 
bool IsTopNPercent (double nArg) const
 
bool IsBottomNElement (double nArg) const
 
bool IsBottomNPercent (double nArg) const
 
bool IsAboveAverage (double nArg, bool bEqual) const
 
bool IsBelowAverage (double nArg, bool bEqual) const
 
bool IsError (const ScAddress &rPos) const
 
void FillCache () const
 

Static Private Member Functions

static void SimplifyCompiledFormula (std::unique_ptr< ScTokenArray > &rFormula, double &rVal, bool &rIsStr, OUString &rStrVal)
 

Private Attributes

ScConditionMode eOp
 
sal_uInt16 nOptions
 
double nVal1
 
double nVal2
 
OUString aStrVal1
 
OUString aStrVal2
 
const OUString aStrNmsp1
 
const OUString aStrNmsp2
 
const formula::FormulaGrammar::Grammar eTempGrammar1
 
const formula::FormulaGrammar::Grammar eTempGrammar2
 
bool bIsStr1
 
bool bIsStr2
 
std::unique_ptr< ScTokenArraypFormula1
 
std::unique_ptr< ScTokenArraypFormula2
 
ScAddress aSrcPos
 
OUString aSrcString
 
std::unique_ptr< ScFormulaCellpFCell1
 
std::unique_ptr< ScFormulaCellpFCell2
 
bool bRelRef1
 
bool bRelRef2
 
bool bFirstRun
 
std::unique_ptr< ScFormulaListenermpListener
 
Type eConditionType
 
std::unique_ptr< ScConditionEntryCachempCache
 

Additional Inherited Members

- Public Types inherited from ScFormatEntry
enum class  Type {
  Condition ,
  ExtCondition ,
  Colorscale ,
  Databar ,
  Iconset ,
  Date
}
 

Detailed Description

Definition at line 301 of file conditio.hxx.

Constructor & Destructor Documentation

◆ ScConditionEntry() [1/4]

ScConditionEntry::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 
)

Referenced by Clone().

◆ ScConditionEntry() [2/4]

ScConditionEntry::ScConditionEntry ( ScConditionMode  eOper,
const ScTokenArray pArr1,
const ScTokenArray pArr2,
ScDocument rDocument,
const ScAddress rPos 
)

◆ ScConditionEntry() [3/4]

ScConditionEntry::ScConditionEntry ( const ScConditionEntry r)

Definition at line 172 of file conditio.cxx.

References mpListener, pFormula1, pFormula2, and StartListening().

◆ ScConditionEntry() [4/4]

ScConditionEntry::ScConditionEntry ( ScDocument rDocument,
const ScConditionEntry r 
)

Definition at line 205 of file conditio.cxx.

References mpListener, pFormula1, and pFormula2.

◆ ~ScConditionEntry()

ScConditionEntry::~ScConditionEntry ( )
overridevirtual

Definition at line 305 of file conditio.cxx.

Member Function Documentation

◆ CalcAll()

void ScConditionEntry::CalcAll ( )

Definition at line 1518 of file conditio.cxx.

References ScConditionalFormat::DoRepaint(), pCondFormat, pFCell1, and pFCell2.

Referenced by ScConditionalFormat::CalcAll().

◆ Clone()

ScFormatEntry * ScConditionEntry::Clone ( ScDocument pDoc) const
overridevirtual

Implements ScFormatEntry.

Reimplemented in ScCondFormatEntry, and ScValidationData.

Definition at line 1395 of file conditio.cxx.

References ScConditionEntry().

◆ Compile()

void ScConditionEntry::Compile ( const OUString &  rExpr1,
const OUString &  rExpr2,
const OUString &  rExprNmsp1,
const OUString &  rExprNmsp2,
formula::FormulaGrammar::Grammar  eGrammar1,
formula::FormulaGrammar::Grammar  eGrammar2,
bool  bTextToReal 
)
private

◆ CompileAll()

void ScConditionEntry::CompileAll ( )

Delete formula cells, so we re-compile at the next IsValid.

Definition at line 430 of file conditio.cxx.

References pFCell1, and pFCell2.

Referenced by ScConditionalFormat::CompileAll().

◆ CompileXML()

void ScConditionEntry::CompileXML ( )

◆ CreateFlatCopiedTokenArray()

std::unique_ptr< ScTokenArray > ScConditionEntry::CreateFlatCopiedTokenArray ( sal_uInt16  nPos) const

◆ DataChanged()

void ScConditionEntry::DataChanged ( ) const
protectedvirtual

Reimplemented in ScCondFormatEntry.

Definition at line 1378 of file conditio.cxx.

Referenced by Interpret().

◆ endRendering()

void ScConditionEntry::endRendering ( )
overridevirtual

Reimplemented from ScFormatEntry.

Definition at line 1449 of file conditio.cxx.

References mpCache.

◆ FillCache()

void ScConditionEntry::FillCache ( ) const
private

◆ GetDocument()

ScDocument * ScConditionEntry::GetDocument ( ) const
inlineprotected

◆ GetExpression()

OUString ScConditionEntry::GetExpression ( const ScAddress rCursor,
sal_uInt16  nPos,
sal_uInt32  nNumFmt = 0,
const formula::FormulaGrammar::Grammar  eGrammar = formula::FormulaGrammar::GRAM_DEFAULT 
) const

◆ GetModeFromApi()

ScConditionMode ScConditionEntry::GetModeFromApi ( css::sheet::ConditionOperator  nOperator)
static

◆ GetOperation()

ScConditionMode ScConditionEntry::GetOperation ( ) const
inline

◆ GetSrcPos()

const ScAddress & ScConditionEntry::GetSrcPos ( ) const
inline

◆ GetSrcString()

const OUString & ScConditionEntry::GetSrcString ( ) const
inline

Definition at line 372 of file conditio.hxx.

◆ GetType()

virtual Type ScConditionEntry::GetType ( ) const
inlineoverridevirtual

Implements ScFormatEntry.

Reimplemented in ScCondFormatEntry.

Definition at line 398 of file conditio.hxx.

Referenced by IsEqual().

◆ GetValidSrcPos()

ScAddress ScConditionEntry::GetValidSrcPos ( ) const

◆ Interpret()

void ScConditionEntry::Interpret ( const ScAddress rPos)
private

◆ IsAboveAverage()

bool ScConditionEntry::IsAboveAverage ( double  nArg,
bool  bEqual 
) const
private

Definition at line 935 of file conditio.cxx.

References FillCache(), and mpCache.

Referenced by IsValid().

◆ IsBelowAverage()

bool ScConditionEntry::IsBelowAverage ( double  nArg,
bool  bEqual 
) const
private

Definition at line 921 of file conditio.cxx.

References FillCache(), and mpCache.

Referenced by IsValid().

◆ IsBottomNElement()

bool ScConditionEntry::IsBottomNElement ( double  nArg) const
private

Definition at line 864 of file conditio.cxx.

References FillCache(), mpCache, and nVal1.

Referenced by IsValid().

◆ IsBottomNPercent()

bool ScConditionEntry::IsBottomNPercent ( double  nArg) const
private

Definition at line 903 of file conditio.cxx.

References FillCache(), mpCache, and nVal1.

Referenced by IsValid().

◆ IsCellValid()

bool ScConditionEntry::IsCellValid ( ScRefCellValue rCell,
const ScAddress rPos 
) const

◆ IsDuplicate()

bool ScConditionEntry::IsDuplicate ( double  nArg,
const OUString &  rStr 
) const
private

Definition at line 817 of file conditio.cxx.

References FillCache(), and mpCache.

Referenced by IsValid(), and IsValidStr().

◆ IsEqual()

bool ScConditionEntry::IsEqual ( const ScFormatEntry r,
bool  bIgnoreSrcPos 
) const
overridevirtual

◆ IsError()

bool ScConditionEntry::IsError ( const ScAddress rPos) const
private

◆ IsIgnoreBlank()

bool ScConditionEntry::IsIgnoreBlank ( ) const
inline

◆ IsTopNElement()

bool ScConditionEntry::IsTopNElement ( double  nArg) const
private

Definition at line 843 of file conditio.cxx.

References FillCache(), mpCache, and nVal1.

Referenced by IsValid().

◆ IsTopNPercent()

bool ScConditionEntry::IsTopNPercent ( double  nArg) const
private

Definition at line 884 of file conditio.cxx.

References FillCache(), mpCache, and nVal1.

Referenced by IsValid().

◆ IsValid()

bool ScConditionEntry::IsValid ( double  nArg,
const ScAddress rPos 
) const
private

◆ IsValidStr()

bool ScConditionEntry::IsValidStr ( const OUString &  rArg,
const ScAddress rPos 
) const
private

◆ MakeCells()

void ScConditionEntry::MakeCells ( const ScAddress rPos)
private

Create formula cells.

Definition at line 393 of file conditio.cxx.

References bRelRef1, bRelRef2, ScDocument::IsClipOrUndo(), ScFormatEntry::mpDoc, pFCell1, pFCell2, pFormula1, and pFormula2.

Referenced by Interpret().

◆ MarkUsedExternalReferences()

bool ScConditionEntry::MarkUsedExternalReferences ( ) const

◆ NeedsRepaint()

bool ScConditionEntry::NeedsRepaint ( ) const

Definition at line 1454 of file conditio.cxx.

References mpListener.

◆ SetFormula1()

void ScConditionEntry::SetFormula1 ( const ScTokenArray rArray)

◆ SetFormula2()

void ScConditionEntry::SetFormula2 ( const ScTokenArray rArray)

◆ SetIgnoreBlank()

void ScConditionEntry::SetIgnoreBlank ( bool  bSet)

◆ SetOperation()

void ScConditionEntry::SetOperation ( ScConditionMode  eMode)

Definition at line 335 of file conditio.cxx.

References eMode, and eOp.

Referenced by ScConditionEntryObj::setPropertyValue().

◆ SetParent()

void ScConditionEntry::SetParent ( ScConditionalFormat pNew)
overridevirtual

Implements ScFormatEntry.

Definition at line 166 of file conditio.cxx.

References pCondFormat, and StartListening().

◆ SetSrcString()

void ScConditionEntry::SetSrcString ( const OUString &  rNew)

◆ SimplifyCompiledFormula()

void ScConditionEntry::SimplifyCompiledFormula ( std::unique_ptr< ScTokenArray > &  rFormula,
double &  rVal,
bool &  rIsStr,
OUString &  rStrVal 
)
staticprivate

◆ StartListening()

void ScConditionEntry::StartListening ( )
private

◆ startRendering()

void ScConditionEntry::startRendering ( )
overridevirtual

Reimplemented from ScFormatEntry.

Definition at line 1444 of file conditio.cxx.

References mpCache.

◆ UpdateDeleteTab()

void ScConditionEntry::UpdateDeleteTab ( sc::RefUpdateDeleteTabContext rCxt)
overridevirtual

◆ UpdateInsertTab()

void ScConditionEntry::UpdateInsertTab ( sc::RefUpdateInsertTabContext rCxt)
overridevirtual

Implements ScFormatEntry.

Definition at line 551 of file conditio.cxx.

References aSrcPos, pFCell1, pFCell2, pFormula1, pFormula2, and ScRangeUpdater::UpdateInsertTab().

◆ UpdateMoveTab()

void ScConditionEntry::UpdateMoveTab ( sc::RefUpdateMoveTabContext rCxt)
overridevirtual

Implements ScFormatEntry.

Definition at line 586 of file conditio.cxx.

References aSrcPos, pFCell1, pFCell2, pFormula1, pFormula2, and StartListening().

◆ UpdateReference()

void ScConditionEntry::UpdateReference ( sc::RefUpdateContext rCxt)
overridevirtual

Member Data Documentation

◆ aSrcPos

ScAddress ScConditionEntry::aSrcPos
private

◆ aSrcString

OUString ScConditionEntry::aSrcString
private

Definition at line 320 of file conditio.hxx.

Referenced by CompileXML(), IsEqual(), and SetSrcString().

◆ aStrNmsp1

const OUString ScConditionEntry::aStrNmsp1
private

Definition at line 310 of file conditio.hxx.

Referenced by CompileXML().

◆ aStrNmsp2

const OUString ScConditionEntry::aStrNmsp2
private

Definition at line 311 of file conditio.hxx.

Referenced by CompileXML().

◆ aStrVal1

OUString ScConditionEntry::aStrVal1
private

◆ aStrVal2

OUString ScConditionEntry::aStrVal2
private

◆ bFirstRun

bool ScConditionEntry::bFirstRun
private

Definition at line 325 of file conditio.hxx.

Referenced by Interpret().

◆ bIsStr1

bool ScConditionEntry::bIsStr1
private

◆ bIsStr2

bool ScConditionEntry::bIsStr2
private

◆ bRelRef1

bool ScConditionEntry::bRelRef1
private

Definition at line 323 of file conditio.hxx.

Referenced by Compile(), Interpret(), MakeCells(), ScConditionEntry(), and SetFormula1().

◆ bRelRef2

bool ScConditionEntry::bRelRef2
private

Definition at line 324 of file conditio.hxx.

Referenced by Compile(), Interpret(), MakeCells(), ScConditionEntry(), and SetFormula2().

◆ eConditionType

Type ScConditionEntry::eConditionType
private

Definition at line 327 of file conditio.hxx.

◆ eOp

ScConditionMode ScConditionEntry::eOp
private

Definition at line 304 of file conditio.hxx.

Referenced by IsCellValid(), IsEqual(), IsValid(), IsValidStr(), and SetOperation().

◆ eTempGrammar1

const formula::FormulaGrammar::Grammar ScConditionEntry::eTempGrammar1
private

Definition at line 312 of file conditio.hxx.

Referenced by CompileXML().

◆ eTempGrammar2

const formula::FormulaGrammar::Grammar ScConditionEntry::eTempGrammar2
private

Definition at line 313 of file conditio.hxx.

Referenced by CompileXML().

◆ mpCache

std::unique_ptr<ScConditionEntryCache> ScConditionEntry::mpCache
mutableprivate

◆ mpListener

std::unique_ptr<ScFormulaListener> ScConditionEntry::mpListener
private

Definition at line 326 of file conditio.hxx.

Referenced by NeedsRepaint(), and StartListening().

◆ nOptions

sal_uInt16 ScConditionEntry::nOptions
private

Definition at line 305 of file conditio.hxx.

Referenced by IsEqual(), and SetIgnoreBlank().

◆ nVal1

double ScConditionEntry::nVal1
private

◆ nVal2

double ScConditionEntry::nVal2
private

◆ pCondFormat

ScConditionalFormat* ScConditionEntry::pCondFormat
protected

◆ pFCell1

std::unique_ptr<ScFormulaCell> ScConditionEntry::pFCell1
private

◆ pFCell2

std::unique_ptr<ScFormulaCell> ScConditionEntry::pFCell2
private

◆ pFormula1

std::unique_ptr<ScTokenArray> ScConditionEntry::pFormula1
private

◆ pFormula2

std::unique_ptr<ScTokenArray> ScConditionEntry::pFormula2
private

The documentation for this class was generated from the following files: