20 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XLFORMULA_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_XLFORMULA_HXX
23 #include <osl/diagnose.h>
32 class SharedStringPool;
362 typedef ::std::map< sal_uInt16, const XclFunctionInfo* >
XclFuncMap;
364 typedef ::std::map< OpCode, const XclFunctionInfo* >
ScFuncMap;
426 namespace formula {
class FormulaToken; }
504 static bool GetTokenString( OUString& rString, const ::formula::FormulaToken& rScToken );
540 OSL_ENSURE( !::
get_flag( nBaseId, static_cast< sal_uInt8 >( ~
EXC_TOKID_MASK ) ),
"XclTokenArrayHelper::GetTokenId - invalid token ID" );
541 OSL_ENSURE( !::
get_flag( nTokenClass, static_cast< sal_uInt8 >( ~
EXC_TOKCLASS_MASK ) ),
"XclTokenArrayHelper::GetTokenId - invalid token class" );
542 return nBaseId | nTokenClass;
547 OSL_ENSURE( !::
get_flag( nTokenClass, static_cast< sal_uInt8 >( ~
EXC_TOKCLASS_MASK ) ),
"XclTokenArrayHelper::ChangeTokenClass - invalid token class" );
const XclFunctionInfo * GetFuncInfoFromXclMacroName(const OUString &rXclMacroName) const
Returns the function data for an Excel function simulated by a macro call, or 0 on error...
static void ChangeTokenClass(sal_uInt8 &rnTokenId, sal_uInt8 nTokenClass)
Changes the token class in the passed classified token ID.
const XclFunctionInfo * GetFuncInfoFromXclFunc(sal_uInt16 nXclFunc) const
Returns the function data for an Excel function index, or 0 on error.
ScAddress maRowFirstScPos
This class is used to export Excel record streams.
bool IsFixedParamCount() const
Returns true, if the function parameter count is fixed.
void FillXclFuncMap(const XclFunctionInfo *pBeg, const XclFunctionInfo *pEnd)
bool mbValType
Token class conversion type.
bool IsMacroFunc() const
Returns true, if the function is simulated by a macro call.
static bool GetStringList(OUString &rStringList, const ScTokenArray &rScTokArr, sal_Unicode cSep)
Parses the passed formula and tries to find a string token list, i.e.
static bool GetTokenString(OUString &rString, const ::formula::FormulaToken &rScToken)
Tries to extract a string from the passed token.
sal_uInt16 GetSize() const
Returns the size of the token array in bytes.
void Write(XclExpStream &rStrm) const
Writes size field and the tokens.
::std::map< OpCode, const XclFunctionInfo * > ScFuncMap
void WriteSize(XclExpStream &rStrm) const
Writes the size field of the token array.
static sal_uInt8 GetTokenId(sal_uInt8 nBaseId, sal_uInt8 nTokenClass)
Returns the classified token ID from a base ID and the token class.
bool Empty() const
Returns true, if the token array is empty.
void WriteArray(XclExpStream &rStrm) const
Writes the tokens of the token array (without size field).
const sal_uInt8 * GetData() const
Returns read-only access to the byte vector storing token data.
XclMacroNameMap maXclMacroNameMap
Maps Excel function indexes to function data.
bool mbSkipSpaces
Pointer to current token pointer of token array.
const ::formula::FormulaToken *const * mppScTokenEnd
Pointer to first token pointer of token array.
void ReadArray(XclImpStream &rStrm)
Reads the tokens of the token array (without size field).
Represents information for a spreadsheet function for import and export.
XclFuncParamValidity meValid
OUString GetAddInEquivalentFuncName() const
Returns the programmatical name of the Add-In function as string.
const XclFunctionInfo * GetFuncInfoFromOpCode(OpCode eOpCode) const
Returns the function data for a Calc opcode, or 0 on error.
ScfUInt8Vec maExtDataVec
Byte vector containing token data.
ScFuncMap maScFuncMap
Maps macro function names to function data.
sal_uInt8 mnRetClass
Maximum number of parameters.
XclTokenArray(bool bVolatile=false)
Creates an empty token array.
sal_uInt8 mnMaxParamCount
Minimum number of parameters.
const ::formula::FormulaToken * Get() const
void FillScFuncMap(const XclFunctionInfo *pBeg, const XclFunctionInfo *pEnd)
const char * mpcMacroName
Additional flags (EXC_FUNCFLAG_* constants).
sal_uInt8 mnMinParamCount
Excel function index.
Provides access to function info structs for all available functions.
void ReadSize(XclImpStream &rStrm)
Reads the size field of the token array.
bool IsParamPairs() const
Returns true, if optional parameters are expected to appear in pairs.
XclTokenArrayIterator & operator++()
Binary representation of an Excel token array.
static sal_uInt8 GetTokenClass(sal_uInt8 nTokenId)
Returns the token class of the passed token ID.
::std::map< sal_uInt16, const XclFunctionInfo * > XclFuncMap
Contains all cell references that can be extracted from a multiple operations formula.
bool IsVolatile() const
Returns true, if the formula contains a volatile function.
const ::formula::FormulaToken *const * mppScToken
Pointer behind last token pointer of token array.
void Read(XclImpStream &rStrm)
Reads size field and the tokens.
const ::formula::FormulaToken * operator->() const
XclFuncParamConv meConv
Parameter validity.
These need to be in global namespace just like their respective types are.
const ::formula::FormulaToken & operator*() const
bool operator==(const XclTokenArray &rTokArr) const
Compares this token array with the passed.
static void ConvertStringToList(ScTokenArray &rScTokArr, svl::SharedStringPool &rSPool, sal_Unicode cStringSep)
Tries to convert a formula that consists of a single string token to a list of strings.
static bool GetString(OUString &rString, const ScTokenArray &rScTokArr)
Parses the passed formula and tries to find a single string token, i.e.
bool IsVolatile() const
Function name, if simulated by a macro call (UTF-8) EXC_FUNCFLAG_ADDINEQUIV is 0; or programmatical a...
::std::map< OUString, const XclFunctionInfo * > XclMacroNameMap
This class is used to import record oriented streams.
void Init(const ScTokenArray &rScTokArr, bool bSkipSpaces)
A helper with Excel specific token array functions.
bool IsAddInEquivalent() const
Returns true, if the function is stored as an add-in call.
sal_uInt8 mnFlags
Information for all parameters.
Special token array iterator for the Excel filters.
const ::formula::FormulaToken *const * mppScTokenBeg
Access to global data for a filter object (imported or exported document) from other classes...
bool mbVolatile
Byte vector containing extended data (arrays, stacked NLRs).
XclFunctionProvider(const XclRoot &rRoot)
sal_uInt16 mnXclFunc
Calc function opcode.
static bool GetMultipleOpRefs(const ScDocument &rDoc, XclMultipleOpRefs &rRefs, const ScTokenArray &rScTokArr, const ScAddress &rScPos)
Parses the passed formula and tries to extract references of a multiple operation.
XclFuncParamInfo mpParamInfos[EXC_FUNCINFO_PARAMINFO_COUNT]
Token class of the return value.
Structure that contains all needed information for a parameter in a function.
ScAddress maColFirstScPos
Position of the (first) formula cell.
OUString GetMacroFuncName() const
Returns the name of the external function as string.