diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-02 00:12:13 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-02 00:13:47 +0200 |
commit | 1199713c82d9852f8a41283138f88a06ad887c39 (patch) | |
tree | b08963fa4c7fbac8d7213877964e31de18ecf77c /sc | |
parent | 4ab9719f15baddbc60b96d86d2e0878e79a6ddf7 (diff) |
add xls border import test
TODO:
add test cases for:
-color import
-different line styles
-...
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/xls/border.xls | bin | 0 -> 21504 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 31 |
2 files changed, 31 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/border.xls b/sc/qa/unit/data/xls/border.xls Binary files differnew file mode 100644 index 000000000000..b314f7d19be3 --- /dev/null +++ b/sc/qa/unit/data/xls/border.xls diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 391b1579fa80..1d8a8b6b6e32 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -104,6 +104,7 @@ public: void testMatrixODS(); void testMatrixXLS(); void testBorderODS(); + void testBorderXLS(); void testBugFixesODS(); void testBugFixesXLS(); void testBugFixesXLSX(); @@ -124,6 +125,7 @@ public: CPPUNIT_TEST(testMatrixODS); CPPUNIT_TEST(testMatrixXLS); CPPUNIT_TEST(testBorderODS); + CPPUNIT_TEST(testBorderXLS); CPPUNIT_TEST(testBugFixesODS); CPPUNIT_TEST(testBugFixesXLS); CPPUNIT_TEST(testBugFixesXLSX); @@ -515,6 +517,35 @@ void ScFiltersTest::testBorderODS() xDocSh->DoClose(); } +void ScFiltersTest::testBorderXLS() +{ + const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("border.")); + ScDocShellRef xDocSh = loadDoc( aFileNameBase, 1); + + CPPUNIT_ASSERT_MESSAGE("Failed to load border.xls", xDocSh.Is()); + ScDocument* pDoc = xDocSh->GetDocument(); + + const editeng::SvxBorderLine* pLeft = NULL; + const editeng::SvxBorderLine* pTop = NULL; + const editeng::SvxBorderLine* pRight = NULL; + const editeng::SvxBorderLine* pBottom = NULL; + + pDoc->GetBorderLines( 2, 3, 0, &pLeft, &pTop, &pRight, &pBottom ); + CPPUNIT_ASSERT(pRight); + CPPUNIT_ASSERT_EQUAL(pRight->GetStyle(),editeng::SOLID); + CPPUNIT_ASSERT_EQUAL(pRight->GetWidth(),6L); + + pDoc->GetBorderLines( 3, 5, 0, &pLeft, &pTop, &pRight, &pBottom ); + CPPUNIT_ASSERT(pRight); + CPPUNIT_ASSERT_EQUAL(pRight->GetStyle(),editeng::SOLID); + CPPUNIT_ASSERT_EQUAL(pRight->GetWidth(),18L); + + pDoc->GetBorderLines( 5, 7, 0, &pLeft, &pTop, &pRight, &pBottom ); + CPPUNIT_ASSERT(pRight); + CPPUNIT_ASSERT_EQUAL(pRight->GetStyle(),editeng::SOLID); + CPPUNIT_ASSERT_EQUAL(pRight->GetWidth(),24L); +} + void ScFiltersTest::testBugFixesODS() { const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("bug-fixes.")); |