summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2020-08-18 17:59:26 +0200
committerAndras Timar <andras.timar@collabora.com>2020-08-31 07:18:48 +0200
commit9cb9bc37d1fcd7b61d218ad63893db92a19a0cb6 (patch)
treea115c1c4b7299d9a7e3f13d3866a13aa6e605ea7 /sw/qa
parent8c4831de0d9a2a7d01fc782798862af41bc6d582 (diff)
tdf#131801: sw: support of style references in ListAutoFormat
ListAutoFormat property did support char attributes, but not style references ("CharStyleName"). It is important for correct formatting of pilcrow symbol or list format in some DOCX scenarios. Export to DOCX already works, but not to RTF/DOC. Change-Id: I1bf23d1e45fcc213adcf9aa6f404be803919fbee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100893 Tested-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit c77b9c349f0a48392d8cb7a49532844b2cafb5ba) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101560 Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf131801.docxbin0 -> 12067 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx53
2 files changed, 53 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf131801.docx b/sw/qa/extras/ooxmlexport/data/tdf131801.docx
new file mode 100644
index 000000000000..61872b5399f5
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf131801.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 2942b74dd194..a20a93c93637 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -9,6 +9,7 @@
#include <swmodeltestbase.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
char const DATA_DIRECTORY[] = "/sw/qa/extras/ooxmlexport/data/";
@@ -33,6 +34,58 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133334_followPgStyle, "tdf133334_followPgStyle.o
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
+DECLARE_OOXMLIMPORT_TEST(testTdf131801, "tdf131801.docx")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ xmlDocPtr pDump = parseLayoutDump();
+ // "1." is red
+ CPPUNIT_ASSERT_EQUAL(OUString("1."), getXPath(pDump, "//page[1]/body/txt[1]/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[1]/Special/SwFont", "color"));
+ // "2." is red
+ CPPUNIT_ASSERT_EQUAL(OUString("2."), getXPath(pDump, "//page[1]/body/txt[2]/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[2]/Special/SwFont", "color"));
+ // "3." is black
+ CPPUNIT_ASSERT_EQUAL(OUString("3."), getXPath(pDump, "//page[1]/body/txt[3]/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[3]/Special/SwFont", "color"));
+ // "4." is black
+ CPPUNIT_ASSERT_EQUAL(OUString("4."), getXPath(pDump, "//page[1]/body/txt[4]/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[4]/Special/SwFont", "color"));
+ // "5." is red
+ CPPUNIT_ASSERT_EQUAL(OUString("5."), getXPath(pDump, "//page[1]/body/txt[5]/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[5]/Special/SwFont", "color"));
+ // "6." is red
+ CPPUNIT_ASSERT_EQUAL(OUString("6."), getXPath(pDump, "//page[1]/body/txt[6]/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[6]/Special/SwFont", "color"));
+ // "7." is black
+ CPPUNIT_ASSERT_EQUAL(OUString("7."), getXPath(pDump, "//page[1]/body/txt[7]/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[7]/Special/SwFont", "color"));
+ // "8." is black
+ CPPUNIT_ASSERT_EQUAL(OUString("8."), getXPath(pDump, "//page[1]/body/txt[8]/Special[1]", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[8]/Special[1]/SwFont", "color"));
+
+ xmlDocPtr pXmlDocument = parseExport("word/document.xml");
+ if (!pXmlDocument)
+ return;
+
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:rStyle",
+ "val", "Emphasis");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rStyle",
+ "val", "Emphasis");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:rPr/w:rStyle", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:rStyle", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:rStyle",
+ "val", "Emphasis");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:sz",
+ "val", "32");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:rPr/w:rStyle",
+ "val", "Emphasis");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:rPr/w:sz",
+ "val", "32");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[7]/w:pPr/w:rPr/w:rStyle", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[8]/w:pPr/w:rPr/w:rStyle", 0);
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf135973, "tdf135973.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());