gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11386: Fix segfault when typing in


From: Bob Naugle
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11386: Fix segfault when typing in an empty textfield
Date: Tue, 25 Aug 2009 18:28:52 -0000
User-agent: Bazaar (1.16.1)

------------------------------------------------------------
revno: 11386
committer: Bob Naugle <address@hidden>
branch nick: trunk
timestamp: Fri 2009-08-07 12:29:53 -0600
message:
  Fix segfault when typing in an empty textfield
modified:
  libcore/TextField.cpp
=== modified file 'libcore/TextField.cpp'
--- a/libcore/TextField.cpp     2009-08-06 22:30:59 +0000
+++ b/libcore/TextField.cpp     2009-08-07 18:29:53 +0000
@@ -303,7 +303,7 @@
 void
 TextField::show_cursor(Renderer& renderer, const SWFMatrix& mat)
 {
-    if (!(_textRecords.size() > 0)) {
+    if (_textRecords.empty()) {
         return;
     }
     boost::uint16_t x;
@@ -474,9 +474,7 @@
                     for (unsigned int p = *rit; p <= q; (++p)){
                         _restrictedchars.insert(char(p));
                     }
-                    ++rit;
-                    ++rit;
-                    ++rit;
+                    rit += 3;
                 } else {
                     log_error("invalid restrict string");
                     return;
@@ -624,7 +622,6 @@
                }
         case event_id::KEY_PRESS:
         {
-            //if ( getType() != typeInput ) break; // not an input field
             setHtml(false); //editable html fields are not yet implemented
             std::wstring s = _text;
 
@@ -648,10 +645,6 @@
             size_t manylines = _line_starts.size();
             LineStarts::iterator linestartit = _line_starts.begin();
             LineStarts::const_iterator linestartend = _line_starts.end();
-            size_t cursorrecord = cursorRecord();
-            SWF::TextRecord record = _textRecords[cursorrecord];
-            //std::vector<GlyphEntry>::const_iterator pos_in_record = 
record.glyphs().begin();
-            //pos_in_record += m_cursor - _recordStarts[cursorRecord];
 
             switch (c)
             {
@@ -833,14 +826,14 @@
                         }
                     }
                     setTextValue(s);
-                    break;
             }
             onChanged();
+            set_invalidated();
         }
 
         default:
             return false;
-    }
+    };
     return true;
 }
 


reply via email to

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