multiple variants of toUpper (etc)
some that take a non-const OUString or String and modify it
some that take a const OUString or String and return a new one
some that take part of a const OUString or String and return a new one
Older releases stored a few function names not defined by ODFF, namely
EASTERSUNDAY instead of ORG.OPENOFFICE.EASTERSUNDAY, TDIST instead of
LEGACY.TDIST and B instead of BINOM.DIST.RANGE.
Since OOo/LibO 3.3 the proper function names can be read, additionally to the
"wrong" names. Now it's time to write the proper names and still accept the
incorrect ones.
Test cases are attached to AOOo issues:
ORG.OPENOFFICE.EASTERSUNDAY
https://issues.apache.org/ooo/show_bug.cgi?id=112882
LEGACY.TDIST and BINOM.DIST.RANGE
https://issues.apache.org/ooo/show_bug.cgi?id=110229
Note that the FALSE in A2 and A3 is a result of the string comparison of the
actual formula, that differs in separators (, vs ;) only.
(cherry picked from commit a9b03bd199)
We need to map Excel's database ranges (or in Excel's terminology
"tables") to named db ranges because they may be referenced in formula
expressions. Also, Excel tables are always of the form Table*[] when
used in formulas. Skip the "[]" part then the preceding token is a
valid database range.
During XML import formulas of defined names and conditional formatting
were remembered as regular svString tokens that then later were
retrieved without quotes for compilation. This didn't go along with the
new ScRangeData::CompileUnresolvedXML() that recreates the formula
string from an already tokenized form of the formula.
Introduced FormulaToken::AddStringXML() with ocStringXML to sort those
out and removed the IsImportingXML() hack from
FormulaCompiler::AppendString(), the ocStringXML case is handled in
FormulaCompiler::CreateStringFromToken().
Implements BITAND, BITOR, BITXOR, BITLSHIFT and BITRSHIFT as specified by
OASIS OpenDocument Format 1.2 OpenFormula / ODFF.
Changes made by the committer:
* Original submission added the new functions to the Logical group, that group
has only functions though that return a logical value 1/0/true/false. ODFF
groups them under "Bit operation functions" that currently is not available
in Calc. Added the functions to the Mathematical group instead.
* Changed descriptions of functions in the Function Wizard.
* One sal_uInt64 constant instead of several identical literal 281474976710655
values.
* Replaced 'or' operators with ||
* Don't push two return values, if PushIllegalArgument() was used don't use
PushDouble() thereafter.
* Treat double values with ::rtl::math::approxFloor() to obtain integer
values.
* For BITLSHIFT and BITRSHIFT implemented a different algorithm following the
ODFF specification that allows larger shift values.
* Use our block braces style, respectively don't use block braces for one-line
if-statements.
* Fixed indentation levels.
* Adapted RTL_LOGFILE_CONTEXT_AUTHOR to say "pechlaner". Credit to whom credit
is due ;-)