gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11557: Reduce more.


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11557: Reduce more.
Date: Fri, 09 Oct 2009 13:17:46 +0200
User-agent: Bazaar (1.16.1)

------------------------------------------------------------
revno: 11557 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Fri 2009-10-09 13:17:46 +0200
message:
  Reduce more.
modified:
  libcore/DisplayObject.cpp
  libcore/MovieClip.cpp
=== modified file 'libcore/DisplayObject.cpp'
--- a/libcore/DisplayObject.cpp 2009-10-08 16:10:00 +0000
+++ b/libcore/DisplayObject.cpp 2009-10-09 07:50:35 +0000
@@ -154,53 +154,10 @@
 as_object*
 DisplayObject::get_path_element(string_table::key key)
 {
-       if (getSWFVersion(*this) > 4 && key == NSV::PROP_uROOT)
-       {
-               // getAsRoot() will handle _lockroot 
-               return getAsRoot();
-       }
-
-       const std::string& name = getStringTable(*this).value(key);
-
-       if (name == ".." || key == NSV::PROP_uPARENT )
-       {
-               // Never NULL
-               DisplayObject* parent = get_parent();
-               if ( ! parent )
-               {
-                       IF_VERBOSE_ASCODING_ERRORS(
-                       // AS code trying to access something before the root
-                       log_aserror(_("ActionScript code trying to reference"
-                               " a nonexistent parent with '..' "
-                               " (a nonexistent parent probably only "
-                               "occurs in the root MovieClip)."
-                               " Returning NULL. "));
-                       );
-                       return NULL;
-               }
-               return parent;
-       }
-
-       // TODO: is it correct to check for _level here ?
-       //       would it be valid at all if not the very first element
-       //       in a path ?
-       unsigned int levelno;
-
-    movie_root& mr = getRoot(*this);
-       if (mr.isLevelTarget(name, levelno) ) {
-               return mr.getLevel(levelno).get();
-       }
-
-
-       std::string namei = name;
-       if (getSWFVersion(*this) < 7) boost::to_lower(namei);
-
-       if (name == "." || namei == "this") 
-       {
-           return this;
-       }
-
-       return NULL;
+       string_table& st = getStringTable(*this);
+    if (key == st.find("..")) return get_parent();
+       if (key == st.find(".") || key == st.find("this")) return this;
+       return 0;
 }
 
 void 

=== modified file 'libcore/MovieClip.cpp'
--- a/libcore/MovieClip.cpp     2009-10-08 16:10:00 +0000
+++ b/libcore/MovieClip.cpp     2009-10-09 09:03:05 +0000
@@ -486,9 +486,14 @@
     return _displayList.getDisplayObjectAtDepth(depth);
 }
 
-// Set val to the value of the named member and
-// return true, if we have the named member.
-// Otherwise leave val alone and return false.
+/// This handles special properties of MovieClip.
+//
+/// The only genuine special properties are DisplayList members. These
+/// are accessible as properties and are enumerated, but not ownProperties
+/// of a MovieClip.
+//
+/// The TextField variables should probably be handled in a more generic
+/// way.
 bool
 MovieClip::getMovieClipProperty(string_table::key name_key, as_value& val)
 {


reply via email to

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