Hi,

On 9/4/07, strk <[EMAIL PROTECTED]> wrote:
> I think it simply doesn't know about the htmlText property.
> Should be very easy to fix, you can do the same as with the 'text'
> property. What to give it a try ?

Attached is a patch which adds minimal support for htmlText: It strips
out any tags, and assigns the result to text field.

I have confirmed that this works with some examples made with haXe.
See for instance the HelloWorld*.swf's in arctic, which can be
installed with "haxelib install arctic".

There is another problem: The height of  text with default font is way too big.

Regards,
Asger
? htmlText.diff
? myconf
? gui/Info.plist
? libltdl/COPYING.LIB
? libltdl/Makefile.am
? libltdl/Makefile.in
? libltdl/README
? libltdl/acinclude.m4
? libltdl/aclocal.m4
? libltdl/config-h.in
? libltdl/config.guess
? libltdl/config.sub
? libltdl/configure
? libltdl/configure.ac
? libltdl/install-sh
? libltdl/ltdl.c
? libltdl/ltdl.h
? libltdl/ltmain.sh
? libltdl/missing
? testsuite/misc-mtasc.all/exception.as
? testsuite/misc-mtasc.all/exception.diff
? testsuite/misc-swfc.all/gnash-dbg.log
? testsuite/samples/subshapes-TestRunner
? testsuite/server/BitsReaderTest
? testsuite/server/StreamTest
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.107
diff -u -r1.107 edit_text_character.cpp
--- server/edit_text_character.cpp	3 Sep 2007 09:40:20 -0000	1.107
+++ server/edit_text_character.cpp	4 Sep 2007 08:56:19 -0000
@@ -737,7 +737,29 @@
 	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 (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")
_______________________________________________
Gnash-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-dev

Reply via email to