gnash-commit
[Top][All Lists]
Advanced

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

Re: [Gnash-commit] /srv/bzr/gnash/trunk r11284: Changes to TextField:


From: Benjamin Wolsey
Subject: Re: [Gnash-commit] /srv/bzr/gnash/trunk r11284: Changes to TextField:
Date: Mon, 20 Jul 2009 20:16:34 +0100

> +void
> +TextField::handleChar(std::wstring::const_iterator& it, const 
> std::wstring::const_iterator& e,
> +     boost::int32_t& x, boost::int32_t& y, SWF::TextRecord& rec, int& 
> last_code, int& last_space_glyph,
> +     int& last_line_start_record)
> +{

Great - the code already looks much better.

> +                                             //Don't think this is the best 
> way to match with tags...
> +                                             if (strcmp(s.c_str(), "u") == 
> 0) {

You can and should use operator== for exact comparisons of
std::strings. However, these html tags are quite likely case
insensitive; if this isn't tested in actionscript.all/TextField.as, it
should be. The functor StringNoCaseEqual in StringPredicates.h would
work here, once you've verified what the behaviour is.

An even neater way to avoid all the else ifs might be something like a
const std::map of strings to function pointers, using
StringNoCaseLessThan as a predicate, but to implement that you need to
have an idea of what the tags will do.

>      // Register _global.TextField
> -    global.init_member(getName(uri), cl.get(), as_object::DefaultFlags,
> +    global.init_member("TextField", cl.get(), as_object::DefaultFlags,
>              getNamespace(uri));

It looks like merging has accidentally reverted this. The original code
must be restored here.

bwy

--
The current release of Gnash is 0.8.5
http://www.gnu.org/software/gnash/

Benjamin Wolsey, Software Developer - http://benjaminwolsey.de

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

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