[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp [release_0
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp [release_0_7_2] |
Date: |
Mon, 13 Nov 2006 09:06:36 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch: release_0_7_2
Changes by: Sandro Santilli <strk> 06/11/13 09:06:36
Modified files:
. : ChangeLog
server : edit_text_character.cpp
Log message:
* server/edit_text_character.cpp (registerTextVariable):
don't abort if VariableName references an unknown character,
instead print an error calling for help interpreting this
case in the correct way :)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.1412.2.153&r2=1.1412.2.154
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.22.2.4&r2=1.22.2.5
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1412.2.153
retrieving revision 1.1412.2.154
diff -u -b -r1.1412.2.153 -r1.1412.2.154
--- ChangeLog 13 Nov 2006 08:21:14 -0000 1.1412.2.153
+++ ChangeLog 13 Nov 2006 09:06:36 -0000 1.1412.2.154
@@ -1,5 +1,9 @@
2006-11-13 Sandro Santilli <address@hidden>
+ * server/edit_text_character.cpp (registerTextVariable):
+ don't abort if VariableName references an unknown character,
+ instead print an error calling for help interpreting this
+ case in the correct way :)
* server/sprite_instance.{cpp,h}: drop all self-assignments
to smart_ptr used as a mean to keep ourselves alive (sounds
dangerous and confusing); added a testInvariant() inline
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.22.2.4
retrieving revision 1.22.2.5
diff -u -b -r1.22.2.4 -r1.22.2.5
--- server/edit_text_character.cpp 6 Nov 2006 11:05:54 -0000 1.22.2.4
+++ server/edit_text_character.cpp 13 Nov 2006 09:06:36 -0000 1.22.2.5
@@ -3,7 +3,7 @@
// This source code has been donated to the Public Domain. Do
// whatever you want with it.
-/* $Id: edit_text_character.cpp,v 1.22.2.4 2006/11/06 11:05:54 strk Exp $ */
+/* $Id: edit_text_character.cpp,v 1.22.2.5 2006/11/13 09:06:36 strk Exp $ */
#include "utf8.h"
#include "log.h"
@@ -821,13 +821,18 @@
void
edit_text_character::registerTextVariable(const std::string& var_str)
{
+//#define DEBUG_DYNTEXT_VARIABLES 1
assert ( ! var_str.empty() );
const char* varname = var_str.c_str();
+#ifdef DEBUG_DYNTEXT_VARIABLES
+ log_msg("registerTextVariable(%s) called", varname);
+#endif
as_environment& env = get_environment();
character* target = env.get_target();
+ assert(target); // is this correct ?
// If the variable string contains a path, we extract
// the appropriate target from it and update the variable
@@ -835,6 +840,9 @@
tu_string path, var;
if ( as_environment::parse_path(varname, path, var) )
{
+#ifdef DEBUG_DYNTEXT_VARIABLES
+ log_msg("Variable text Path: %s, Var: %s", path.c_str(),
var.c_str());
+#endif
// find target for the path component
// we use our parent's environment for this
target = env.find_target(path);
@@ -843,6 +851,14 @@
varname = var.c_str();
}
+ if ( ! target )
+ {
+ IF_VERBOSE_MALFORMED_SWF(
+ log_error("VariableName associated to text field refer
to an unknown target (%s). It is possible that the character will be
instantiated later in the SWF stream and gnash *could* handle this if legal, so
if you think or find out this is legal consider submitting a bug report at
https://savannah.gnu.org/bugs/?group=gnash", path.c_str());
+ );
+ return;
+ }
+
assert(dynamic_cast<sprite_instance*>(target));
sprite_instance* sprite = static_cast<sprite_instance*>(target);
@@ -860,7 +876,7 @@
#ifdef DEBUG_DYNTEXT_VARIABLES
else
{
-log_msg("target sprite (%p) does NOT have a member named %s", (void*)sprite,
varname);
+log_msg("target sprite (%p) does NOT have a member named %s (no problem, we'll
add it)", (void*)sprite, varname);
}
#endif