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 ()
 
bool operator== (const ScFormatEntry &) const
 

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  Type {
  Type::Condition,
  Type::ExtCondition,
  Type::Colorscale,
  Type::Databar,
  Type::Iconset,
  Type::Date
}
 

Detailed Description

Definition at line 303 of file conditio.hxx.

Constructor & Destructor Documentation

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::ScConditionEntry ( ScConditionMode  eOper,
const ScTokenArray pArr1,
const ScTokenArray pArr2,
ScDocument rDocument,
const ScAddress rPos 
)
ScConditionEntry::ScConditionEntry ( const ScConditionEntry r)

Definition at line 172 of file conditio.cxx.

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

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

Definition at line 205 of file conditio.cxx.

References mpListener, pFormula1, and pFormula2.

ScConditionEntry::~ScConditionEntry ( )
overridevirtual

Definition at line 305 of file conditio.cxx.

Member Function Documentation

void ScConditionEntry::CalcAll ( )

Definition at line 1514 of file conditio.cxx.

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

Referenced by ScConditionalFormat::CalcAll().

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

Implements ScFormatEntry.

Reimplemented in ScCondFormatEntry, and ScValidationData.

Definition at line 1391 of file conditio.cxx.

References ScConditionEntry().

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
void ScConditionEntry::CompileAll ( )

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

Definition at line 428 of file conditio.cxx.

References pFCell1, and pFCell2.

void ScConditionEntry::CompileXML ( )
std::unique_ptr< ScTokenArray > ScConditionEntry::CreateFlatCopiedTokenArray ( sal_uInt16  nPos) const
void ScConditionEntry::DataChanged ( ) const
protectedvirtual

Reimplemented in ScCondFormatEntry.

Definition at line 1374 of file conditio.cxx.

Referenced by Interpret().

void ScConditionEntry::endRendering ( )
overridevirtual

Reimplemented from ScFormatEntry.

Definition at line 1445 of file conditio.cxx.

References mpCache.

void ScConditionEntry::FillCache ( ) const
private
ScDocument* ScConditionEntry::GetDocument ( ) const
inlineprotected
OUString ScConditionEntry::GetExpression ( const ScAddress rCursor,
sal_uInt16  nPos,
sal_uInt32  nNumFmt = 0,
const formula::FormulaGrammar::Grammar  eGrammar = formula::FormulaGrammar::GRAM_DEFAULT 
) const
ScConditionMode ScConditionEntry::GetModeFromApi ( css::sheet::ConditionOperator  nOperator)
static
ScConditionMode ScConditionEntry::GetOperation ( ) const
inline
const ScAddress& ScConditionEntry::GetSrcPos ( ) const
inline
const OUString& ScConditionEntry::GetSrcString ( ) const
inline

Definition at line 374 of file conditio.hxx.

virtual Type ScConditionEntry::GetType ( ) const
inlineoverridevirtual

Implements ScFormatEntry.

Reimplemented in ScCondFormatEntry.

Definition at line 400 of file conditio.hxx.

Referenced by IsEqual().

ScAddress ScConditionEntry::GetValidSrcPos ( ) const
void ScConditionEntry::Interpret ( const ScAddress rPos)
private
bool ScConditionEntry::IsAboveAverage ( double  nArg,
bool  bEqual 
) const
private

Definition at line 931 of file conditio.cxx.

References FillCache(), and mpCache.

Referenced by IsValid().

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

Definition at line 917 of file conditio.cxx.

References FillCache(), and mpCache.

Referenced by IsValid().

bool ScConditionEntry::IsBottomNElement ( double  nArg) const
private

Definition at line 860 of file conditio.cxx.

References FillCache(), mpCache, and nVal1.

Referenced by IsValid().

bool ScConditionEntry::IsBottomNPercent ( double  nArg) const
private

Definition at line 899 of file conditio.cxx.

References FillCache(), mpCache, and nVal1.

Referenced by IsValid().

bool ScConditionEntry::IsCellValid ( ScRefCellValue rCell,
const ScAddress rPos 
) const
bool ScConditionEntry::IsDuplicate ( double  nArg,
const OUString &  rStr 
) const
private

Definition at line 813 of file conditio.cxx.

References FillCache(), and mpCache.

Referenced by IsValid(), and IsValidStr().

bool ScConditionEntry::IsEqual ( const ScFormatEntry r,
bool  bIgnoreSrcPos 
) const
overridevirtual
bool ScConditionEntry::IsError ( const ScAddress rPos) const
private
bool ScConditionEntry::IsIgnoreBlank ( ) const
inline
bool ScConditionEntry::IsTopNElement ( double  nArg) const
private

Definition at line 839 of file conditio.cxx.

References FillCache(), mpCache, and nVal1.

Referenced by IsValid().

bool ScConditionEntry::IsTopNPercent ( double  nArg) const
private

Definition at line 880 of file conditio.cxx.

References FillCache(), mpCache, and nVal1.

Referenced by IsValid().

bool ScConditionEntry::IsValid ( double  nArg,
const ScAddress rPos 
) const
private
bool ScConditionEntry::IsValidStr ( const OUString &  rArg,
const ScAddress rPos 
) const
private
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().

bool ScConditionEntry::MarkUsedExternalReferences ( ) const
bool ScConditionEntry::NeedsRepaint ( ) const

Definition at line 1450 of file conditio.cxx.

References mpListener.

void ScConditionEntry::SetFormula1 ( const ScTokenArray rArray)
void ScConditionEntry::SetFormula2 ( const ScTokenArray rArray)
void ScConditionEntry::SetIgnoreBlank ( bool  bSet)
void ScConditionEntry::SetOperation ( ScConditionMode  eMode)

Definition at line 335 of file conditio.cxx.

References eOp.

Referenced by ScConditionEntryObj::setPropertyValue().

void ScConditionEntry::SetParent ( ScConditionalFormat pNew)
overridevirtual

Implements ScFormatEntry.

Definition at line 166 of file conditio.cxx.

References pCondFormat, and StartListening().

void ScConditionEntry::SetSrcString ( const OUString &  rNew)
void ScConditionEntry::SimplifyCompiledFormula ( std::unique_ptr< ScTokenArray > &  rFormula,
double &  rVal,
bool &  rIsStr,
OUString &  rStrVal 
)
staticprivate
void ScConditionEntry::StartListening ( )
private
void ScConditionEntry::startRendering ( )
overridevirtual

Reimplemented from ScFormatEntry.

Definition at line 1440 of file conditio.cxx.

References mpCache.

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

Implements ScFormatEntry.

Definition at line 549 of file conditio.cxx.

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

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

Implements ScFormatEntry.

Definition at line 584 of file conditio.cxx.

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

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

Member Data Documentation

ScAddress ScConditionEntry::aSrcPos
private
OUString ScConditionEntry::aSrcString
private

Definition at line 322 of file conditio.hxx.

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

const OUString ScConditionEntry::aStrNmsp1
private

Definition at line 312 of file conditio.hxx.

Referenced by CompileXML().

const OUString ScConditionEntry::aStrNmsp2
private

Definition at line 313 of file conditio.hxx.

Referenced by CompileXML().

OUString ScConditionEntry::aStrVal1
private
OUString ScConditionEntry::aStrVal2
private
bool ScConditionEntry::bFirstRun
private

Definition at line 327 of file conditio.hxx.

Referenced by Interpret().

bool ScConditionEntry::bIsStr1
private
bool ScConditionEntry::bIsStr2
private
bool ScConditionEntry::bRelRef1
private

Definition at line 325 of file conditio.hxx.

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

bool ScConditionEntry::bRelRef2
private

Definition at line 326 of file conditio.hxx.

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

Type ScConditionEntry::eConditionType
private

Definition at line 329 of file conditio.hxx.

ScConditionMode ScConditionEntry::eOp
private

Definition at line 306 of file conditio.hxx.

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

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

Definition at line 314 of file conditio.hxx.

Referenced by CompileXML().

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

Definition at line 315 of file conditio.hxx.

Referenced by CompileXML().

std::unique_ptr<ScConditionEntryCache> ScConditionEntry::mpCache
mutableprivate
std::unique_ptr<ScFormulaListener> ScConditionEntry::mpListener
private

Definition at line 328 of file conditio.hxx.

Referenced by NeedsRepaint(), and StartListening().

sal_uInt16 ScConditionEntry::nOptions
private

Definition at line 307 of file conditio.hxx.

Referenced by IsEqual(), and SetIgnoreBlank().

double ScConditionEntry::nVal1
private
double ScConditionEntry::nVal2
private
ScConditionalFormat* ScConditionEntry::pCondFormat
protected
std::unique_ptr<ScFormulaCell> ScConditionEntry::pFCell1
private
std::unique_ptr<ScFormulaCell> ScConditionEntry::pFCell2
private
std::unique_ptr<ScTokenArray> ScConditionEntry::pFormula1
private
std::unique_ptr<ScTokenArray> ScConditionEntry::pFormula2
private

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