From 77621e0de5a19fd761a9ec51ba211df77f9c9b83 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Thu, 10 Oct 2013 17:44:24 +0200 Subject: [PATCH] fdo#40218 add a testcase The problem only appers if the href option is there. Change-Id: Iffcacc194655d802ec541a1a74143c41254c6072 --- sc/qa/unit/data/html/unclosed-link.html | 13 +++++++++++++ sc/qa/unit/subsequent_filters-test.cxx | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 sc/qa/unit/data/html/unclosed-link.html diff --git a/sc/qa/unit/data/html/unclosed-link.html b/sc/qa/unit/data/html/unclosed-link.html new file mode 100644 index 0000000..ea17b40 --- /dev/null +++ b/sc/qa/unit/data/html/unclosed-link.html @@ -0,0 +1,13 @@ + + + + spreadsheet + + + + + + +
a1b1c1
a2b2c2
a3b3c3
+ + diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index b69cb08..179102c 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -131,6 +131,7 @@ public: void testControlImport(); void testChartImportODS(); + void testUnclosedLinkHTML(); void testNumberFormatHTML(); void testNumberFormatCSV(); @@ -186,6 +187,7 @@ public: CPPUNIT_TEST(testNewCondFormatODS); CPPUNIT_TEST(testNewCondFormatXLSX); + CPPUNIT_TEST(testUnclosedLinkHTML); CPPUNIT_TEST(testNumberFormatHTML); CPPUNIT_TEST(testNumberFormatCSV); @@ -1387,6 +1389,24 @@ void ScFiltersTest::testChartImportODS() xDocSh->DoClose(); } +void ScFiltersTest::testUnclosedLinkHTML() +{ + ScDocShellRef xDocSh = loadDoc("unclosed-link.", HTML); + CPPUNIT_ASSERT_MESSAGE("Failed to load unclosed-link.html", xDocSh.Is()); + + ScDocument* pDoc = xDocSh->GetDocument(); + + // Ensure unclosed tags don't break the import + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Cell value is not as expected", OUString("b2"), + pDoc->GetString(1, 1, 0)); + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Cell value is not as expected", OUString("b3"), + pDoc->GetString(1, 2, 0)); + + xDocSh->DoClose(); +} + void ScFiltersTest::testNumberFormatHTML() { ScDocShellRef xDocSh = loadDoc("numberformat.", HTML); -- 1.8.4