summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-11-03 22:27:12 +0100
committerJan Holesovsky <kendy@collabora.com>2016-11-03 22:55:34 +0100
commit84400eae86d7ae8e66f8247f4c4f3a717d90f8c0 (patch)
treeb3f6a5951078af21788f92fbee5d0b713948bc7d /sc/qa
parentb297f7bbfed83f87398231740e910afe6ebfbb97 (diff)
tdf#88821: Implement support for <meta charset="..."> for HTML import.
The editengine HTML import was not handling it at all, and consequently not setting the right encoding when importing HTML in Calc. Change-Id: I3ca3dd20f36cfb579fb7ae4cd3da63a69d97601e
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/bugfix-test.cxx13
-rw-r--r--sc/qa/unit/data/html/tdf88821-2.html19
2 files changed, 32 insertions, 0 deletions
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index 3968d381af6a..2cf5b1210c82 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -88,6 +88,7 @@ public:
// void testTdf40110();
void testTdf98657();
void testTdf88821();
+ void testTdf88821_2();
CPPUNIT_TEST_SUITE(ScFiltersTest);
CPPUNIT_TEST(testTdf64229);
@@ -98,6 +99,7 @@ public:
// CPPUNIT_TEST(testTdf40110);
CPPUNIT_TEST(testTdf98657);
CPPUNIT_TEST(testTdf88821);
+ CPPUNIT_TEST(testTdf88821_2);
CPPUNIT_TEST_SUITE_END();
private:
uno::Reference<uno::XInterface> m_xCalcComponent;
@@ -256,6 +258,17 @@ void ScFiltersTest::testTdf88821()
xDocSh->DoClose();
}
+void ScFiltersTest::testTdf88821_2()
+{
+ ScDocShellRef xDocSh = loadDoc("tdf88821-2.", FORMAT_HTML);
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ // A2 should be 'ABCabcČŠŽčšž', not 'ABCabcČŠŽÄヘšž'
+ CPPUNIT_ASSERT_EQUAL(OStringToOUString("ABCabc\xC4\x8C\xC5\xA0\xC5\xBD\xC4\x8D\xC5\xA1\xC5\xBE", RTL_TEXTENCODING_UTF8), rDoc.GetString(0, 1, 0));
+
+ xDocSh->DoClose();
+}
+
ScFiltersTest::ScFiltersTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{
diff --git a/sc/qa/unit/data/html/tdf88821-2.html b/sc/qa/unit/data/html/tdf88821-2.html
new file mode 100644
index 000000000000..e71094aba364
--- /dev/null
+++ b/sc/qa/unit/data/html/tdf88821-2.html
@@ -0,0 +1,19 @@
+<html lang="en">
+<head>
+<meta charset="UTF-8">
+</head>
+<body>
+ <table border="1">
+ <tr>
+ <td>Text</td>
+ <td>Decimal</td>
+ <td>Date</td>
+ </tr>
+ <tr>
+ <td>ABCabcČŠŽčšž</td>
+ <td>10,50</td>
+ <td>30.1.2015</td>
+ </tr>
+ </table>
+</body>
+</html>