summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-07-07 11:33:34 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-07-07 12:52:00 +0200
commit7c1a51516aaf2767e43b393259a1ad21570df5fb (patch)
tree276c4d2d62307513376295e946cf1f6e398f6aab /sw
parent350fb0249af7c29c98c3e15415a151bda8fae7ee (diff)
tdf#108995: take xml:space attribute into account
See paragraph 2.10 of XML 1.0 specification and 17.3.3.31 of ECMA-376-1:2016 Change-Id: I7f19d3b9cf2ccce88a5fa03022beeb99facc04fe Reviewed-on: https://gerrit.libreoffice.org/39682 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/xml_space.docxbin0 -> 1309 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx10
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/xml_space.docx b/sw/qa/extras/ooxmlimport/data/xml_space.docx
new file mode 100644
index 000000000000..305c135fdd75
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/xml_space.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 2513ca8097e7..817c065f4e95 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1372,6 +1372,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf108714, "tdf108714.docx")
CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, breakType);
}
+DECLARE_OOXMLIMPORT_TEST(testTdf108995, "xml_space.docx")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getParagraphs());
+ // We need to take xml:space attribute into account
+ uno::Reference< text::XTextRange > paragraph = getParagraph(1);
+ CPPUNIT_ASSERT_EQUAL(OUString("\tA\t\tline with\txml:space=\"preserve\" \n"
+ "A line without xml:space"),
+ paragraph->getString());
+}
+
// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT
CPPUNIT_PLUGIN_IMPLEMENT();