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
committerGülşah Köse <gulsah.kose@collabora.com>2022-03-02 11:57:25 +0100
commit3faf005a367cbd28077403bf93810bbaf4805851 (patch)
tree2fcee7f03bc52dfc6dbcafac55c77822c5da2b19 /sd
parente8a004d54dc939b257b2851a78c324269e2a3973 (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>
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 215d668b2f3f..26abc2ece38c 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1456,7 +1456,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 25c70341ea1c..d73771e56843 100644
--- a/sd/qa/unit/layout-tests.cxx
+++ b/sd/qa/unit/layout-tests.cxx
@@ -317,6 +317,44 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf146731)
xDocShRef->DoClose();
}
+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: */