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. 5c257844a719b2beafbe


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 5c257844a719b2beafbeb49009d517f3a484f23c
Date: Thu, 16 Dec 2010 09:27:17 +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  5c257844a719b2beafbeb49009d517f3a484f23c (commit)
       via  e3c4fa707d8c2eec62e45df40bae0ff24bb1aefa (commit)
       via  2340e2ee2eedc2ac79431e0a08fea7f564f4d142 (commit)
       via  bd05dbd503249a352a7d53844d16bfbae7d26509 (commit)
       via  6a28902da8ad153f587601b4c9520e8343081786 (commit)
      from  011c29e10ae1377cf92d7202c84e407524c20f24 (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=5c257844a719b2beafbeb49009d517f3a484f23c


commit 5c257844a719b2beafbeb49009d517f3a484f23c
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Dec 16 10:13:14 2010 +0100

    Style.

diff --git a/libcore/TextField.cpp b/libcore/TextField.cpp
index 284923b..0ea57ed 100644
--- a/libcore/TextField.cpp
+++ b/libcore/TextField.cpp
@@ -726,15 +726,12 @@ TextField::notifyEvent(const event_id& ev)
                     
                 case key::ENTER:
                     if (isReadOnly()) return;
-                    if ( !multiline() )
-                        break;
+                    if (!multiline()) break;
 
                 default:
                                
-                                       if ( maxChars()!=0 )
-                                       {
-                                               if ( _maxChars <= _glyphcount )
-                                               {
+                                       if (maxChars() != 0) {
+                                               if (_maxChars <= _glyphcount) {
                                                        break;
                                                }
                                        }
@@ -742,26 +739,25 @@ TextField::notifyEvent(const event_id& ev)
                     if (isReadOnly()) return;
                     wchar_t t = static_cast<wchar_t>(
                             gnash::key::codeMap[c][key::ASCII]);
-                    if (t != 0)
-                    {
+                    if (t != 0) {
                         
                         if (!_restrictDefined) {
                             // Insert one copy of the character
                             // at the cursor position.
-                              s.insert(m_cursor, 1, t);
+                            s.insert(m_cursor, 1, t);
                             m_cursor++;
                         } else if (_restrictedchars.count(t)) {
                             // Insert one copy of the character
                             // at the cursor position.
-                              s.insert(m_cursor, 1, t);
+                            s.insert(m_cursor, 1, t);
                             m_cursor++;
                         } else if (_restrictedchars.count(tolower(t))) {
                             // restrict substitutes the opposite case
-                              s.insert(m_cursor, 1, tolower(t));
+                            s.insert(m_cursor, 1, tolower(t));
                             m_cursor++;
                         } else if (_restrictedchars.count(toupper(t))) {
                             // restrict substitutes the opposite case
-                              s.insert(m_cursor, 1, toupper(t));
+                            s.insert(m_cursor, 1, toupper(t));
                             m_cursor++;
                         }
                     }
@@ -779,7 +775,6 @@ TextField::notifyEvent(const event_id& ev)
 InteractiveObject*
 TextField::topmostMouseEntity(boost::int32_t x, boost::int32_t y)
 {
-
     if (!visible()) return 0;
     
     // Not selectable, so don't catch mouse events!
@@ -908,7 +903,6 @@ TextField::setTextFormat(TextFormat_as& tf)
 float
 TextField::align_line(TextAlignment align, int last_line_start_record, float x)
 {
-
     float width = _bounds.width(); 
     float right_margin = getRightMargin();
 
@@ -953,7 +947,7 @@ TextField::align_line(TextAlignment align, int 
last_line_start_record, float x)
 boost::intrusive_ptr<const Font>
 TextField::setFont(boost::intrusive_ptr<const Font> newfont)
 {
-    if ( newfont == _font ) return _font;
+    if (newfont == _font) return _font;
 
     boost::intrusive_ptr<const Font> oldfont = _font;
     set_invalidated();
@@ -969,8 +963,7 @@ TextField::insertTab(SWF::TextRecord& rec, boost::int32_t& 
x, float scale)
      // tab (ASCII HT)
     const int space = 32;
     int index = rec.getFont()->get_glyph_index(space, _embedFonts); 
-    if ( index == -1 )
-    {
+    if (index == -1) {
         IF_VERBOSE_MALFORMED_SWF (
           log_error(_("TextField: missing glyph for space char (needed "
                   "for TAB). Make sure DisplayObject shapes for font "
@@ -978,24 +971,19 @@ TextField::insertTab(SWF::TextRecord& rec, 
boost::int32_t& x, float scale)
                 rec.getFont()->name());
         );
     }
-    else
-    {
-               std::vector<int> tabStops;
-        tabStops = _tabStops;
+    else {
+        // TODO: why is there a copy of the vector?
+               std::vector<int> tabStops = _tabStops;
         
         std::sort(_tabStops.begin(), _tabStops.end()); 
 
         int tab = 0;
-        if ( !_tabStops.empty() )
-        {
-            tab = _tabStops.back()+1;
+        if (!_tabStops.empty()) {
+            tab = _tabStops.back() + 1;
             
-            for (size_t i = 0; i < tabStops.size(); ++i)
-            {        
-                if (tabStops[i] > x)
-                {
-                    if((tabStops[i] - x) < tab) 
-                    {
+            for (size_t i = 0; i < tabStops.size(); ++i) {        
+                if (tabStops[i] > x) {
+                    if((tabStops[i] - x) < tab) {
                         tab = tabStops[i] - x;
                     }
                                }
@@ -1005,8 +993,7 @@ TextField::insertTab(SWF::TextRecord& rec, boost::int32_t& 
x, float scale)
                        // This is necessary in case the number of tabs in the 
text
                        // are more than the actual number of tabStops inside 
the 
                        // vector
-                       if ( !(tab == _tabStops.back()+1) ) 
-                       {
+                       if (tab != _tabStops.back() + 1) {
                                SWF::TextRecord::GlyphEntry ge;
                                ge.index = rec.getFont()->get_glyph_index(32, 
_embedFonts);
                                ge.advance = tab;
@@ -1014,8 +1001,7 @@ TextField::insertTab(SWF::TextRecord& rec, 
boost::int32_t& x, float scale)
                                x+=ge.advance;
                        }
         }
-        else
-        {
+        else {
             SWF::TextRecord::GlyphEntry ge;
             ge.index = index;
             ge.advance = scale * rec.getFont()->get_advance(index, 
@@ -1039,8 +1025,7 @@ TextField::format_text()
     _recordStarts.push_back(0);
                
     // nothing more to do if text is empty
-    if ( _text.empty() )
-    {
+    if (_text.empty()) {
         // TODO: should we still reset _bounds if autoSize != AUTOSIZE_NONE ?
         //       not sure we should...
         reset_bounding_box(0, 0);
@@ -1100,8 +1085,7 @@ TextField::format_text()
     // Note: this works only for additional lines of a 
     // bulleted list, so that is why there is a bullet format
     // in the beginning of format_text()
-    if ( _bullet )
-    {
+    if (_bullet) {
         int space = rec.getFont()->get_glyph_index(32, _embedFonts);
 
         SWF::TextRecord::GlyphEntry ge;
@@ -1931,8 +1915,7 @@ TextField::parseTextVariableRef(const std::string& 
variableName) const
     // name. We copy the string so we can assign to it if necessary.
     std::string parsedName = variableName;
     std::string path, var;
-    if (parsePath(variableName, path, var))
-    {
+    if (parsePath(variableName, path, var)) {
 #ifdef DEBUG_DYNTEXT_VARIABLES
         log_debug(_("Variable text Path: %s, Var: %s"), path, var);
 #endif
@@ -1943,8 +1926,7 @@ TextField::parseTextVariableRef(const std::string& 
variableName) const
         parsedName = var;
     }
 
-    if ( ! target )
-    {
+    if (!target) {
         IF_VERBOSE_MALFORMED_SWF(
             log_swferror(_("VariableName associated to text field refers "
                     "to an unknown target (%s). It is possible that the "
@@ -1997,7 +1979,7 @@ TextField::registerTextVariable()
     // check if the VariableName already has a value,
     // in that case update text value
     as_value val;
-    if (target->get_member(key, &val) ) {
+    if (target->get_member(key, &val)) {
         // TODO: pass environment to to_string ?
         // as_environment& env = get_environment();
         setTextValue(utf8::decodeCanonicalString(val.to_string(), version));
@@ -2181,8 +2163,7 @@ TextField::parseHTML(std::wstring& tag,
 void
 TextField::set_variable_name(const std::string& newname)
 {
-    if ( newname != _variable_name )
-    {
+    if (newname != _variable_name) {
         _variable_name = newname;
 
         // The name was empty or undefined, so there's nothing more to do.
@@ -2224,8 +2205,7 @@ TextField::getDrawBorder() const
 void
 TextField::setDrawBorder(bool val) 
 {
-    if ( _drawBorder != val )
-    {
+    if (_drawBorder != val) {
         set_invalidated();
         _drawBorder = val;
     }
@@ -2240,8 +2220,7 @@ TextField::getBorderColor() const
 void
 TextField::setBorderColor(const rgba& col)
 {
-    if ( _borderColor != col )
-    {
+    if (_borderColor != col) {
         set_invalidated();
         _borderColor = col;
     }
@@ -2256,8 +2235,7 @@ TextField::getDrawBackground() const
 void
 TextField::setDrawBackground(bool val) 
 {
-    if ( _drawBackground != val )
-    {
+    if (_drawBackground != val) {
         set_invalidated();
         _drawBackground = val;
     }
@@ -2272,8 +2250,7 @@ TextField::getBackgroundColor() const
 void
 TextField::setBackgroundColor(const rgba& col)
 {
-    if ( _backgroundColor != col )
-    {
+    if (_backgroundColor != col) {
         set_invalidated();
         _backgroundColor = col;
     }
@@ -2294,8 +2271,7 @@ TextField::setTextColor(const rgba& col)
 void
 TextField::setEmbedFonts(bool use)
 {
-    if ( _embedFonts != use )
-    {
+    if (_embedFonts != use) {
         set_invalidated();
         _embedFonts=use;
         format_text();
@@ -2306,7 +2282,6 @@ void
 TextField::setWordWrap(bool wrap)
 {
     if (_wordWrap != wrap) {
-
         set_invalidated();
         _wordWrap = wrap;
         format_text();
@@ -2316,8 +2291,7 @@ TextField::setWordWrap(bool wrap)
 void
 TextField::setLeading(boost::int16_t h)
 {
-    if ( _leading != h )
-    {
+    if (_leading != h) {
         set_invalidated();
         _leading = h;
     }
@@ -2326,8 +2300,7 @@ TextField::setLeading(boost::int16_t h)
 void
 TextField::setUnderlined(bool v)
 {
-    if ( _underlined != v )
-    {
+    if (_underlined != v) {
         set_invalidated();
         _underlined = v;
     }
@@ -2356,7 +2329,7 @@ TextField::setTabStops(const std::vector<int>& tabStops)
 void 
 TextField::setURL(std::string url)
 { 
-    if ( _url != url ) {
+    if (_url != url) {
         set_invalidated();
         _url = url;
     }
@@ -2365,8 +2338,7 @@ TextField::setURL(std::string url)
 void
 TextField::setTarget(std::string target)
 {
-    if ( _target != target)
-    {
+    if (_target != target) {
         set_invalidated();
         _target = target;
     }
@@ -2375,8 +2347,7 @@ TextField::setTarget(std::string target)
 void
 TextField::setDisplay(TextFormatDisplay display)
 {
-    if ( _display != display )
-    {
+    if (_display != display) {
         set_invalidated();
         _display = display;
     }
@@ -2385,8 +2356,7 @@ TextField::setDisplay(TextFormatDisplay display)
 void
 TextField::setAlignment(TextAlignment h)
 {
-    if ( _alignment != h )
-    {
+    if (_alignment != h) {
         set_invalidated();
         _alignment = h;
     }
@@ -2395,8 +2365,7 @@ TextField::setAlignment(TextAlignment h)
 void
 TextField::setIndent(boost::uint16_t h)
 {
-    if ( _indent != h )
-    {
+    if (_indent != h) {
         set_invalidated();
         _indent = h;
     }
@@ -2405,8 +2374,7 @@ TextField::setIndent(boost::uint16_t h)
 void
 TextField::setBlockIndent(boost::uint16_t h)
 {
-    if ( _blockIndent != h )
-    {
+    if (_blockIndent != h) {
         set_invalidated();
         _blockIndent = h;
     }
@@ -2415,8 +2383,7 @@ TextField::setBlockIndent(boost::uint16_t h)
 void
 TextField::setRightMargin(boost::uint16_t h)
 {
-    if ( _rightMargin != h )
-    {
+    if (_rightMargin != h) {
         set_invalidated();
         _rightMargin = h;
     }
@@ -2425,8 +2392,7 @@ TextField::setRightMargin(boost::uint16_t h)
 void
 TextField::setLeftMargin(boost::uint16_t h)
 {
-    if (_leftMargin != h)
-    {
+    if (_leftMargin != h) {
         set_invalidated();
         _leftMargin = h;
     }
@@ -2435,8 +2401,7 @@ TextField::setLeftMargin(boost::uint16_t h)
 void
 TextField::setFontHeight(boost::uint16_t h)
 {
-    if ( _fontHeight != h )
-    {
+    if (_fontHeight != h) {
         set_invalidated();
         _fontHeight = h;
     }
@@ -2451,15 +2416,13 @@ TextField::parseTypeValue(const std::string& val)
     if (cmp(val, "input")) return typeInput;
     if (cmp(val, "dynamic")) return typeDynamic;
     return typeInvalid;
-
 }
 
 
 const char*
 TextField::typeValueName(TypeValue val)
 {
-    switch (val)
-    {
+    switch (val) {
         case typeInput:
             //log_debug("typeInput returned as 'input'");
             return "input";
@@ -2476,10 +2439,9 @@ TextField::typeValueName(TypeValue val)
 void
 TextField::setAutoSize(AutoSize val)
 {
-    if ( val == _autoSize ) return;
+    if (val == _autoSize) return; 
 
     set_invalidated();
-
     _autoSize = val; 
     format_text();
 }
@@ -2539,13 +2501,10 @@ TextField::handleFocus()
 void
 TextField::killFocus()
 {
-    if ( ! m_has_focus ) return; // nothing to do
-
+    if (!m_has_focus) return; 
     set_invalidated();
     m_has_focus = false;
-
     format_text(); // is this needed ?
-
 }
 
 void
@@ -2568,9 +2527,6 @@ TextField::setHeight(double newheight)
             bounds.get_y_min() + newheight);
 }
 
-/// TextField interface functions
-
-
 } // namespace gnash
 
 

http://git.savannah.gnu.org/cgit//commit/?id=e3c4fa707d8c2eec62e45df40bae0ff24bb1aefa


commit e3c4fa707d8c2eec62e45df40bae0ff24bb1aefa
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Dec 16 09:42:26 2010 +0100

    Drop useless variable and const_cast.

diff --git a/libcore/TextField.cpp b/libcore/TextField.cpp
index 99d2f3c..284923b 100644
--- a/libcore/TextField.cpp
+++ b/libcore/TextField.cpp
@@ -108,7 +108,6 @@ TextField::TextField(as_object* object, DisplayObject* 
parent,
     _rightMargin(def.rightMargin()), 
     _fontHeight(def.textHeight()), 
     _textDefined(def.hasText()),
-    _htmlTextDefined(def.hasText()),
     _restrictDefined(false),
     _underlined(false),
     _bullet(false),
@@ -177,7 +176,6 @@ TextField::TextField(as_object* object, DisplayObject* 
parent,
     _rightMargin(0), 
     _fontHeight(12 * 20), 
     _textDefined(false),
-    _htmlTextDefined(false),
     _restrictDefined(false),
     _underlined(false),
     _bullet(false),
@@ -823,8 +821,6 @@ TextField::updateText(const std::wstring& wstr)
 void
 TextField::updateHtmlText(const std::wstring& wstr)
 {
-    _htmlTextDefined = true;
-
     if (_htmlText == wstr) return;
 
     set_invalidated();
@@ -879,7 +875,7 @@ std::string
 TextField::get_htmltext_value() const
 {
     const_cast<TextField*>(this)->registerTextVariable();
-    const int version = 
getSWFVersion(*getObject(const_cast<TextField*>(this)));
+    const int version = getSWFVersion(*getObject(this));
     return utf8::encodeCanonicalString(_htmlText, version);
 }
 
@@ -2526,7 +2522,6 @@ TextField::onChanged()
 bool
 TextField::handleFocus()
 {
-
     set_invalidated();
 
     /// Select the entire text on focus.
diff --git a/libcore/TextField.h b/libcore/TextField.h
index 9f78204..bac3034 100644
--- a/libcore/TextField.h
+++ b/libcore/TextField.h
@@ -787,8 +787,6 @@ private:
        /// and no actionscript added text.
        bool _textDefined;
 
-       bool _htmlTextDefined;
-
        bool _restrictDefined;
        bool _underlined;
        bool _bullet;

http://git.savannah.gnu.org/cgit//commit/?id=2340e2ee2eedc2ac79431e0a08fea7f564f4d142


commit 2340e2ee2eedc2ac79431e0a08fea7f564f4d142
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Dec 16 09:33:26 2010 +0100

    Drop some html text functions as they are non-functioning stubs for an
    incorrect way to implement this.

diff --git a/libcore/TextField.cpp b/libcore/TextField.cpp
index 29fa862..99d2f3c 100644
--- a/libcore/TextField.cpp
+++ b/libcore/TextField.cpp
@@ -136,10 +136,8 @@ TextField::TextField(as_object* object, DisplayObject* 
parent,
     // set default text *before* calling registerTextVariable
     // (if the textvariable already exist and has a value
     // the text will be replaced with it)
-    if (_textDefined) 
-    {
+    if (_textDefined) {
         setTextValue(utf8::decodeCanonicalString(def.defaultText(), version));
-        setHtmlTextValue(utf8::decodeCanonicalString(def.defaultText(), 
version));
     }
 
     init();
@@ -823,14 +821,6 @@ TextField::updateText(const std::wstring& wstr)
 }
 
 void
-TextField::updateHtmlText(const std::string& str)
-{
-    int version = getSWFVersion(*getObject(this));
-    const std::wstring& wstr = utf8::decodeCanonicalString(str, version);
-    updateHtmlText(wstr);
-}
-
-void
 TextField::updateHtmlText(const std::wstring& wstr)
 {
     _htmlTextDefined = true;
@@ -844,64 +834,22 @@ TextField::updateHtmlText(const std::wstring& wstr)
 }
 
 void
-TextField::setHtmlTextValue(const std::wstring& wstr)
-{
-    if (!doHtml()) {
-        updateText(wstr);
-    } else {
-        //updateText with no HTML tags
-        //for now, it is better to make the display correct
-        updateText(wstr);
-    }
-    updateHtmlText(wstr);
-
-    if ( ! _variable_name.empty() && _text_variable_registered )
-    {
-        // TODO: notify MovieClip if we have a variable name !
-        VariableRef ref = parseTextVariableRef(_variable_name);
-        as_object* tgt = ref.first;
-        if ( tgt )
-        {
-            const int version = getSWFVersion(*getObject(this));
-            // we shouldn't truncate, right?
-            tgt->set_member(ref.second, utf8::encodeCanonicalString(wstr,
-                        version)); 
-        }
-        else    
-        {
-            // nothing to do (too early ?)
-            log_debug("setHtmlTextValue: variable name %s points to a 
non-existent"
-                    " target, I guess we would not be registered if this was "
-                    "true, or the sprite we've registered our variable name "
-                    "has been unloaded", _variable_name);
-        }
-    }
-}
-
-void
 TextField::setTextValue(const std::wstring& wstr)
 {
-    if (!doHtml()) {
-        updateHtmlText(wstr);
-    } else {
-        //updateHtmlText and insert necessary html tags
-    }
+    updateHtmlText(wstr);
     updateText(wstr);
 
-    if ( ! _variable_name.empty() && _text_variable_registered )
-    {
+    if (!_variable_name.empty() && _text_variable_registered) {
         // TODO: notify MovieClip if we have a variable name !
         VariableRef ref = parseTextVariableRef(_variable_name);
         as_object* tgt = ref.first;
-        if ( tgt )
-        {
+        if (tgt) {
             const int version = getSWFVersion(*getObject(this));
             // we shouldn't truncate, right?
             tgt->set_member(ref.second, utf8::encodeCanonicalString(wstr,
                         version)); 
         }
-        else    
-        {
+        else {
             // nothing to do (too early ?)
             log_debug("setTextValue: variable name %s points to a non-existent"
                     " target, I guess we would not be registered if this was "
@@ -2018,7 +1966,7 @@ TextField::parseTextVariableRef(const std::string& 
variableName) const
 }
 
 void
-TextField::registerTextVariable() 
+TextField::registerTextVariable()
 {
 //#define DEBUG_DYNTEXT_VARIABLES 1
 
@@ -2027,17 +1975,11 @@ TextField::registerTextVariable()
 #endif
 
     if (_text_variable_registered) {
-#ifdef DEBUG_DYNTEXT_VARIABLES
-        log_debug(_("registerTextVariable() no-op call (already registered)"));
-#endif
         return;
     }
 
     if (_variable_name.empty()) {
-#ifdef DEBUG_DYNTEXT_VARIABLES
-        log_debug(_("string is empty, consider as registered"));
-#endif
-        _text_variable_registered=true;
+        _text_variable_registered = true;
         return;
     }
 
@@ -2077,8 +2019,7 @@ TextField::registerTextVariable()
         sprite->set_textfield_variable(key, this);
 
     }
-    _text_variable_registered=true;
-
+    _text_variable_registered = true;
 }
 
 /// Parses an HTML tag (between < and >) and puts
diff --git a/libcore/TextField.h b/libcore/TextField.h
index f625ad8..9f78204 100644
--- a/libcore/TextField.h
+++ b/libcore/TextField.h
@@ -148,8 +148,6 @@ public:
     /// updated.
        void updateText(const std::string& s);
 
-       void updateHtmlText(const std::string& s);
-
        /// Return value of our text.
        std::string get_text_value() const;
 
@@ -572,8 +570,7 @@ public:
 
        void setTextFormat(TextFormat_as& tf);
 
-       const SWFRect& getTextBoundingBox() const
-       {
+       const SWFRect& getTextBoundingBox() const {
                return m_text_bounding_box;
        }
 
@@ -583,10 +580,6 @@ public:
        ///
        void setTextValue(const std::wstring& wstr);
 
-       /// Set our htmlText to the given string.
-       //
-       void setHtmlTextValue(const std::wstring& wstr);
-
 private:
 
     void init();
diff --git a/libcore/asobj/TextField_as.cpp b/libcore/asobj/TextField_as.cpp
index a775027..f1cbf45 100644
--- a/libcore/asobj/TextField_as.cpp
+++ b/libcore/asobj/TextField_as.cpp
@@ -882,8 +882,8 @@ textfield_htmlText(const fn_call& fn)
     // Setter
     const int version = getSWFVersion(fn);
     
-    ptr->setHtmlTextValue(
-            utf8::decodeCanonicalString(fn.arg(0).to_string(), version));
+    ptr->setTextValue(utf8::decodeCanonicalString(fn.arg(0).to_string(),
+                version));
 
     return as_value();
 }

http://git.savannah.gnu.org/cgit//commit/?id=bd05dbd503249a352a7d53844d16bfbae7d26509


commit bd05dbd503249a352a7d53844d16bfbae7d26509
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Dec 16 09:22:13 2010 +0100

    Const correct.

diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index ca3e3a9..261b691 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -432,7 +432,7 @@ SWFHandlers::execute(ActionType type, ActionExec& thread) 
const
     try {
         _handlers[type].execute(thread);
     }
-    catch (ActionParserException& e) {
+    catch (const ActionParserException& e) {
         log_swferror(_("Malformed action code: %s"), e.what());
     }
 }
@@ -2506,16 +2506,14 @@ ActionNewEquals(ActionExec& thread)
     {
         as_value op1 = env.top(0);
         try { convertToPrimitive(op1, vm); }
-        catch (ActionTypeError& e)
-        {
+        catch (const ActionTypeError& e) {
             log_debug(_("to_primitive(%s) threw an ActionTypeError %s"),
                     op1, e.what());
         }
 
         as_value op2 = env.top(1);
         try { convertToPrimitive(op2, vm); }
-        catch (ActionTypeError& e)
-        {
+        catch (const ActionTypeError& e) {
             log_debug(_("to_primitive(%s) threw an ActionTypeError %s"),
                     op2, e.what());
         }

http://git.savannah.gnu.org/cgit//commit/?id=6a28902da8ad153f587601b4c9520e8343081786


commit 6a28902da8ad153f587601b4c9520e8343081786
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Dec 16 09:22:06 2010 +0100

    Const correct.

diff --git a/libcore/as_value.cpp b/libcore/as_value.cpp
index 3f5a913..a8266cd 100644
--- a/libcore/as_value.cpp
+++ b/libcore/as_value.cpp
@@ -238,7 +238,7 @@ as_value::to_string(int version) const
                 // reference player.
                 if (ret.is_string()) return ret.getStr();
             }
-            catch (ActionTypeError& e) {}
+            catch (const ActionTypeError& e) {}
            
             return is_function() ? "[type Function]" : "[type Object]";
 
@@ -360,7 +360,7 @@ as_value::to_number(const int version) const
                 return parseDecimalNumber(s.begin() + pos, s.end());
  
             }
-            catch (boost::bad_lexical_cast&) {
+            catch (const boost::bad_lexical_cast&) {
                 // There is no standard textual representation of infinity
                 // in the C++ standard, so our conversion function an
                 // exception for 'inf', just like for any other
@@ -394,8 +394,7 @@ as_value::to_number(const int version) const
                 as_value ret = to_primitive(NUMBER);
                 return ret.to_number(version);
             }
-            catch (ActionTypeError& e)
-            {
+            catch (const ActionTypeError& e) {
 #if GNASH_DEBUG_CONVERSION_TO_PRIMITIVE
                 log_debug(_("to_primitive(%s, NUMBER) threw an "
                             "ActionTypeError %s"), *this, e.what());
@@ -596,12 +595,12 @@ as_value::equals(const as_value& v, int version) const
     try {
         p = to_primitive(NUMBER); 
     }
-    catch (ActionTypeError& e) {}
+    catch (const ActionTypeError& e) {}
 
     try {
         vp = v.to_primitive(NUMBER); 
     }
-    catch (ActionTypeError& e) {}
+    catch (const ActionTypeError& e) {}
 
     // No conversion took place; the result is false
     if (strictly_equals(p) && v.strictly_equals(vp)) {

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

Summary of changes:
 libcore/TextField.cpp          |  216 ++++++++++------------------------------
 libcore/TextField.h            |   11 +--
 libcore/as_value.cpp           |   11 +-
 libcore/asobj/TextField_as.cpp |    4 +-
 libcore/vm/ASHandlers.cpp      |    8 +-
 5 files changed, 65 insertions(+), 185 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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