summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2020-02-21 02:35:55 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-03-03 18:22:37 +0100
commitc98cd883be11ff931ae903469f56cfd5b5f4fd66 (patch)
tree81c6ffb4a33538aaae42ef61cbcc372d2bd6d539 /include
parent9691219ae7dce548d24952e335109d546b295a9a (diff)
tdf#101710 Fix invalid style:data-style-name attribute
There were two problems with this attribute: 1. It was written in style:table-cell-properties instead of in style:style. 2. It was referencing a number format id, instead of a style name. Moreover, the data style wasn't even exported as part of office:styles (if at all). Both import and export were affected. For export, it was easily possible to reuse some related stuff from Calc, so that stuff was moved into xmloff and used from there (there are no logic changes for Calc). For import, loading of the invalid attribute was kept for compat reasons. Although it's only useful for automatic number formats, as the data styles weren't exported properly anyway (e.g. see the document attached in bugzilla). Conflicts: sw/qa/extras/odfexport/odfexport.cxx sw/source/filter/xml/xmlfmt.cxx xmloff/source/table/XMLTableExport.cxx Change-Id: I8b70ad205972fada6f3845837d6ed5928d7d6406 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89551 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 59ace23c367f83491a37e844d16f7d716eff6346) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89774
Diffstat (limited to 'include')
-rw-r--r--include/xmloff/table/XMLTableExport.hxx8
-rw-r--r--include/xmloff/xmlexp.hxx1
2 files changed, 9 insertions, 0 deletions
diff --git a/include/xmloff/table/XMLTableExport.hxx b/include/xmloff/table/XMLTableExport.hxx
index d8f037efe56a..f49a4236e2d0 100644
--- a/include/xmloff/table/XMLTableExport.hxx
+++ b/include/xmloff/table/XMLTableExport.hxx
@@ -38,6 +38,7 @@
#include <salhelper/simplereferenceobject.hxx>
#include <xmloff/prhdlfac.hxx>
#include <xmloff/xmlexppr.hxx>
+#include <xmloff/styleexp.hxx>
class SvXMLExport;
class SvXMLExportPropertyMapper;
@@ -92,6 +93,13 @@ private:
};
+class XMLOFF_DLLPUBLIC XMLCellStyleExport final : public XMLStyleExport
+{
+ using XMLStyleExport::XMLStyleExport;
+ virtual void exportStyleAttributes(const css::uno::Reference<css::style::XStyle>& rStyle) override;
+ virtual void exportStyleContent(const css::uno::Reference<css::style::XStyle>& rStyle) override;
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index b413f00b922a..2af1f4994f06 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -401,6 +401,7 @@ public:
// Export the document.
virtual ErrCode exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID );
+ void collectDataStyles(bool bFromUsedStyles);
virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat = false );
virtual void exportDataStyles();
virtual void exportAutoDataStyles();