From bef9fe6e3decc92bdcec6415b1898e4a0202cc6a Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Tue, 18 Apr 2017 15:23:56 +0200 Subject: extend unit test for INetMIME::scanContentType This reverts parts of commit 631b67952909a73ba1851417bd2edbe02ad7be5a and commit abc6071b7a8af354a56c91e4caecd8afc79f55cc. some of the removed fields are usefull, m_bConverted should be checked by callers fixed 2 bugs and added test cases: * extended attributes with more than 2 sections were not parsed * extended attributes with more than 1 section were not parsed if there was an other attribute Change-Id: I61ab2af7c5151ef1bcd80cc159fa2b99559374a8 Reviewed-on: https://gerrit.libreoffice.org/36913 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/tools/inetmime.hxx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'include/tools') diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx index e2c58b5ea056..cd66173a8d6c 100644 --- a/include/tools/inetmime.hxx +++ b/include/tools/inetmime.hxx @@ -30,6 +30,16 @@ struct INetContentTypeParameter { + /** The optional character set specification (see RFC 2231), in US-ASCII + encoding and converted to lower case. + */ + OString m_sCharset; + + /** The optional language specification (see RFC 2231), in US-ASCII + encoding and converted to lower case. + */ + OString m_sLanguage; + /** The attribute value. If the value is a quoted-string, it is 'unpacked.' If a character set is specified, and the value can be converted to Unicode, this is done. Also, if no character set is @@ -49,9 +59,18 @@ struct INetContentTypeParameter */ OUString m_sValue; + /** This is true if the value is successfully converted to Unicode, and + false if the value is a special mixture of ISO-LATIN-1 characters and + characters from Unicode's Private Use Area. + */ + bool m_bConverted; }; -// the key is the m_sAttribute again; all keys are lower case: +/** The key is the name of the attribute, in US-ASCII encoding and converted + to lower case. If a parameter value is split as described in RFC 2231, + there will only be one item for the complete parameter, with the attribute + name lacking any section suffix. + */ typedef std::unordered_map INetContentTypeParameterList; -- cgit