gnash-commit
[Top][All Lists]
Advanced

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

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


From: Sandro Santilli
Subject: Re: [Gnash-commit] gnash ChangeLog server/edit_text_character.cpp ...
Date: Wed, 2 Apr 2008 08:37:41 +0200

On Wed, Apr 02, 2008 at 02:17:52PM +0800, zou lunkai wrote:
> >                * server/edit_text_character.{cpp,h}: always register
> >                  the variable name, just don't set a value for it
> >                  unless we have one defined.
> >                * server/sprite_instance.cpp (get_member): don't use
> >                  a registered textfield variable if there's no text
> >                  defined for the corresponding textfield.
> 
> Seems not a clean way to go. All variables have values, even if you
> don't set them, they should have default values. How do you
> distinguish variables with no value and variables with default
> value(undefined, null, etc)?
> 
> I'll test this soon later. I still insist that textField variables
> with no initial value provided will not be registered:)

This code distinguishes:

  // Try textfield variables
  TextFieldPtrVect* etc = get_textfield_variable(name);
  if ( etc )
  {
    for (TextFieldPtrVect::const_iterator i=etc->begin(), e=etc->end(); i!=e; 
++i)
    {
        TextFieldPtr tf = *i;
        if ( tf->getTextDefined() )
        {
                val->set_string(tf->get_text_value());
                return true;
        }
    }
  }


Basically, if getTextDefined() returns false (for every textfield registered
with that variable). sprite_instance::get_member doesn't consider that 
registration
at all and returns false (variable not found).

--strk;




reply via email to

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