[Libreoffice-commits] .: editeng/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Aug 3 18:17:42 PDT 2011


 editeng/source/editeng/eehtml.cxx |   12 ++++++++++++
 editeng/source/editeng/eehtml.hxx |    1 +
 2 files changed, 13 insertions(+)

New commits:
commit 2bb6d1669f048a59cf40e6ec5a74e418cc021c4a
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Jul 27 23:12:22 2011 -0400

    Store the content of <style> element, and pass it to the handler.

diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index 0071d2b..ecd4124 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 a9a940b..b5ae986 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;


More information about the Libreoffice-commits mailing list