diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-12-10 23:18:57 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-12-10 23:18:57 +0100 |
commit | a86a21b2081c7ed00c36e9ea0d8986fcce6b8b12 (patch) | |
tree | 8afda4bd4bd8ef3ecbc2c4d7e0a7d0483b904fef /svtools/source/svhtml | |
parent | c372ae205931e913a76b0c8eb91d4c5838c52f93 (diff) |
#i107450#: move two methods needed in EditEngine from SfxHTMLParser to HTMLParser
Diffstat (limited to 'svtools/source/svhtml')
-rw-r--r-- | svtools/source/svhtml/parhtml.cxx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index b4eb6c05cffd..fa0f9c359fe0 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -2341,3 +2341,38 @@ rtl_TextEncoding HTMLParser::GetEncodingByMIME( const String& rMime ) return RTL_TEXTENCODING_DONTKNOW; } +rtl_TextEncoding HTMLParser::GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPHeader ) +{ + rtl_TextEncoding eRet = RTL_TEXTENCODING_DONTKNOW; + if( pHTTPHeader ) + { + SvKeyValue aKV; + for( BOOL bCont = pHTTPHeader->GetFirst( aKV ); bCont; + bCont = pHTTPHeader->GetNext( aKV ) ) + { + if( aKV.GetKey().EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_content_type ) ) + { + if( aKV.GetValue().Len() ) + { + eRet = HTMLParser::GetEncodingByMIME( aKV.GetValue() ); + } + } + } + } + return eRet; +} + +BOOL HTMLParser::SetEncodingByHTTPHeader( + SvKeyValueIterator *pHTTPHeader ) +{ + BOOL bRet = FALSE; + rtl_TextEncoding eEnc = HTMLParser::GetEncodingByHttpHeader( pHTTPHeader ); + if(RTL_TEXTENCODING_DONTKNOW != eEnc) + { + SetSrcEncoding( eEnc ); + bRet = TRUE; + } + return bRet; +} + + |