[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11656: Cleanups, minor fix.
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11656: Cleanups, minor fix. |
Date: |
Fri, 27 Nov 2009 14:44:48 +0100 |
User-agent: |
Bazaar (1.16.1) |
------------------------------------------------------------
revno: 11656 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Fri 2009-11-27 14:44:48 +0100
message:
Cleanups, minor fix.
modified:
libcore/asobj/flash/xml/XMLDocument_as.cpp
libcore/asobj/flash/xml/XMLDocument_as.h
libcore/asobj/flash/xml/XMLNode_as.h
testsuite/swfdec/PASSING
=== modified file 'libcore/asobj/flash/xml/XMLDocument_as.cpp'
--- a/libcore/asobj/flash/xml/XMLDocument_as.cpp 2009-11-26 16:11:18
+0000
+++ b/libcore/asobj/flash/xml/XMLDocument_as.cpp 2009-11-27 12:59:50
+0000
@@ -76,6 +76,8 @@
typedef std::map<std::string, std::string> Entities;
const Entities& getEntities();
+ void unescapeXML(std::string& text);
+
void attachXMLProperties(as_object& o);
void attachXMLInterface(as_object& o);
@@ -257,19 +259,6 @@
}
void
-unescapeXML(std::string& text)
-{
- const Entities& ent = getEntities();
-
- for (Entities::const_iterator i = ent.begin(), e = ent.end();
- i != e; ++i)
- {
- boost::replace_all(text, i->first, i->second);
- }
-
-}
-
-void
XMLDocument_as::toString(std::ostream& o, bool encode) const
{
if (!_xmlDecl.empty()) o << _xmlDecl;
@@ -1068,6 +1057,21 @@
return true;
}
+void
+unescapeXML(std::string& text)
+{
+ const Entities& ent = getEntities();
+
+ for (Entities::const_iterator i = ent.begin(), e = ent.end();
+ i != e; ++i) {
+ boost::replace_all(text, i->first, i->second);
+ }
+
+ // Additionally, the entity is unescaped (but never escaped).
+ // Note we do this as UTF-8, which is most likely wrong for SWF5.
+ boost::replace_all(text, " ", "\xc2\xa0");
+}
+
const Entities&
getEntities()
{
=== modified file 'libcore/asobj/flash/xml/XMLDocument_as.h'
--- a/libcore/asobj/flash/xml/XMLDocument_as.h 2009-11-26 11:22:34 +0000
+++ b/libcore/asobj/flash/xml/XMLDocument_as.h 2009-11-27 12:59:50 +0000
@@ -46,11 +46,6 @@
/// Note this is not the same as a URL escape.
void escapeXML(std::string& text);
-/// Unescape XML entities.
-//
-/// Note this is not the same as a URL unescape.
-void unescapeXML(std::string& text);
-
/// Register the XML class.
void xml_class_init(as_object& where, const ObjectURI& uri);
=== modified file 'libcore/asobj/flash/xml/XMLNode_as.h'
--- a/libcore/asobj/flash/xml/XMLNode_as.h 2009-11-26 16:11:18 +0000
+++ b/libcore/asobj/flash/xml/XMLNode_as.h 2009-11-27 12:52:50 +0000
@@ -88,15 +88,12 @@
_type = type;
}
- /// Set name of this node, but only if it doesn't have a name yet
- //
- /// TODO: check if this is the correct behaviour
- ///
+ /// Set name of this node
void nodeNameSet(const std::string& name) { _name = name; }
bool extractPrefix(std::string& prefix);
- /// Set value of this node, overriding any previous value
+ /// Set value of this node
void nodeValueSet(const std::string& value) { _value = value; }
/// Performs a recursive search of node attributes to find a match
@@ -131,7 +128,7 @@
XMLNode_as* nextSibling();
/// Copy a node
- // UNIMPLEMENTED
+ //
/// Method; constructs and returns a new XML node of the same type,
/// name, value, and attributes as the specified XML object. If deep
/// is set to true, all child nodes are recursively cloned, resulting
=== modified file 'testsuite/swfdec/PASSING'
--- a/testsuite/swfdec/PASSING 2009-11-26 14:30:42 +0000
+++ b/testsuite/swfdec/PASSING 2009-11-27 13:08:54 +0000
@@ -1483,6 +1483,9 @@
xml-init-7.swf:6ff05f6dd1b9085988ceb3899ebb9431
xml-init-8.swf:9f48a710d96b55ed605062be8f14de61
xml-node-init-5.swf:12fd3762a2bfa787b01fc0b8abfaa492
+xml-parse-6.swf:3d0c3ba5dffd16e007080b22544890e4
+xml-parse-7.swf:07b6d6a9c18d3c251e3619765a0467d6
+xml-parse-8.swf:b1a525b8239f5b12a7d4533e5aaee912
xml-properties2-5.swf:775eeab1ca99591990db2f8fc79e5ce3
xml-properties2-6.swf:39bbce190960c16c62b9a5fdd7b5d847
xml-properties2-7.swf:ee74aae83eeb596faa9329556dbfc216
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11656: Cleanups, minor fix.,
Benjamin Wolsey <=