diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-07-27 23:12:22 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-03 21:17:46 -0400 |
commit | 7b812c921afcafabe0ff5e0c19143a6930b486cd (patch) | |
tree | 286ffeaf5eb7e61d7c15690d8dc92bceafc82fe4 /editeng | |
parent | 98e3b6e9e7d2a866a60b1273ee247165455f5178 (diff) |
Store the content of <style> element, and pass it to the handler.
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/eehtml.cxx | 12 | ||||
-rw-r--r-- | editeng/source/editeng/eehtml.hxx | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index ed290b5236b0..cd14ddd1e7f9 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -188,6 +188,14 @@ void EditHTMLParser::NextToken( int nToken ) } } break; + case HTML_RAWDATA: + if (IsReadStyle() && aToken.Len()) + { + // Each token represents a single line. + maStyleSource.append(aToken); + maStyleSource.append(sal_Unicode('\n')); + } + break; case HTML_TEXTTOKEN: { // #i110937# for <title> content, call aImportHdl (no SkipGroup), but don't insert the text into the EditEngine @@ -361,6 +369,8 @@ void EditHTMLParser::NextToken( int nToken ) // globals case HTML_HTML_ON: case HTML_HTML_OFF: + case HTML_STYLE_ON: + case HTML_STYLE_OFF: case HTML_BODY_ON: case HTML_BODY_OFF: case HTML_HEAD_ON: @@ -510,6 +520,8 @@ void EditHTMLParser::NextToken( int nToken ) aImportInfo.nTokenValue = (short)nTokenValue; if ( nToken == HTML_TEXTTOKEN ) aImportInfo.aText = aToken; + else if (nToken == HTML_STYLE_OFF) + aImportInfo.aText = maStyleSource.makeStringAndClear(); pImpEditEngine->aImportHdl.Call( &aImportInfo ); } diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx index 6025f0a9acda..93908052d243 100644 --- a/editeng/source/editeng/eehtml.hxx +++ b/editeng/source/editeng/eehtml.hxx @@ -48,6 +48,7 @@ class EditHTMLParser : public HTMLParser { using HTMLParser::CallParser; private: + ::rtl::OUStringBuffer maStyleSource; EditSelection aCurSel; String aBaseURL; ImpEditEngine* pImpEditEngine; |