From b8fa395288a1f3a24a4fca392afdf3a9b58373ea Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Fri, 16 Dec 2016 19:51:55 +0300 Subject: tdf#104713 writerfilter: parentless styles - only if default defined LibreOffice's default paragraph style is very different from Word's normal style? Anyway, if normal is not defined in styles.xml, then don't re-assign any other automatic styles to be based off of it, since that indicates that the style information being imported is not complete. avoids regression from commit b79b5e0df6dc5a0ba18054b0503d6fa804b69f02 Change-Id: I1bfa8505d6b89b2bba255ad727ebadbacc8d3651 Reviewed-on: https://gerrit.libreoffice.org/32103 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna --- .../ooxmlexport/data/tdf104713_undefinedStyles.docx | Bin 0 -> 2331 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 7 +++++++ 2 files changed, 7 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf104713_undefinedStyles.docx (limited to 'sw/qa') diff --git a/sw/qa/extras/ooxmlexport/data/tdf104713_undefinedStyles.docx b/sw/qa/extras/ooxmlexport/data/tdf104713_undefinedStyles.docx new file mode 100644 index 000000000000..5114a069351a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf104713_undefinedStyles.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index ef5857a6224e..a767a6e5955a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -357,6 +357,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf53856_conflictingStyle, "tdf53856_conflictingSty CPPUNIT_ASSERT_EQUAL(awt::FontSlant_NONE, getProperty(xStyle, "CharPosture")); } +DECLARE_OOXMLEXPORT_TEST(testTdf104713_undefinedStyles, "tdf104713_undefinedStyles.docx") +{ + // Normal paragraph style was not defined, so don't replace conflicting styles + uno::Reference xStyle(getStyles("ParagraphStyles")->getByName("Heading 1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast(212), getProperty(xStyle, "ParaBottomMargin")); +} + DECLARE_OOXMLEXPORT_TEST(testDrawingmlFlipv, "drawingml-flipv.docx") { // The problem was that the shape had vertical flip only, but then we added rotation as well on export. -- cgit