diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-02-09 12:01:39 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-02-09 14:59:38 +0100 |
commit | 789964785a61daab5f8065f006dd7aaf843c7236 (patch) | |
tree | f44c4b3771fa283b1396064c05b0ac53e9664bb5 /svtools | |
parent | e95ce2620267e04bc89eb701a3df8ded7c3b729f (diff) |
tdf#159483 sc HTML import: handle data-sheets-value attribute for the num case
E.g. have "1,000.00" and "2,000.00" in two cells, paste that into calc,
and try to do a SUM() on them, which will fail because the cell content
is text.
Just data-sheets-value itself would not be good solution, because then
we would lose the number format, so the paste result would be like 1000,
which is bad for readability if you don't want further operations on the
value.
Fix the problem by also parsing the data-sheets-numberformat attribute,
so far what's clear is that the "2" JSON key there provides a number
format string which matches the syntax of Excel/Calc.
This gives the best of the two worlds: the output looks like the
original, but SUM() works on the cells as well.
Change-Id: Ic7c09ba55a51852f285ad0c05ed42c6771b0f500
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163152
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/svhtml/htmlkywd.cxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/svtools/source/svhtml/htmlkywd.cxx b/svtools/source/svhtml/htmlkywd.cxx index f5799434b72a..a3dff93f9b4f 100644 --- a/svtools/source/svhtml/htmlkywd.cxx +++ b/svtools/source/svhtml/htmlkywd.cxx @@ -526,6 +526,7 @@ static HTML_OptionEntry aHTMLOptionTab[] = { {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDval), HtmlOptionId::SDVAL}, // StarDiv NumberValue {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_DSval), HtmlOptionId::DSVAL}, {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDnum), HtmlOptionId::SDNUM}, // StarDiv NumberFormat + {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_DSnum), HtmlOptionId::DSNUM}, {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_sdlibrary), HtmlOptionId::SDLIBRARY}, {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_sdmodule), HtmlOptionId::SDMODULE}, |