summaryrefslogtreecommitdiff
path: root/sd/qa/unit/import-tests.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/qa/unit/import-tests.cxx')
-rw-r--r--sd/qa/unit/import-tests.cxx48
1 files changed, 48 insertions, 0 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index da4d4c49db67..a9b7f0df067c 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -56,6 +56,7 @@
#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
#include <com/sun/star/chart2/data/XDataSequence.hpp>
#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
+#include <com/sun/star/table/BorderLineStyle.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
@@ -97,6 +98,7 @@ public:
void testBnc584721_4();
void testBnc904423();
void testShapeLineStyle();
+ void testTableBorderLineStyle();
void testBnc862510_6();
void testBnc862510_7();
#if ENABLE_PDFIMPORT
@@ -143,6 +145,7 @@ public:
CPPUNIT_TEST(testBnc584721_4);
CPPUNIT_TEST(testBnc904423);
CPPUNIT_TEST(testShapeLineStyle);
+ CPPUNIT_TEST(testTableBorderLineStyle);
CPPUNIT_TEST(testBnc862510_6);
CPPUNIT_TEST(testBnc862510_7);
#if ENABLE_PDFIMPORT
@@ -1024,6 +1027,51 @@ void SdImportTest::testShapeLineStyle()
xDocShRef->DoClose();
}
+void SdImportTest::testTableBorderLineStyle()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tableBorderLineStyle.pptx"), PPTX );
+
+ // TODO: If you are working on improvement of table border line style
+ // support, then expect this unit test to fail.
+
+ const sal_Int16 nObjBorderLineStyles[] =
+ {
+ ::table::BorderLineStyle::DASHED,
+ ::table::BorderLineStyle::DASH_DOT_DOT,
+ ::table::BorderLineStyle::DASH_DOT,
+ ::table::BorderLineStyle::DOTTED,
+ ::table::BorderLineStyle::DASHED,
+ ::table::BorderLineStyle::DOTTED,
+ ::table::BorderLineStyle::DASHED,
+ ::table::BorderLineStyle::DASH_DOT,
+ ::table::BorderLineStyle::DASH_DOT,
+ ::table::BorderLineStyle::SOLID,
+ ::table::BorderLineStyle::NONE
+ };
+
+ const SdrPage *pPage = GetPage( 1, xDocShRef );
+ CPPUNIT_ASSERT_EQUAL(SAL_N_ELEMENTS(nObjBorderLineStyles), pPage->GetObjCount());
+
+ sdr::table::SdrTableObj *pTableObj;
+ uno::Reference< table::XCellRange > xTable;
+ uno::Reference< beans::XPropertySet > xCell;
+ table::BorderLine2 aBorderLine;
+
+ for (size_t i = 0; i < SAL_N_ELEMENTS(nObjBorderLineStyles); i++)
+ {
+ pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(i));
+ CPPUNIT_ASSERT( pTableObj );
+ 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) {
+ CPPUNIT_ASSERT_EQUAL(nObjBorderLineStyles[i], aBorderLine.LineStyle);
+ }
+ }
+
+ xDocShRef->DoClose();
+}
+
void SdImportTest::testBnc862510_6()
{
// Black text was imported instead of gray