LibreOffice Module sw (master)  1
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SwCalc Class Reference

#include <calc.hxx>

Collaboration diagram for SwCalc:
[legend]

Public Member Functions

 SwCalc (SwDoc &rD)
 
 ~SwCalc () COVERITY_NOEXCEPT_FALSE
 
SwSbxValue Calculate (const OUString &rStr)
 
OUString GetStrResult (const SwSbxValue &rValue)
 
OUString GetStrResult (double)
 
SwCalcExpVarInsert (const OUString &r)
 
SwCalcExpVarLook (const OUString &rStr, bool bIns=false)
 
void VarChange (const OUString &rStr, const SwSbxValue &rValue)
 
void VarChange (const OUString &rStr, double)
 
SwHashTable< SwCalcExp > & GetVarTable ()
 
bool Push (const SwUserFieldType *pUserFieldType)
 
void Pop ()
 
CharClassGetCharClass ()
 
void SetCalcError (SwCalcError eErr)
 
bool IsCalcError () const
 

Static Public Member Functions

static bool Str2Double (const OUString &rStr, sal_Int32 &rPos, double &rVal)
 
static bool Str2Double (const OUString &rStr, sal_Int32 &rPos, double &rVal, SwDoc const *const pDoc)
 
static SW_DLLPUBLIC bool IsValidVarName (const OUString &rStr, OUString *pValidName=nullptr)
 

Private Member Functions

SwCalcOper GetToken ()
 
SwSbxValue Expr ()
 
SwSbxValue Term ()
 
SwSbxValue PrimFunc (bool &rChkPow)
 
SwSbxValue Prim ()
 
SwSbxValue StdFunc (pfCalc pFnc, bool bChkTrig)
 
OUString GetDBName (const OUString &rName)
 
 SwCalc (const SwCalc &)=delete
 
SwCalcoperator= (const SwCalc &)=delete
 

Static Private Member Functions

static OUString GetColumnName (const OUString &rName)
 

Private Attributes

SwHashTable< SwCalcExpm_aVarTable
 
OUStringBuffer m_aVarName
 
OUString m_sCurrSym
 
OUString m_sCommand
 
std::vector< const SwUserFieldType * > m_aRekurStack
 
SwSbxValue m_nLastLeft
 
SwSbxValue m_nNumberValue
 
SwCalcExp m_aErrExpr
 
sal_Int32 m_nCommandPos
 
SwDocm_rDoc
 
SvtSysLocale const m_aSysLocale
 
const LocaleDataWrapperm_pLocaleDataWrapper
 
CharClassm_pCharClass
 
sal_uInt16 m_nListPor
 
SwCalcOper m_eCurrOper
 
SwCalcOper m_eCurrListOper
 
SwCalcError m_eError
 

Detailed Description

Definition at line 184 of file calc.hxx.

Constructor & Destructor Documentation

SwCalc::SwCalc ( const SwCalc )
privatedelete
SwCalc::SwCalc ( SwDoc rD)
SwCalc::~SwCalc ( )

Member Function Documentation

SwSbxValue SwCalc::Calculate ( const OUString &  rStr)
SwSbxValue SwCalc::Expr ( )
private
CharClass * SwCalc::GetCharClass ( )

Definition at line 610 of file calc.cxx.

References m_pCharClass.

Referenced by SwUserFieldType::GetValue().

OUString SwCalc::GetColumnName ( const OUString &  rName)
staticprivate

Definition at line 1286 of file calc.cxx.

References DB_DELIM, and nPos.

Referenced by VarLook().

OUString SwCalc::GetDBName ( const OUString &  rName)
private

Definition at line 1299 of file calc.cxx.

References aData, DB_DELIM, SwDoc::GetDBData(), m_rDoc, nPos, SwDBData::sCommand, and SwDBData::sDataSource.

Referenced by VarLook().

OUString SwCalc::GetStrResult ( const SwSbxValue rValue)
OUString SwCalc::GetStrResult ( double  nValue)
SwCalcOper SwCalc::GetToken ( )
private
SwHashTable<SwCalcExp>& SwCalc::GetVarTable ( )
inline

Definition at line 231 of file calc.hxx.

References m_aVarTable.

Referenced by SwEditShell::Calculate().

bool SwCalc::IsCalcError ( ) const
inline
bool SwCalc::IsValidVarName ( const OUString &  rStr,
OUString *  pValidName = nullptr 
)
static
SwCalc& SwCalc::operator= ( const SwCalc )
privatedelete
void SwCalc::Pop ( )

Definition at line 603 of file calc.cxx.

References m_aRekurStack.

Referenced by SwUserFieldType::GetValue().

SwSbxValue SwCalc::Prim ( )
private
SwSbxValue SwCalc::PrimFunc ( bool &  rChkPow)
private
bool SwCalc::Push ( const SwUserFieldType pUserFieldType)

Definition at line 594 of file calc.cxx.

References m_aRekurStack.

Referenced by SwUserFieldType::GetValue().

void SwCalc::SetCalcError ( SwCalcError  eErr)
inline
SwSbxValue SwCalc::StdFunc ( pfCalc  pFnc,
bool  bChkTrig 
)
private

Definition at line 1013 of file calc.cxx.

References SwSbxValue::GetDouble(), GetToken(), m_eError, Overflow, Prim(), and SbxValue::PutDouble().

Referenced by PrimFunc().

bool SwCalc::Str2Double ( const OUString &  rStr,
sal_Int32 &  rPos,
double &  rVal 
)
static

Definition at line 1335 of file calc.cxx.

References SvtSysLocale::GetLocaleDataPtr().

Referenced by SwSbxValue::GetDouble(), and SwFormulaField::SetFormula().

bool SwCalc::Str2Double ( const OUString &  rStr,
sal_Int32 &  rPos,
double &  rVal,
SwDoc const *const  pDoc 
)
static
SwSbxValue SwCalc::Term ( )
private
void SwCalc::VarChange ( const OUString &  rStr,
const SwSbxValue rValue 
)
void SwCalc::VarChange ( const OUString &  rStr,
double  nValue 
)

Definition at line 569 of file calc.cxx.

References VarChange().

SwCalcExp * SwCalc::VarInsert ( const OUString &  r)

Definition at line 402 of file calc.cxx.

References aStr, CharClass::lowercase(), m_pCharClass, and VarLook().

Referenced by PrimFunc().

SwCalcExp * SwCalc::VarLook ( const OUString &  rStr,
bool  bIns = false 
)

Member Data Documentation

SwCalcExp SwCalc::m_aErrExpr
private

Definition at line 193 of file calc.hxx.

Referenced by SwCalc(), and VarLook().

std::vector<const SwUserFieldType*> SwCalc::m_aRekurStack
private

Definition at line 190 of file calc.hxx.

Referenced by Pop(), and Push().

SvtSysLocale const SwCalc::m_aSysLocale
private

Definition at line 197 of file calc.hxx.

Referenced by ~SwCalc().

OUStringBuffer SwCalc::m_aVarName
private

Definition at line 187 of file calc.hxx.

Referenced by GetToken(), and PrimFunc().

SwHashTable<SwCalcExp> SwCalc::m_aVarTable
private

Definition at line 186 of file calc.hxx.

Referenced by GetVarTable(), SwCalc(), VarChange(), and VarLook().

SwCalcOper SwCalc::m_eCurrListOper
private

Definition at line 203 of file calc.hxx.

Referenced by Calculate(), GetToken(), and VarLook().

SwCalcOper SwCalc::m_eCurrOper
private

Definition at line 202 of file calc.hxx.

Referenced by Calculate(), Expr(), GetToken(), Prim(), PrimFunc(), Term(), and VarLook().

SwCalcError SwCalc::m_eError
private

Definition at line 204 of file calc.hxx.

Referenced by Calculate(), GetStrResult(), GetToken(), IsCalcError(), Prim(), PrimFunc(), StdFunc(), and Term().

sal_Int32 SwCalc::m_nCommandPos
private

Definition at line 194 of file calc.hxx.

Referenced by Calculate(), GetToken(), and VarLook().

SwSbxValue SwCalc::m_nLastLeft
private

Definition at line 191 of file calc.hxx.

Referenced by Expr(), Term(), and VarLook().

sal_uInt16 SwCalc::m_nListPor
private

Definition at line 201 of file calc.hxx.

Referenced by Calculate(), Expr(), PrimFunc(), and VarLook().

SwSbxValue SwCalc::m_nNumberValue
private

Definition at line 192 of file calc.hxx.

Referenced by GetToken(), PrimFunc(), and VarLook().

CharClass* SwCalc::m_pCharClass
private

Definition at line 199 of file calc.hxx.

Referenced by GetCharClass(), GetToken(), SwCalc(), VarChange(), VarInsert(), VarLook(), and ~SwCalc().

const LocaleDataWrapper* SwCalc::m_pLocaleDataWrapper
private

Definition at line 198 of file calc.hxx.

Referenced by GetStrResult(), SwCalc(), VarLook(), and ~SwCalc().

SwDoc& SwCalc::m_rDoc
private

Definition at line 196 of file calc.hxx.

Referenced by GetDBName(), SwCalc(), Term(), and VarLook().

OUString SwCalc::m_sCommand
private

Definition at line 189 of file calc.hxx.

Referenced by Calculate(), GetToken(), and VarLook().

OUString SwCalc::m_sCurrSym
private

Definition at line 188 of file calc.hxx.

Referenced by GetToken(), and SwCalc().


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