summaryrefslogtreecommitdiffstats
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-04 13:08:23 +0100
commit8cf4c3157348edb9e4e0c453436b26f7200ecb6c (patch)
treeed3e5ced448774f3024e0d901cf4b915f9272504 /include
parenttdf#118893: avoid nullptr dereference (diff)
downloadcore-8cf4c3157348edb9e4e0c453436b26f7200ecb6c.tar.gz
core-8cf4c3157348edb9e4e0c453436b26f7200ecb6c.zip
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 (cherry picked from commit c98cd883be11ff931ae903469f56cfd5b5f4fd66) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89906
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 1d6655e50712..d6fd1890a993 100644
--- a/include/xmloff/table/XMLTableExport.hxx
+++ b/include/xmloff/table/XMLTableExport.hxx
@@ -41,6 +41,7 @@
#include <salhelper/simplereferenceobject.hxx>
#include <xmloff/xmlprmap.hxx>
#include <xmloff/xmlexppr.hxx>
+#include <xmloff/styleexp.hxx>
class SvXMLExport;
class SvXMLExportPropertyMapper;
@@ -95,6 +96,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 7bed9eb22643..76dfcc69d953 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -403,6 +403,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();