path: root/sw/qa
diff options
authorMaxim Monastirsky <>2020-02-21 02:35:55 +0200
committerMichael Stahl <>2020-02-27 19:04:33 +0100
commit59ace23c367f83491a37e844d16f7d716eff6346 (patch)
treeaf47d9b808037e3af045678b60b73e47b6f1121f /sw/qa
parent5352d45dd4a04f8f02cf7f6ad4169126d3b3586a (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). Change-Id: I8b70ad205972fada6f3845837d6ed5928d7d6406 Reviewed-on: Tested-by: Jenkins Reviewed-by: Michael Stahl <>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/odfexport/data/tdf101710.odtbin0 -> 9350 bytes
2 files changed, 7 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/tdf101710.odt b/sw/qa/extras/odfexport/data/tdf101710.odt
new file mode 100644
index 000000000000..50ab736070aa
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf101710.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index a7af9a7f3553..6f8a78ac501b 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2007,6 +2007,13 @@ DECLARE_ODFEXPORT_TEST(testTableStyles5, "table_styles_5.odt")
+DECLARE_ODFEXPORT_TEST(testTdf101710, "tdf101710.odt")
+ // Test that number format of cell styles can be imported and exported.
+ uno::Reference<beans::XPropertySet> xStyle(getStyles("CellStyles")->getByName("Test Style.11"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(10104), getProperty<sal_uInt32>(xStyle, "NumberFormat"));
DECLARE_ODFEXPORT_TEST(testTdf129568, "tdf129568.fodt")
// Test that export doesn't fail, and that style is imported and in use.