summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2024-02-12 08:16:20 +0100
committerMiklos Vajna <vmiklos@collabora.com>2024-02-12 09:20:19 +0100
commit7812adb2ed11a3e08be24d3f2f94d14bfd740c55 (patch)
tree08d3cff5be4bcf1362d6ec30f2bb770670aacf90 /include
parenta476aa8d222a949a67676d95ec07914bbf00e23b (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. Change-Id: I720df96ce74a5e865b7329d06f3b719551f31b96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163234 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'include')
-rw-r--r--include/svtools/htmlkywd.hxx1
-rw-r--r--include/svtools/htmltokn.h1
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,