gnash-commit
[Top][All Lists]
Advanced

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

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


From: zou lunkai
Subject: Re: [Gnash-commit] gnash ChangeLog server/button_character_instanc...
Date: Wed, 25 Apr 2007 10:18:41 +0800

+/*public*/
+const std::string
+character::getTarget() const
+{
+
+  // TODO: maybe cache computed target?
+
+       std::string target_dot;
+
+       std::string levelString = "_level0"; // TODO: support real levels!
+
+       const std::string& targetPath = getTargetPath();
+       if ( targetPath == "/" ) target_dot = levelString;
+       else
+       {
+               target_dot = levelString + targetPath;
+               for (std::string::size_type i=0; i<target_dot.length(); ++i)
+               {
+                       if ( target_dot[i] == '/' ) target_dot[i] = '.';
+               }
+       }
+
+       return target_dot;
+}
+
+/*public*/
+const char*   <----------------------------------[1]
+character::get_text_value() const
+{
+       return getTarget().c_str();
+}
+

[1] return a pointer to a local string!!! We won't get any text value
from it.   This caused odd problem with my event related testcase(just
changed the event order without invoking any other obvious problem),
and cost me an hour to track this. Our testsuite seems too weak to
prevent any thing.

Please fix this!




reply via email to

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