summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2022-02-01 16:03:14 +0300
committerAndras Timar <andras.timar@collabora.com>2022-03-09 09:17:20 +0100
commit2f2975c7dee495b382f23aca8979d7f04ce2ffb2 (patch)
treec8656e5d6d617509e8084121eee8666e682f0f60 /sd
parentb9e055a8959fa19ac709047e3f22ac8ef6814b45 (diff)
tdf#135843 Implement inside horizontal vertical borders.
wholeTbl as TableStylePart should be handled in different way. Before left border of the whole table was handling like all cells left border but it should be left border of the first column. insideV and and insideH properties are imported but never handled. I added the inside vertical and horizontal borders handling. Change-Id: I5aea5cbefc746db637eac6c1438fa70a7d741bc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128971 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> (cherry picked from commit 3faf005a367cbd28077403bf93810bbaf4805851) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130860
Diffstat (limited to 'sd')
-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: */