gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/server edit_text_character.cpp [release_0_7_2]


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash/server edit_text_character.cpp [release_0_7_2]
Date: Sat, 04 Nov 2006 13:45:44 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Branch:         release_0_7_2
Changes by:     Udo Giacomozzi <udog>   06/11/04 13:45:44

Modified files:
        server         : edit_text_character.cpp 

Log message:
        revert, didn't want to backport other changes

CVSWeb URLs:
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.1&r2=1.22.2.2

Patches:
Index: edit_text_character.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.22.2.1
retrieving revision 1.22.2.2
diff -u -b -r1.22.2.1 -r1.22.2.2
--- edit_text_character.cpp     4 Nov 2006 13:42:31 -0000       1.22.2.1
+++ edit_text_character.cpp     4 Nov 2006 13:45:43 -0000       1.22.2.2
@@ -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.1 2006/11/04 13:42:31 udog Exp $ */
+/* $Id: edit_text_character.cpp,v 1.22.2.2 2006/11/04 13:45:43 udog Exp $ */
 
 #include "utf8.h"
 #include "log.h"
@@ -165,7 +165,7 @@
   }
 
 
-bool edit_text_character::on_event(const event_id& id)
+bool edit_text_character::on_event(event_id id)
 {
        if (m_def->get_readonly() == true)
        {
@@ -180,7 +180,7 @@
                        {
                                get_root()->add_keypress_listener(this);
                                m_has_focus = true;
-                               m_cursor = _text.size();
+                               m_cursor = m_text.size();
                                format_text();
                        }
                        break;
@@ -200,12 +200,12 @@
 
                case event_id::KEY_PRESS:
                {
-                       std::string s(_text);
+                       std::string s(m_text.c_str());
                        std::string c;
                        c = (char) id.m_key_code;
 
-                       // may be _text is changed in ActionScript
-                       m_cursor = imin(m_cursor, _text.size());
+                       // may be m_text is changed in ActionScript
+                       m_cursor = imin(m_cursor, m_text.size());
 
                        switch (c[0])
                        {
@@ -239,7 +239,7 @@
                                case key::END:
                                case key::PGDN:
                                case key::DOWN:
-                                       m_cursor = _text.size();
+                                       m_cursor = m_text.size();
                                        format_text();
                                        break;
 
@@ -249,7 +249,7 @@
                                        break;
 
                                case key::RIGHT:
-                                       m_cursor = m_cursor < _text.size() ? 
m_cursor + 1 : _text.size();
+                                       m_cursor = m_cursor < m_text.size() ? 
m_cursor + 1 : m_text.size();
                                        format_text();
                                        break;
 
@@ -296,23 +296,20 @@
 }
 
 void
-edit_text_character::set_text_value(const char* new_text_cstr)
+edit_text_character::set_text_value(const char* new_text)
 {
-       std::string new_text;
-       if ( new_text_cstr ) new_text = new_text_cstr;
-
-       if (_text == new_text)
+       if (m_text == new_text)
        {
                return;
        }
 
        set_invalidated();
 
-       _text = new_text;
+       m_text = new_text;
        if (m_def->get_max_length() > 0
-           && _text.length() > m_def->get_max_length() )
+           && m_text.length() > m_def->get_max_length() )
        {
-               _text.resize(m_def->get_max_length());
+               m_text.resize(m_def->get_max_length());
        }
 
        format_text();
@@ -406,7 +403,7 @@
        case M_TEXT:
                //if (name == "text")
        {
-               val->set_string(_text.c_str());
+               val->set_tu_string(m_text);
                return true;
        }
        case M_VISIBLE:
@@ -617,8 +614,7 @@
        m_xcursor = x;
        m_ycursor = y;
 
-       assert(! _text.empty() );
-       const char*     text = &_text[0]; 
+       const char*     text = &m_text[0];
        while (uint32_t code = utf8::decode_next_unicode_character(&text))
        {
 // @@ try to truncate overflow text??
@@ -832,7 +828,7 @@
        // If the variable string contains a path, we extract
        // the appropriate target from it and update the variable
        // name
-       std::string path, var;
+       tu_string path, var;
        if ( as_environment::parse_path(varname, path, var) )
        {
                // find target for the path component




reply via email to

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