summaryrefslogtreecommitdiff
path: root/svtools
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 /svtools
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 'svtools')
-rw-r--r--svtools/source/svhtml/htmlkywd.cxx1
-rw-r--r--svtools/source/svhtml/parhtml.cxx5
2 files changed, 5 insertions, 1 deletions
diff --git a/svtools/source/svhtml/htmlkywd.cxx b/svtools/source/svhtml/htmlkywd.cxx
index 6034082f3a4d..2cc0a9ebe7c9 100644
--- a/svtools/source/svhtml/htmlkywd.cxx
+++ b/svtools/source/svhtml/htmlkywd.cxx
@@ -576,6 +576,7 @@ static HTML_TokenEntry aHTMLOptionTab[] = {
{{OOO_STRING_SVTOOLS_HTML_O_alt}, HTML_O_ALT},
{{OOO_STRING_SVTOOLS_HTML_O_axis}, HTML_O_AXIS},
{{OOO_STRING_SVTOOLS_HTML_O_char}, HTML_O_CHAR}, // HTML 3 Table Model Draft
+ {{OOO_STRING_SVTOOLS_HTML_O_charset}, HTML_O_CHARSET},
{{OOO_STRING_SVTOOLS_HTML_O_class}, HTML_O_CLASS},
{{OOO_STRING_SVTOOLS_HTML_O_code}, HTML_O_CODE}, // HotJava
{{OOO_STRING_SVTOOLS_HTML_O_codetype}, HTML_O_CODETYPE},
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index a47b4e4a5cd6..c09ecc59c58c 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -1928,6 +1928,10 @@ bool HTMLParser::ParseMetaOptionsImpl(
case HTML_O_CONTENT:
aContent = aOption.GetString();
break;
+ case HTML_O_CHARSET:
+ OString sValue(OUStringToOString(aOption.GetString(), RTL_TEXTENCODING_ASCII_US));
+ o_rEnc = GetExtendedCompatibilityTextEncoding(rtl_getTextEncodingFromMimeCharset(sValue.getStr()));
+ break;
}
}
@@ -1942,7 +1946,6 @@ bool HTMLParser::ParseMetaOptionsImpl(
aContent = convertLineEnd(aContent, GetSystemLineEnd());
}
-
if ( bHTTPEquiv && i_pHTTPHeader )
{
// Netscape seems to just ignore a closing ", so we do too