LibreOffice Module sc (master) 1
|
A helper with Excel specific token array functions. More...
#include <xlformula.hxx>
Static Public Member Functions | |
static sal_uInt8 | GetTokenId (sal_uInt8 nBaseId, sal_uInt8 nTokenClass) |
Returns the classified token ID from a base ID and the token class. More... | |
static sal_uInt8 | GetTokenClass (sal_uInt8 nTokenId) |
Returns the token class of the passed token ID. More... | |
static void | ChangeTokenClass (sal_uInt8 &rnTokenId, sal_uInt8 nTokenClass) |
Changes the token class in the passed classified token ID. More... | |
static bool | GetTokenString (OUString &rString, const ::formula::FormulaToken &rScToken) |
Tries to extract a string from the passed token. More... | |
static bool | GetString (OUString &rString, const ScTokenArray &rScTokArr) |
Parses the passed formula and tries to find a single string token, i.e. More... | |
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. More... | |
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. More... | |
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. More... | |
A helper with Excel specific token array functions.
The purpose to not add these functions to ScTokenArray is to prevent code changes in low-level Calc headers and to keep the Excel specific source code in the filter directory. Deriving from ScTokenArray is not viable because that would need expensive copy-constructions of the token arrays.
Definition at line 485 of file xlformula.hxx.
|
inlinestatic |
Changes the token class in the passed classified token ID.
Definition at line 544 of file xlformula.hxx.
References EXC_TOKCLASS_MASK, get_flag(), and set_flag().
Referenced by XclExpFmlaCompImpl::RecalcTokenClass().
|
static |
Tries to convert a formula that consists of a single string token to a list of strings.
Removes leading spaces from each token. @descr Example: The formula ="abc\ndef\nghi" will be converted to the formula ="abc";"def";"ghi", if the LF character is specified as separator.
rScTokArr | (in/out-parameter) The token array to modify. |
cStringSep | The separator in the source string. |
Definition at line 921 of file xlformula.cxx.
References ScTokenArray::AddOpCode(), formula::FormulaTokenArray::AddString(), ScTokenArray::Clear(), GetString(), svl::SharedStringPool::intern(), ocSep, and comphelper::string::stripStart().
Referenced by XclImpValidationManager::ReadDV().
|
static |
Parses the passed formula and tries to extract references of a multiple operation.
@descr Requires that the formula contains a single MULTIPLE.OPERATION function call. Spaces in the formula are silently ignored.
Definition at line 961 of file xlformula.cxx.
References XclTokenArrayIterator::Is(), XclMultipleOpRefs::maColFirstScPos, XclMultipleOpRefs::maColRelScPos, XclMultipleOpRefs::maFmlaScPos, XclMultipleOpRefs::maRowFirstScPos, XclMultipleOpRefs::maRowRelScPos, XclMultipleOpRefs::mbDblRefMode, ocClose, ocOpen, ocSep, and ocTableOp.
Referenced by XclExpTableopBuffer::CreateOrExtendTableop().
|
static |
Parses the passed formula and tries to find a single string token, i.e.
"abc".
rString | (out-parameter) The string contained in the formula. |
Definition at line 886 of file xlformula.cxx.
References GetTokenString(), and XclTokenArrayIterator::Is().
Referenced by ConvertStringToList().
|
static |
Parses the passed formula and tries to find a string token list, i.e.
"abc";"def";"ghi". @descr Returns the unquoted (!) strings in a single string, separated with the passed character. If a comma is specified, the function will return abc,def,ghi from the example above.
rStringList | (out-parameter) All strings contained in the formula as list. |
cSep | List separator character. |
Definition at line 893 of file xlformula.cxx.
References formula::FormulaToken::GetOpCode(), GetTokenString(), XclTokenArrayIterator::Is(), and ocSep.
Referenced by XclExpDV::XclExpDV().
Returns the token class of the passed token ID.
Definition at line 494 of file xlformula.hxx.
References EXC_TOKCLASS_MASK.
Referenced by XclExpFmlaCompImpl::RecalcTokenClass().
Returns the classified token ID from a base ID and the token class.
Definition at line 537 of file xlformula.hxx.
References EXC_TOKCLASS_MASK, EXC_TOKID_MASK, and get_flag().
Referenced by XclExpFmlaCompImpl::AppendFuncToken(), XclExpFmlaCompImpl::AppendLogicalOperatorToken(), XclExpFmlaCompImpl::AppendNameToken(), XclExpFmlaCompImpl::AppendNameXToken(), XclExpFmlaCompImpl::ListTerm(), XclExpFmlaCompImpl::ProcessCellRef(), XclExpFmlaCompImpl::ProcessExternalCellRef(), XclExpFmlaCompImpl::ProcessExternalRangeRef(), XclExpFmlaCompImpl::ProcessMatrix(), XclExpFmlaCompImpl::ProcessRangeRef(), XclImpDrawObjBase::ReadMacro8(), and XclImpPictureObj::ReadPictFmla().
|
static |
Tries to extract a string from the passed token.
rString | (out-parameter) The string contained in the token. |
Definition at line 879 of file xlformula.cxx.
References ocPush, and svString.
Referenced by GetString(), and GetStringList().