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 ()
 
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 ()
 
const CharClassGetCharClass () const
 
void SetCharClass (const LanguageTag &rLanguageTag)
 
void SetCalcError (SwCalcError eErr)
 
bool IsCalcError () const
 
bool IsCalcNotANumber () 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 LanguageType GetDocAppScriptLang (SwDoc const &rDoc)
 
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 (std::u16string_view rName)
 
 SwCalc (const SwCalc &)=delete
 
SwCalcoperator= (const SwCalc &)=delete
 
void ImplDestroy ()
 

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
 
std::unique_ptr< LocaleDataWrapperm_xLocaleDataWrapper
 
CharClassm_pCharClass
 
sal_uInt16 m_nListPor
 
bool m_bHasNumber
 
SwCalcOper m_eCurrOper
 
SwCalcOper m_eCurrListOper
 
SwCalcError m_eError
 

Detailed Description

Definition at line 199 of file calc.hxx.

Constructor & Destructor Documentation

◆ SwCalc() [1/2]

SwCalc::SwCalc ( const SwCalc )
privatedelete

◆ SwCalc() [2/2]

SwCalc::SwCalc ( SwDoc rD)

◆ ~SwCalc()

SwCalc::~SwCalc ( )

Definition at line 358 of file calc.cxx.

References ImplDestroy(), and suppress_fun_call_w_exception.

Member Function Documentation

◆ Calculate()

SwSbxValue SwCalc::Calculate ( const OUString &  rStr)

◆ Expr()

SwSbxValue SwCalc::Expr ( )
private

Definition at line 1309 of file calc.cxx.

References CALC_MINUS, CALC_PLUS, GetToken(), left, m_eCurrOper, m_nLastLeft, m_nListPor, right, SbxMINUS, SbxPLUS, and Term().

Referenced by Calculate(), and PrimFunc().

◆ GetCharClass()

const CharClass * SwCalc::GetCharClass ( ) const

Definition at line 632 of file calc.cxx.

References m_pCharClass.

Referenced by SwUserFieldType::GetValue().

◆ GetColumnName()

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

Definition at line 1344 of file calc.cxx.

References DB_DELIM, and nPos.

Referenced by VarLook().

◆ GetDBName()

OUString SwCalc::GetDBName ( std::u16string_view  rName)
private

Definition at line 1357 of file calc.cxx.

References SL::aData, DB_DELIM, SwDoc::GetDBData(), m_rDoc, and nPos.

Referenced by VarLook().

◆ GetDocAppScriptLang()

LanguageType SwCalc::GetDocAppScriptLang ( SwDoc const &  rDoc)
static

◆ GetStrResult() [1/2]

OUString SwCalc::GetStrResult ( const SwSbxValue rValue)

◆ GetStrResult() [2/2]

OUString SwCalc::GetStrResult ( double  nValue)

◆ GetToken()

SwCalcOper SwCalc::GetToken ( )
private

◆ GetVarTable()

SwHashTable< SwCalcExp > & SwCalc::GetVarTable ( )
inline

Definition at line 248 of file calc.hxx.

References m_aVarTable.

Referenced by SwEditShell::Calculate().

◆ ImplDestroy()

void SwCalc::ImplDestroy ( )
private

Definition at line 352 of file calc.cxx.

References GetAppCharClass(), and m_pCharClass.

Referenced by ~SwCalc().

◆ IsCalcError()

bool SwCalc::IsCalcError ( ) const
inline

◆ IsCalcNotANumber()

bool SwCalc::IsCalcNotANumber ( ) const
inline

Definition at line 257 of file calc.hxx.

References m_eError, and NaN.

Referenced by SwTableFormula::MakeFormula_().

◆ IsValidVarName()

bool SwCalc::IsValidVarName ( const OUString &  rStr,
OUString *  pValidName = nullptr 
)
static

◆ operator=()

SwCalc & SwCalc::operator= ( const SwCalc )
privatedelete

◆ Pop()

void SwCalc::Pop ( )

Definition at line 625 of file calc.cxx.

References m_aRekurStack.

Referenced by SwUserFieldType::GetValue().

◆ Prim()

SwSbxValue SwCalc::Prim ( )
private

◆ PrimFunc()

SwSbxValue SwCalc::PrimFunc ( bool &  rChkPow)
private

◆ Push()

bool SwCalc::Push ( const SwUserFieldType pUserFieldType)

Definition at line 616 of file calc.cxx.

References m_aRekurStack.

Referenced by SwUserFieldType::GetValue().

◆ SetCalcError()

void SwCalc::SetCalcError ( SwCalcError  eErr)
inline

◆ SetCharClass()

void SwCalc::SetCharClass ( const LanguageTag rLanguageTag)

Definition at line 637 of file calc.cxx.

References m_pCharClass.

Referenced by SwUserFieldType::GetValue().

◆ StdFunc()

SwSbxValue SwCalc::StdFunc ( pfCalc  pFnc,
bool  bChkTrig 
)
private

Definition at line 1048 of file calc.cxx.

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

Referenced by PrimFunc().

◆ Str2Double() [1/2]

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

Definition at line 1393 of file calc.cxx.

References SvtSysLocale::GetLocaleData().

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

◆ Str2Double() [2/2]

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

◆ Term()

SwSbxValue SwCalc::Term ( )
private

◆ VarChange() [1/2]

void SwCalc::VarChange ( const OUString &  rStr,
const SwSbxValue rValue 
)

◆ VarChange() [2/2]

void SwCalc::VarChange ( const OUString &  rStr,
double  nValue 
)

Definition at line 591 of file calc.cxx.

References nValue, and VarChange().

◆ VarInsert()

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

Definition at line 423 of file calc.cxx.

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

Referenced by PrimFunc().

◆ VarLook()

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

Member Data Documentation

◆ m_aErrExpr

SwCalcExp SwCalc::m_aErrExpr
private

Definition at line 208 of file calc.hxx.

Referenced by SwCalc(), and VarLook().

◆ m_aRekurStack

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

Definition at line 205 of file calc.hxx.

Referenced by Pop(), and Push().

◆ m_aVarName

OUStringBuffer SwCalc::m_aVarName
private

Definition at line 202 of file calc.hxx.

Referenced by GetToken(), and PrimFunc().

◆ m_aVarTable

SwHashTable<SwCalcExp> SwCalc::m_aVarTable
private

Definition at line 201 of file calc.hxx.

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

◆ m_bHasNumber

bool SwCalc::m_bHasNumber
private

Definition at line 216 of file calc.hxx.

Referenced by PrimFunc(), and VarLook().

◆ m_eCurrListOper

SwCalcOper SwCalc::m_eCurrListOper
private

Definition at line 218 of file calc.hxx.

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

◆ m_eCurrOper

SwCalcOper SwCalc::m_eCurrOper
private

Definition at line 217 of file calc.hxx.

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

◆ m_eError

SwCalcError SwCalc::m_eError
private

◆ m_nCommandPos

sal_Int32 SwCalc::m_nCommandPos
private

Definition at line 209 of file calc.hxx.

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

◆ m_nLastLeft

SwSbxValue SwCalc::m_nLastLeft
private

Definition at line 206 of file calc.hxx.

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

◆ m_nListPor

sal_uInt16 SwCalc::m_nListPor
private

Definition at line 215 of file calc.hxx.

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

◆ m_nNumberValue

SwSbxValue SwCalc::m_nNumberValue
private

Definition at line 207 of file calc.hxx.

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

◆ m_pCharClass

CharClass* SwCalc::m_pCharClass
private

◆ m_rDoc

SwDoc& SwCalc::m_rDoc
private

Definition at line 211 of file calc.hxx.

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

◆ m_sCommand

OUString SwCalc::m_sCommand
private

Definition at line 204 of file calc.hxx.

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

◆ m_sCurrSym

OUString SwCalc::m_sCurrSym
private

Definition at line 203 of file calc.hxx.

Referenced by GetToken(), and SwCalc().

◆ m_xLocaleDataWrapper

std::unique_ptr<LocaleDataWrapper> SwCalc::m_xLocaleDataWrapper
private

Definition at line 212 of file calc.hxx.

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


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