gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-243-gb3af699
Date: Sun, 10 Apr 2011 13:19:33 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  b3af6993cedceabd13935b9678d4cd956f371da2 (commit)
      from  bc73260c53332ee45f11968acb6da4917feea352 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=b3af6993cedceabd13935b9678d4cd956f371da2


commit b3af6993cedceabd13935b9678d4cd956f371da2
Author: Benjamin Wolsey <address@hidden>
Date:   Sun Apr 10 15:11:22 2011 +0200

    Fix setTextFormat warning.
    
    We should log unimpl, and not only when there are more than 2 arguments
    as we don't handle the second either.

diff --git a/libcore/asobj/TextField_as.cpp b/libcore/asobj/TextField_as.cpp
index 25ffdba..24ed571 100644
--- a/libcore/asobj/TextField_as.cpp
+++ b/libcore/asobj/TextField_as.cpp
@@ -665,25 +665,29 @@ textfield_getTextFormat(const fn_call& fn)
 as_value
 textfield_setTextFormat(const fn_call& fn)
 {
-
     TextField* text = ensure<IsDisplayObject<TextField> >(fn);
 
-    if ( ! fn.nargs )
-    {
+    if (!fn.nargs) {
         IF_VERBOSE_ASCODING_ERRORS(
-        std::stringstream ss; fn.dump_args(ss);
-        log_aserror("TextField.setTextFormat(%s) : %s", ss.str(),
-            _("missing arg"))
+            std::stringstream ss; fn.dump_args(ss);
+            log_aserror("TextField.setTextFormat(%s) : %s", ss.str(),
+                _("missing arg"))
         );
         return as_value();
     }
-    else if ( fn.nargs > 2 )
-    {
-        std::stringstream ss; fn.dump_args(ss);
-        log_debug("TextField.setTextFormat(%s) : args past the first are "
-                "unhandled by Gnash", ss.str());
+    else if (fn.nargs > 1) {
+        LOG_ONCE(
+            std::stringstream ss; fn.dump_args(ss);
+            log_unimpl("TextField.setTextFormat(%s) : args past the first are "
+                    "unhandled by Gnash", ss.str());
+        );
     }
 
+    // Note there are three overloads for this functions, each taking
+    // a TextFormat as the last argument.
+    // TODO: handle the cases where text indices are passed as first
+    // and second arguments.
+
     TextFormat_as* tf;
     if (!isNativeType(toObject(fn.arg(0), getVM(fn)), tf)) {
 
@@ -695,11 +699,9 @@ textfield_setTextFormat(const fn_call& fn)
         return as_value();
     }
 
-    if (tf->font())
-    {
+    if (tf->font()) {
         const std::string& fontName = *tf->font();
-        if ( ! fontName.empty() )
-        {
+        if (!fontName.empty()) {
             bool bold = tf->bold() ? *tf->bold() : false;
             bool italic = tf->italic() ? *tf->italic() : false;
 

-----------------------------------------------------------------------

Summary of changes:
 libcore/asobj/TextField_as.cpp |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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