Calc functions and Calc option 'convert text to number'

Winfried Donkers Winfried.Donkers at dekimo.com
Thu Jul 12 10:51:30 UTC 2018


Hi Eike,

I'm working on tdf64132, which is about SUM and text values that are not converted to numbers.
SUM uses ScInterpreter::IterateParameters(), which is used by various other Calc functions as well.
ScInterpreter::IterateParameters() does not handle the configuration settings for converting text to numbers properly.

For stack type svString I have a patch almost ready. The unit test is a problem for me, as the 'convert text to numbers' configuration is not in the test document and therefore unknown.

But the larger challenge lies with stack type svDoubleRef (probably the most used one). Here a sc::ColumnSpanSet is used with sc::ColumnSpanSet::ColumnAction (a.o. FuncSum), which in turn uses NumericCellAccumulator. And that class handles only sc::element_type_numeric and sc::element_type_formula, so text is discarded. I could add sc::element_type_string and the conversion to numbers depending on the configuration settings.
As that will have consequences beyond the Calc functions SUM and the like, I would like you opinion on this before I start implementing.
And all this leads to the question if all Calc functions expecting numeric arguments handle the 'convert tekst to numbers' configuration as advertised. It looks like I can keep myself occupied for quite some time with this ;-)

Winfried

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20180712/8bd1faaa/attachment.html>


More information about the LibreOffice mailing list