gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11820: Minor and untested fix to ha


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11820: Minor and untested fix to handle mystery SBR tag.
Date: Thu, 28 Jan 2010 11:29:05 +0100
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 11820 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2010-01-28 11:29:05 +0100
message:
  Minor and untested fix to handle mystery SBR tag.
modified:
  libcore/TextField.cpp
=== modified file 'libcore/TextField.cpp'
--- a/libcore/TextField.cpp     2010-01-26 09:44:47 +0000
+++ b/libcore/TextField.cpp     2010-01-28 09:25:45 +0000
@@ -1529,15 +1529,17 @@
                         //parsing went wrong
                         continue;
                     } else {
-                        //Don't think this is the best way to match with 
tags...
-                        //Also, assumes tags are properly nested. This is 
acceptable
-                        //assumption
+                        // Don't think this is the best way to match with
+                        // tags...
+                        // TODO: assumes tags are properly nested. This isn't
+                        // correct.
                         if (s == "U") {
                             //underline
                             newrec.setUnderline(true);
                             handleChar(it, e, x, y, newrec, last_code,
                                     last_space_glyph, last_line_start_record);
-                        } else if (s == "A") {
+                        }
+                        else if (s == "A") {
                             // anchor (blue text).
                                                        rgba color(0, 0, 0xff, 
0xff);
                                                        newrec.setColor(color);
@@ -1552,14 +1554,16 @@
                                                        }
                             handleChar(it, e, x, y, newrec, last_code,
                                     last_space_glyph, last_line_start_record);
-                        } else if (s == "B") {
+                        }
+                        else if (s == "B") {
                             //bold
                             Font* boldfont = new Font(rec.getFont()->name(),
                                     true, rec.getFont()->isItalic());
                             newrec.setFont(boldfont);
                             handleChar(it, e, x, y, newrec, last_code,
                                     last_space_glyph, last_line_start_record);
-                        } else if (s == "FONT") {
+                        }
+                        else if (s == "FONT") {
                             //font
                             boost::uint16_t originalsize = _fontHeight;
                             attloc = attributes.find("COLOR");
@@ -1623,12 +1627,14 @@
                                     last_space_glyph, last_line_start_record);
                             _fontHeight = originalsize;
                             y = newrec.yOffset();
-                        } else if (s == "IMG") {
+                        }
+                        else if (s == "IMG") {
                             //image
                             log_unimpl("<img> html tag in TextField");
                             handleChar(it, e, x, y, newrec, last_code,
                                     last_space_glyph, last_line_start_record);
-                        } else if (s == "I") {
+                        }
+                        else if (s == "I") {
                             //italic
                             Font* italicfont = new Font(rec.getFont()->name(),
                                     rec.getFont()->isBold(), true);
@@ -1658,12 +1664,14 @@
                                     last_space_glyph, last_line_start_record);
                                                        newLine(x, y, newrec, 
last_space_glyph,
                                     last_line_start_record, 1.0);
-                        } else if (s == "SPAN") {
+                        }
+                        else if (s == "SPAN") {
                             //span
                             log_unimpl("<span> html tag in TextField");
                             handleChar(it, e, x, y, newrec, last_code,
                                     last_space_glyph, last_line_start_record);
-                        } else if (s == "TEXTFORMAT") {
+                        }
+                        else if (s == "TEXTFORMAT") {
                             log_debug("in textformat");
                             //textformat
                             boost::uint16_t originalblockindent = 
getBlockIndent();
@@ -1741,10 +1749,10 @@
                             setLeftMargin(originalleftmargin);
                             setRightMargin(originalrightmargin);
                             setTabStops(originaltabstops);
-                        } else if (s == "P") {
+                        }
+                        else if (s == "P") {
                             //paragraph
-                            if (_display == TEXTFORMAT_BLOCK)
-                            {
+                            if (_display == TEXTFORMAT_BLOCK) {
                                 handleChar(it, e, x, y, newrec, last_code,
                                         last_space_glyph,
                                         last_line_start_record);
@@ -1753,17 +1761,18 @@
                                                                newLine(x, y, 
rec, last_space_glyph,
                                         last_line_start_record, 1.5);
                             }
-                            else
-                            {
+                            else {
                                 handleChar(it, e, x, y, newrec, last_code,
                                         last_space_glyph,
                                         last_line_start_record);
                             }
-                        } else if (s == "BR") {
+                        }
+                        else if (s == "BR" || s == "SBR") {
                             //line break
                                                        newLine(x, y, rec, 
last_space_glyph,
                                                                                
last_line_start_record, 1.0);
-                        } else {
+                        }
+                        else {
                             log_debug("<%s> tag is unsupported", s);
                             if (!selfclosing) { //then recurse, look for 
closing tag
                             handleChar(it, e, x, y, newrec, last_code,


reply via email to

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