summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2020-07-10 10:09:06 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-07-10 22:23:22 +0200
commitda91b2fd8e7c980973240340c3cdfcd473c1b233 (patch)
treec03eb507a67a68aff7a787f01aaf3041fe16a796 /sw/qa
parent76f3995c0ddb06ca5d3e1b147bbd5cc9d74c8654 (diff)
tdf#134548: sw: revert of changes to tab at zero pos
It looks like solution for provided in 5ed96c for tdf#83309 is enough to resolve original bugdoc, so these changes for emission of tab at zero position are not required and produce just regressions. Corresponding unittest for tdf#83309 is adjusted: it is using now original bugdoc. Change-Id: I2e7683f071f78c720436b4c9ccb903133a985e7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98476 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/layout/data/tdf134548.odtbin0 -> 10592 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx20
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf83309.docxbin12811 -> 112363 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx12
4 files changed, 25 insertions, 7 deletions
diff --git a/sw/qa/extras/layout/data/tdf134548.odt b/sw/qa/extras/layout/data/tdf134548.odt
new file mode 100644
index 000000000000..bc714b0d5e01
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf134548.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 8aee5a95a6fe..4707328fa494 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -4128,6 +4128,26 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testStableAtPageAnchoredFlyPosition)
CPPUNIT_ASSERT_EQUAL(aOrigRect, aRelayoutRect);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134548)
+{
+ createDoc("tdf134548.odt");
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+ // Second paragraph has two non zero width tabs in beginning of line
+ {
+ OUString sNodeType = parseDump("/root/page/body/txt[2]/Text[1]", "nType");
+ CPPUNIT_ASSERT_EQUAL(OUString("PortionType::TabLeft"), sNodeType);
+ sal_Int32 nWidth = parseDump("/root/page/body/txt[2]/Text[1]", "nWidth").toInt32();
+ CPPUNIT_ASSERT_GREATER(sal_Int32(0), nWidth);
+ }
+ {
+ OUString sNodeType = parseDump("/root/page/body/txt[2]/Text[2]", "nType");
+ CPPUNIT_ASSERT_EQUAL(OUString("PortionType::TabLeft"), sNodeType);
+ sal_Int32 nWidth = parseDump("/root/page/body/txt[2]/Text[2]", "nWidth").toInt32();
+ CPPUNIT_ASSERT_GREATER(sal_Int32(0), nWidth);
+ }
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/data/tdf83309.docx b/sw/qa/extras/ooxmlexport/data/tdf83309.docx
index e8f59bc81969..03e0797877d8 100644
--- a/sw/qa/extras/ooxmlexport/data/tdf83309.docx
+++ b/sw/qa/extras/ooxmlexport/data/tdf83309.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 2559e09cc1d6..becf005b10e6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -654,16 +654,14 @@ DECLARE_OOXMLIMPORT_TEST(testTdf125038c, "tdf125038c.docx")
DECLARE_OOXMLEXPORT_TEST(testTdf83309, "tdf83309.docx")
{
- CPPUNIT_ASSERT_EQUAL(1, getPages());
- OUString sNodeType;
+ // Important: bug case had 4 pages
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
// First paragraph does not have tab before
- sNodeType = parseDump("/root/page/body/txt[1]/Text[1]", "nType");
+ // (same applies to all paragraphs in doc, but lets assume they are
+ // behave same way)
+ OUString sNodeType = parseDump("/root/page[1]/body/txt[1]/Text[1]", "nType");
CPPUNIT_ASSERT_EQUAL(OUString("PortionType::Text"), sNodeType);
-
- // Second paragraph starts with tab
- sNodeType = parseDump("/root/page/body/txt[2]/Text[1]", "nType");
- CPPUNIT_ASSERT_EQUAL(OUString("PortionType::TabLeft"), sNodeType);
}
DECLARE_OOXMLEXPORT_TEST(testTdf121661, "tdf121661.docx")