summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2022-10-26 16:44:01 +0200
committerLászló Németh <nemeth@numbertext.org>2022-10-27 20:35:01 +0200
commitd83a016823dceaeb48f34d4e94f9a230bebd9169 (patch)
treefcf8e453bb0b0e441a035d34ba8b898e63c86490 /sd/qa
parentca482cf39f25941040596e50d0e1ab7fa25dc1dd (diff)
tdf#151767 PPTX import: fix table border width
There is a "Clear Table" function in PP. In this case, the table uses the default border value of MSO, which was imported as missing table border. (Note: commit ff0387e726b59e374029d2f635ce00308d99eff6 "tdf#135843: sd_export_tests-ooxml3: Add unittest for the export part" If attachment from tdf#106011 is opened in PowerPoint, the table is visible it, but was not in LO. This patch fixed that. Therefore the borders of table are not missing after export.) Change-Id: I92dfe2e42f5f58b15af23cc24e931fb12d7c2794 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141880 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/data/pptx/tdf151767.pptxbin0 -> 33448 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml3.cxx28
-rw-r--r--sd/qa/unit/import-tests.cxx30
3 files changed, 44 insertions, 14 deletions
diff --git a/sd/qa/unit/data/pptx/tdf151767.pptx b/sd/qa/unit/data/pptx/tdf151767.pptx
new file mode 100644
index 000000000000..689a641701a5
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf151767.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx
index 128528f15844..aa0249a56d7d 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1232,20 +1232,20 @@ void SdOOXMLExportTest3::testTdf135843()
xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
const OString sPathStart("/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl");
- assertXPath(pXmlDoc, sPathStart + "/a:tr[1]/a:tc[1]/a:tcPr/a:lnL/a:noFill");
- assertXPath(pXmlDoc, sPathStart + "/a:tr[1]/a:tc[1]/a:tcPr/a:lnR/a:noFill");
- assertXPath(pXmlDoc, sPathStart + "/a:tr[1]/a:tc[1]/a:tcPr/a:lnT/a:noFill");
- assertXPath(pXmlDoc, sPathStart + "/a:tr[1]/a:tc[1]/a:tcPr/a:lnB/a:noFill");
-
- assertXPath(pXmlDoc, sPathStart + "/a:tr[2]/a:tc[1]/a:tcPr/a:lnL/a:noFill");
- assertXPath(pXmlDoc, sPathStart + "/a:tr[2]/a:tc[1]/a:tcPr/a:lnR/a:noFill");
- assertXPath(pXmlDoc, sPathStart + "/a:tr[2]/a:tc[1]/a:tcPr/a:lnT/a:noFill");
- assertXPath(pXmlDoc, sPathStart + "/a:tr[2]/a:tc[1]/a:tcPr/a:lnB/a:noFill");
-
- assertXPath(pXmlDoc, sPathStart + "/a:tr[3]/a:tc[1]/a:tcPr/a:lnL/a:noFill");
- assertXPath(pXmlDoc, sPathStart + "/a:tr[3]/a:tc[1]/a:tcPr/a:lnR/a:noFill");
- assertXPath(pXmlDoc, sPathStart + "/a:tr[3]/a:tc[1]/a:tcPr/a:lnT/a:noFill");
- assertXPath(pXmlDoc, sPathStart + "/a:tr[3]/a:tc[1]/a:tcPr/a:lnB/a:noFill");
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[1]/a:tc[1]/a:tcPr/a:lnL/a:solidFill");
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[1]/a:tc[1]/a:tcPr/a:lnR/a:solidFill");
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[1]/a:tc[1]/a:tcPr/a:lnT/a:solidFill");
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[1]/a:tc[1]/a:tcPr/a:lnB/a:solidFill");
+
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[2]/a:tc[1]/a:tcPr/a:lnL/a:solidFill");
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[2]/a:tc[1]/a:tcPr/a:lnR/a:solidFill");
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[2]/a:tc[1]/a:tcPr/a:lnT/a:solidFill");
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[2]/a:tc[1]/a:tcPr/a:lnB/a:solidFill");
+
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[3]/a:tc[1]/a:tcPr/a:lnL/a:solidFill");
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[3]/a:tc[1]/a:tcPr/a:lnR/a:solidFill");
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[3]/a:tc[1]/a:tcPr/a:lnT/a:solidFill");
+ assertXPath(pXmlDoc, sPathStart + "/a:tr[3]/a:tc[1]/a:tcPr/a:lnB/a:solidFill");
}
void SdOOXMLExportTest3::testSmartArtPreserve()
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 4c2742a34521..5de224453d53 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -153,6 +153,7 @@ public:
void testTdf62255();
void testTdf89927();
void testTdf103800();
+ void testTdf151767();
CPPUNIT_TEST_SUITE(SdImportTest);
@@ -226,6 +227,7 @@ public:
CPPUNIT_TEST(testTdf62255);
CPPUNIT_TEST(testTdf89927);
CPPUNIT_TEST(testTdf103800);
+ CPPUNIT_TEST(testTdf151767);
CPPUNIT_TEST_SUITE_END();
};
@@ -1962,6 +1964,34 @@ void SdImportTest::testTdf103800()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf151767()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf151767.pptx"), PPTX);
+
+ const SdrPage* pPage = GetPage(1, xDocShRef);
+ sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ uno::Reference<table::XCellRange> xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySet> xCell(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
+
+ table::BorderLine2 aLeft;
+ xCell->getPropertyValue("LeftBorder") >>= aLeft;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("The left border is missing!", true, aLeft.LineWidth > 0);
+
+ table::BorderLine2 aRight;
+ xCell->getPropertyValue("RightBorder") >>= aRight;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("The right border is missing!", true, aRight.LineWidth > 0);
+
+ table::BorderLine2 aTop;
+ xCell->getPropertyValue("TopBorder") >>= aTop;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("The top border is missing!", true, aTop.LineWidth > 0);
+
+ table::BorderLine2 aBottom;
+ xCell->getPropertyValue("BottomBorder") >>= aBottom;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("The bottom border is missing!", true, aBottom.LineWidth > 0);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();