summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2022-04-11 18:33:30 +0300
committerGülşah Köse <gulsah.kose@collabora.com>2022-04-13 08:25:46 +0200
commitd2a2d16b4836bf62db7c32faffa0c5b6d0d30a5e (patch)
tree437f10f2c5857d9a001c26640e9a307e43d49942 /sd/qa
parent36024e89023fe7be1510867790d5976459483330 (diff)
Revert "Revert "tdf#135843 Implement inside horizontal vertical borders.""
This reverts commit ea5a3e0247b1230c1fe7e2cb0afc597e56d0b4c2. Change-Id: Ibd333c1e7b1530a2b6d9b8c5efbf4d9c822fa058 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132885 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/data/pptx/bnc480256-2.pptxbin0 -> 23387 bytes
-rw-r--r--sd/qa/unit/data/pptx/tdf135843_insideH.pptxbin0 -> 33449 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx2
-rw-r--r--sd/qa/unit/layout-tests.cxx38
4 files changed, 39 insertions, 1 deletions
diff --git a/sd/qa/unit/data/pptx/bnc480256-2.pptx b/sd/qa/unit/data/pptx/bnc480256-2.pptx
new file mode 100644
index 000000000000..a622d77acef0
--- /dev/null
+++ b/sd/qa/unit/data/pptx/bnc480256-2.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/tdf135843_insideH.pptx b/sd/qa/unit/data/pptx/tdf135843_insideH.pptx
new file mode 100644
index 000000000000..9b7864adb325
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf135843_insideH.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index e49892d3a738..c7b508de5dc3 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1474,7 +1474,7 @@ void SdImportTest::testTableBorderLineStyle()
xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("TopBorder") >>= aBorderLine;
- if (aBorderLine.LineWidth > 0) {
+ if (aBorderLine.Color != -1) {
CPPUNIT_ASSERT_EQUAL(nObjBorderLineStyles[i], aBorderLine.LineStyle);
}
}
diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx
index e4dfe0e3d47c..f34e2fb136f2 100644
--- a/sd/qa/unit/layout-tests.cxx
+++ b/sd/qa/unit/layout-tests.cxx
@@ -253,6 +253,44 @@ void SdLayoutTest::tdf143258_testTbRlLayout()
CPPUNIT_TEST_SUITE_REGISTRATION(SdLayoutTest);
+CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf135843_InsideHBorders)
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf135843_insideH.pptx"), PPTX);
+
+ std::shared_ptr<GDIMetaFile> xMetaFile = xDocShRef->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+
+ xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+ // Without the fix, the test fails with:
+ //- Expected: 34
+ //- Actual : 36
+ // We shouldn't see two vertical borders inside the table on ui.
+
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push", 34);
+ xDocShRef->DoClose();
+}
+
+CPPUNIT_TEST_FIXTURE(SdLayoutTest, testBnc480256)
+{
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/bnc480256-2.pptx"), PPTX);
+
+ std::shared_ptr<GDIMetaFile> xMetaFile = xDocShRef->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+
+ xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+ // Without the fix, the test fails with:
+ //- Expected: #ff0000
+ //- Actual : #ffffff
+ // We should see the red vertical border inside the table.
+
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[8]/linecolor[1]", "color", "#ff0000");
+ xDocShRef->DoClose();
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */