diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-02-12 08:16:20 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-02-12 10:58:35 +0100 |
commit | d6f7e30a317e3c239cb0ba8f7e92ea1bac8cb3fc (patch) | |
tree | 97da1c6e1ed4c7001d38cc7683c5490f97834c22 /include | |
parent | fbe0fe6ccc2a0d83695cde653f5f377f01d8dc9f (diff) |
tdf#159483 sc HTML paste: handle data-sheets-formula attribute
When a formula cell gets copied from google docs, the value of the <td>
element only contains the formula result. This means once value cells
and formula cells gets copied together, the pasted formula cell won't
updated anymore when the input values change.
Turns out there is a data-sheets-formula attribute on <td> that contains
the formula, it seems it uses the R1C1 format.
Fix the problem by extending ScHTMLLayoutParser::TableDataOn() to parse
this attribute and set a formula on the target cell (rather than a
value) if the formula is available.
This required also extending ScEEImport a bit, since the HTML paste
builds on top of the RTF one in Calc.
(cherry picked from commit 7812adb2ed11a3e08be24d3f2f94d14bfd740c55)
Change-Id: I720df96ce74a5e865b7329d06f3b719551f31b96
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/htmlkywd.hxx | 1 | ||||
-rw-r--r-- | include/svtools/htmltokn.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/svtools/htmlkywd.hxx b/include/svtools/htmlkywd.hxx index 80e47b100187..36e853960feb 100644 --- a/include/svtools/htmlkywd.hxx +++ b/include/svtools/htmlkywd.hxx @@ -448,6 +448,7 @@ #define OOO_STRING_SVTOOLS_HTML_O_DSval "data-sheets-value" #define OOO_STRING_SVTOOLS_HTML_O_SDnum "sdnum" #define OOO_STRING_SVTOOLS_HTML_O_DSnum "data-sheets-numberformat" +#define OOO_STRING_SVTOOLS_HTML_O_DSformula "data-sheets-formula" #define OOO_STRING_SVTOOLS_HTML_O_sdlibrary "sdlibrary" #define OOO_STRING_SVTOOLS_HTML_O_sdmodule "sdmodule" #define OOO_STRING_SVTOOLS_HTML_O_sdevent "sdevent-" diff --git a/include/svtools/htmltokn.h b/include/svtools/htmltokn.h index 21fcec800a9a..89d8ee868535 100644 --- a/include/svtools/htmltokn.h +++ b/include/svtools/htmltokn.h @@ -347,6 +347,7 @@ STRING_START = BOOL_END, DSVAL, SDNUM, // StarDiv NumberFormat DSNUM, + DSFORMULA, SDLIBRARY, SDMODULE, STRING_END, |