[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp |
Date: |
Mon, 13 Nov 2006 09:06:50 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/11/13 09:06:50
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&r1=1.1596&r2=1.1597
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.25&r2=1.26
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1596
retrieving revision 1.1597
diff -u -b -r1.1596 -r1.1597
--- ChangeLog 13 Nov 2006 08:34:26 -0000 1.1596
+++ ChangeLog 13 Nov 2006 09:06:50 -0000 1.1597
@@ -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 intrusive_ptr used as a mean to keep ourselves alive
(sounds dangerous and confusing); added a testInvariant()
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- server/edit_text_character.cpp 6 Nov 2006 10:51:47 -0000 1.25
+++ server/edit_text_character.cpp 13 Nov 2006 09:06:50 -0000 1.26
@@ -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.25 2006/11/06 10:51:47 strk Exp $ */
+/* $Id: edit_text_character.cpp,v 1.26 2006/11/13 09:06:50 strk Exp $ */
#include "utf8.h"
#include "log.h"
@@ -824,13 +824,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
@@ -838,6 +843,9 @@
std::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);
@@ -846,6 +854,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);
@@ -863,7 +879,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