20#ifndef INCLUDED_SW_INC_CALC_HXX
21#define INCLUDED_SW_INC_CALC_HXX
28#include <rtl/ustrbuf.hxx>
166 T*
Find( std::u16string_view aStr, sal_uInt32* pPos =
nullptr )
const
168 size_t nTableSize =
m_aData.size();
171 for(
size_t n = 0;
n <
aStr.size(); ++
n )
173 ii = ii << 1 ^
aStr[
n];
180 for( T* pEntry =
m_aData[ii].
get(); pEntry; pEntry =
static_cast<T*
>(pEntry->pNext.get()) )
182 if(
aStr == pEntry->aStr )
197extern "C" typedef double (*
pfCalc)(double);
229 OUString
GetDBName( std::u16string_view rName );
247 void VarChange(
const OUString& rStr,
double );
259 static bool Str2Double(
const OUString& rStr, sal_Int32& rPos,
261 static bool Str2Double(
const OUString& rStr, sal_Int32& rPos,
262 double& rVal,
SwDoc const *
const pDoc );
267 OUString* pValidName =
nullptr );
const sal_Unicode cListDelim
CalcOp * FindOperator(const OUString &rSearch)
const char sCalc_Product[]
const char sCalc_Average[]
OUString GetStrResult(const SwSbxValue &rValue)
void SetCalcError(SwCalcError eErr)
static SW_DLLPUBLIC bool IsValidVarName(const OUString &rStr, OUString *pValidName=nullptr)
OUStringBuffer m_aVarName
const CharClass * GetCharClass() const
std::vector< const SwUserFieldType * > m_aRekurStack
void VarChange(const OUString &rStr, const SwSbxValue &rValue)
SwSbxValue StdFunc(pfCalc pFnc, bool bChkTrig)
SwHashTable< SwCalcExp > & GetVarTable()
SwCalcExp * VarInsert(const OUString &r)
SwCalc(const SwCalc &)=delete
void SetCharClass(const LanguageTag &rLanguageTag)
SwSbxValue Calculate(const OUString &rStr)
SwSbxValue PrimFunc(bool &rChkPow)
bool Push(const SwUserFieldType *pUserFieldType)
SwCalc & operator=(const SwCalc &)=delete
SwCalcExp * VarLook(const OUString &rStr, bool bIns=false)
static OUString GetColumnName(const OUString &rName)
static LanguageType GetDocAppScriptLang(SwDoc const &rDoc)
SwHashTable< SwCalcExp > m_aVarTable
OUString GetDBName(std::u16string_view rName)
static bool Str2Double(const OUString &rStr, sal_Int32 &rPos, double &rVal)
SwSbxValue m_nNumberValue
bool IsCalcNotANumber() const
std::unique_ptr< LocaleDataWrapper > m_xLocaleDataWrapper
SwCalcOper m_eCurrListOper
Instances of SwFields and those derived from it occur 0 to n times.
T should be a subclass of SwHash.
std::unique_ptr< T > const & operator[](size_t idx) const
T * Find(std::u16string_view aStr, sal_uInt32 *pPos=nullptr) const
void resize(size_t nSize)
std::vector< std::unique_ptr< T > > m_aData
std::unique_ptr< T > & operator[](size_t idx)
SwHashTable(size_t nSize)
void SetVoidValue(bool bSet)
SwSbxValue & MakeDouble()
SwSbxValue(tools::Long n=0)
void SetDBvalue(bool bSet)
SwSbxValue(const double &rD)
The shared part of a user field.
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SwCalcExp(const OUString &rStr, SwSbxValue aVal, const SwFieldType *pFieldType)
const SwFieldType * pFieldType
std::unique_ptr< SwHash > pNext