gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash server/edit_text_character.cpp ChangeLog


From: Ivor Blockley
Subject: [Gnash-commit] gnash server/edit_text_character.cpp ChangeLog
Date: Tue, 04 Sep 2007 16:00:39 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Ivor Blockley <meteoryte>       07/09/04 16:00:38

Modified files:
        server         : edit_text_character.cpp 
        .              : ChangeLog 

Log message:
        * server/edit_text_character.cpp: patch to add minimal support for 
htmlText by Asger Ottar Alstrup <address@hidden>

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.107&r2=1.108
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4214&r2=1.4215

Patches:
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -b -r1.107 -r1.108
--- server/edit_text_character.cpp      3 Sep 2007 09:40:20 -0000       1.107
+++ server/edit_text_character.cpp      4 Sep 2007 16:00:38 -0000       1.108
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: edit_text_character.cpp,v 1.107 2007/09/03 09:40:20 strk Exp $ */
+/* $Id: edit_text_character.cpp,v 1.108 2007/09/04 16:00:38 meteoryte Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -737,8 +737,30 @@
        switch (std_member)
        {
        default:
+               break;
        case M_INVALID_MEMBER:
+       {
+               if (name == "htmlText")
+               {       // Minimal parsing of HTML: Strip all tags
+                       int version = 
get_parent()->get_movie_definition()->get_version();
+                       std::string html = val.to_string_versioned(version);
+                       std::string textOnly = std::string();
+                       bool inTag = false;
+                       for (unsigned int i = 0; i < html.length(); ++i)
+                       {
+                               if (inTag)
+                               {
+                                       inTag = html[i] != '>';
+                               } else {
+                                       inTag = html[i] == '<';
+                                       if (!inTag) textOnly += html[i];
+                               }
+                       }
+                       set_text_value(textOnly.c_str());
+                       return;
+               }
                break;
+       }
        case M_TEXT:
                //if (name == "text")
        {
@@ -883,7 +905,12 @@
        switch (std_member)
        {
        default:
+               break;
        case M_INVALID_MEMBER:
+               if (name == "htmlText") {
+                       val->set_string(get_text_value());
+                       return true;
+               }
                break;
        case M_TEXT:
                //if (name == "text")

Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4214
retrieving revision 1.4215
diff -u -b -r1.4214 -r1.4215
--- ChangeLog   4 Sep 2007 11:27:42 -0000       1.4214
+++ ChangeLog   4 Sep 2007 16:00:38 -0000       1.4215
@@ -1,3 +1,7 @@
+2007-09-04 Asger Ottar Alstrup <address@hidden>
+
+       * server/edit_text_character.cpp: add minimal support for htmlText.
+
 2007-09-04 Chad Musick <address@hidden>
 
        * server/fill_style.cpp,.h: Let fill style know how to read




reply via email to

[Prev in Thread] Current Thread [Next in Thread]