[gxml] * strip trailing whitespace



commit c10f4a78a7f90ae772579dcda2a2650f5ca229fd
Author: Richard Schwarting <aquarichy gmail com>
Date:   Mon Jul 9 14:39:40 2012 -0400

    * strip trailing whitespace

 gxml/BackedNode.vala      |    2 +-
 gxml/Document.vala        |   10 +++++-----
 gxml/Element.vala         |   10 +++++-----
 gxml/NamespaceAttr.vala   |    4 ++--
 gxml/XNode.vala           |    4 ++--
 gxml/XmlSerializable.vala |    8 ++++----
 test/AttrTest.vala        |    8 ++++----
 test/DocumentTest.vala    |   14 +++++++-------
 test/ElementTest.vala     |   14 +++++++-------
 test/ValaLibxml2Test.vala |    2 +-
 10 files changed, 38 insertions(+), 38 deletions(-)
---
diff --git a/gxml/BackedNode.vala b/gxml/BackedNode.vala
index 2fc0c0c..dfd5f4e 100644
--- a/gxml/BackedNode.vala
+++ b/gxml/BackedNode.vala
@@ -35,7 +35,7 @@ namespace GXmlDom {
 			get {
 				if (_namespace_definitions == null) {
 					this._namespace_definitions = new NamespaceAttrNodeList (this, this.owner_document);
-				} 
+				}
 				return this._namespace_definitions;
 			}
 			internal set {
diff --git a/gxml/Document.vala b/gxml/Document.vala
index 63af9b3..e2bc39f 100644
--- a/gxml/Document.vala
+++ b/gxml/Document.vala
@@ -53,8 +53,8 @@ namespace GXmlDom {
 		 * accessed and the GXml XNode we created to represent
 		 * them on-demand.  That way, we don't create an XNode
 		 * for EVERY node, even if the user never actually
-		 * accesses it.  
-		 */ 
+		 * accesses it.
+		 */
 		internal HashTable<Xml.Node*, XNode> node_dict = new HashTable<Xml.Node*, XNode> (GLib.direct_hash, GLib.direct_equal);
 		// We don't want want to use XNode's Xml.Node or its dict
 		// internal HashTable<Xml.Attr*, Attr> attr_dict = new HashTable<Xml.Attr*, Attr> (null, null);
@@ -342,7 +342,7 @@ namespace GXmlDom {
 			this.from_libxml2 (doc);
 		}
 		/**
-		 * Creates an empty document. 
+		 * Creates an empty document.
 		 */
 		public Document () throws DomError {
 			Xml.Doc *doc = new Xml.Doc ();
@@ -364,14 +364,14 @@ namespace GXmlDom {
 			// TODO: test that adding attributes works with stringification and saving
 			if (this.dirty_elements.length () > 0) {
 				// tmp_node for generating Xml.Ns* objects when saving attributes
-				tmp_node = new Xml.Node (null, "tmp"); 
+				tmp_node = new Xml.Node (null, "tmp");
 				foreach (Element elem in this.dirty_elements) {
 					elem.save_attributes (tmp_node);
 				}
 				this.dirty_elements = new List<Element> (); // clear the old list
 			}
 		}
-		
+
 
 		/**
 		 * Saves a Document to the file at path file_path
diff --git a/gxml/Element.vala b/gxml/Element.vala
index 24d7546..d505ba8 100644
--- a/gxml/Element.vala
+++ b/gxml/Element.vala
@@ -92,7 +92,7 @@ namespace GXmlDom {
 					this.owner_document.dirty_elements.append (this);
 					this._attributes = new HashTable<string,Attr> (GLib.str_hash, GLib.str_equal);
 						// TODO: make sure other HashTables have appropriate hash, equal functions
-					
+
 					for (Xml.Attr *prop = base.node->properties; prop != null; prop = prop->next) {
 						attr = new Attr (prop, this.owner_document);
 						this._attributes.replace (prop->name, attr);
@@ -138,7 +138,7 @@ namespace GXmlDom {
 
 					}
 				}
-				
+
 				// Go through the GXml table of attributes for this element and add corresponding libxml2 ones
 				foreach (string propname in this.attributes.get_keys ()) {
 					attr = this.attributes.lookup (propname);
@@ -201,7 +201,7 @@ namespace GXmlDom {
 				 * like this, and not ones read from the file, so I didn't notice
 				 * something so important was broken. Ugh.  Add more suitable tests.
 				 */
-				   
+
 				attr = this.owner_document.create_attribute (name);
 			}
 			/* TODO: find out if DOM API wants us to create a new one if it doesn't already exist?  (probably, but we'll need to know the doc for that, for doc.create_attribute :| */
@@ -265,7 +265,7 @@ namespace GXmlDom {
 
 		// TODO: consider making the life of TagNameNodeLists optional, and dead by default, at the Document level
 		private void check_add_tag_name (Element basenode, XNode child) {
-			// TODO: make sure there aren't any other NodeTypes that could have elements as children 
+			// TODO: make sure there aren't any other NodeTypes that could have elements as children
 			if (child.node_type == NodeType.ELEMENT || child.node_type == NodeType.DOCUMENT_FRAGMENT) {
 				// the one we're examining is an element, and might need to be added
 				if (child.node_type == NodeType.ELEMENT) {
@@ -284,7 +284,7 @@ namespace GXmlDom {
 		 * whether they're keeping that node in a TagNameNodeList, so we can remove it.
 		 */
 		private void check_remove_tag_name (Element basenode, XNode child) {
-			// TODO: make sure there aren't any other NodeTypes that could have elements as children 
+			// TODO: make sure there aren't any other NodeTypes that could have elements as children
 			if (child.node_type == NodeType.ELEMENT) {
 				// the one we're examining is an element, and might need to be removed from a tag name node list
 				basenode.on_remove_descendant_with_tag_name ((Element)child);
diff --git a/gxml/NamespaceAttr.vala b/gxml/NamespaceAttr.vala
index 1730ce2..c9a0f33 100644
--- a/gxml/NamespaceAttr.vala
+++ b/gxml/NamespaceAttr.vala
@@ -23,7 +23,7 @@ namespace GXmlDom {
 		 * The prefix that this xmlns attribute defines. So,
 		 * if the element was like {{{<Fish xmlns:foods="http://fishies.org/foods"; />}}}, the
 		 * defined prefix would be foods.
-		 */ 
+		 */
 		public string defined_prefix {
 			get {
 				return this.node_name;
@@ -36,7 +36,7 @@ namespace GXmlDom {
 		 * The namespace uri that this xmlns attribute defines. So,
 		 * if the element was like {{{<Fish xmlns:foods="http://fishies.org/foods"; />}}}, the
 		 * defined namespace uri would be [[http://fishies.org/foods/]].
-		 */ 
+		 */
 		public string defined_namespace_uri {
 			get {
 				return this.node_value;
diff --git a/gxml/XNode.vala b/gxml/XNode.vala
index f5d5d02..723142a 100644
--- a/gxml/XNode.vala
+++ b/gxml/XNode.vala
@@ -40,13 +40,13 @@ namespace GXmlDom {
 		// TODO: determine best API for exposing these, as it's not defined in the IDL
 		/**
 		 * The list of attributes that store namespace definitions
-		 */ 
+		 */
 		public virtual NodeList? namespace_definitions {
 			get {
 				return null;
 			}
 			internal set {
-			}					
+			}
 		}
 
 		/**
diff --git a/gxml/XmlSerializable.vala b/gxml/XmlSerializable.vala
index 86134d9..6600c5e 100644
--- a/gxml/XmlSerializable.vala
+++ b/gxml/XmlSerializable.vala
@@ -17,7 +17,7 @@
 
   json_serializable_default_{de,}serialize_property -> json_serializable_real_{de,}serialize
 
-  
+
   json_serializable_{de,}serialize_property -> iface->{de,}serialize_property
     these all get init'd to -> json_serializable_real_{de,}serialize_property
       these all call -> json_{de,}serialize_pspec
@@ -260,7 +260,7 @@ namespace GXmlDom {
 			Type t = dest.type ();
 			GLib.Value dest2 = Value (t);
 			bool ret = false;
-			
+
 			if (t == typeof (int64)) {
 				int64 val;
 				if (ret = int64.try_parse (str, out val)) {
@@ -294,7 +294,7 @@ namespace GXmlDom {
 				bool val;
 				if (ret = bool.try_parse (str, out val)) {
 					dest2.set_boolean (val);
-				} 
+				}
 			} else if (t == typeof (float)) {
 				double val;
 				if (ret = double.try_parse (str, out val)) {
@@ -312,7 +312,7 @@ namespace GXmlDom {
 				int64 val;
 				if (ret = int64.try_parse (str, out val)) {
 					dest2.set_char ((char)val);
-				} 
+				}
 			} else if (t == typeof (uchar)) {
 				int64 val;
 				if (ret = int64.try_parse (str, out val)) {
diff --git a/test/AttrTest.vala b/test/AttrTest.vala
index 1128e09..92f8513 100644
--- a/test/AttrTest.vala
+++ b/test/AttrTest.vala
@@ -12,7 +12,7 @@ class AttrTest : GXmlTest {
 					Attr core = node.get_attribute_node ("core");
 					Attr shell = node.get_attribute_node ("shell");
 					Attr price = node.get_attribute_node ("price");
-					
+
 					assert (core.namespace_uri == "http://mom.co.uk/wands";);
 					assert (shell.namespace_uri == "http://mom.co.uk/wands";);
 					assert (price.namespace_uri == null);
@@ -30,7 +30,7 @@ class AttrTest : GXmlTest {
 					Attr core = node.get_attribute_node ("core");
 					Attr shell = node.get_attribute_node ("shell");
 					Attr price = node.get_attribute_node ("price");
-					
+
 					assert (core.prefix == "wands");
 					assert (shell.prefix == "wands");
 					assert (price.prefix == null);
@@ -48,7 +48,7 @@ class AttrTest : GXmlTest {
 					Attr core = node.get_attribute_node ("core");
 					Attr shell = node.get_attribute_node ("shell");
 					Attr price = node.get_attribute_node ("price");
-					
+
 					assert (core.local_name == "core");
 					assert (shell.local_name == "shell");
 					assert (price.local_name == "price");
@@ -62,7 +62,7 @@ class AttrTest : GXmlTest {
 				try {
 					Document doc = get_doc ();
 					Attr attr = get_attr ("broomSeries", "Nimbus", doc);
-					
+
 					assert (attr.node_name == "broomSeries");
 				} catch (GXmlDom.DomError e) {
 					GLib.warning ("%s", e.message);
diff --git a/test/DocumentTest.vala b/test/DocumentTest.vala
index 608f7e4..f2eb5f7 100644
--- a/test/DocumentTest.vala
+++ b/test/DocumentTest.vala
@@ -18,9 +18,9 @@ class DocumentTest : GXmlTest {
 		Test.add_func ("/gxml/document/implementation", () => {
 				try {
 					Document doc = get_doc ();
-					
+
 					Implementation impl = doc.implementation;
-					
+
 					assert (impl.has_feature ("xml") == true);
 					assert (impl.has_feature ("xml", "1.0") == true);
 					assert (impl.has_feature ("xml", "2.0") == false);
@@ -35,7 +35,7 @@ class DocumentTest : GXmlTest {
 				try {
 					Document doc = get_doc ();
 					Element root = doc.document_element;
-					
+
 					assert (root.node_name == "Sentences");
 					assert (root.has_child_nodes ());
 				} catch (GXmlDom.DomError e) {
@@ -153,8 +153,8 @@ class DocumentTest : GXmlTest {
 				try {
 					Document doc = get_doc ();
 					DocumentFragment fragment = doc.create_document_fragment ();
-					
-					// TODO: can we set XML in the content, and actually have that translate into real libxml2 underlying nodes? 
+
+					// TODO: can we set XML in the content, and actually have that translate into real libxml2 underlying nodes?
 					Element percy = doc.create_element ("Author");
 					Element percy_name = doc.create_element ("Name");
 					Element percy_email = doc.create_element ("Email");
@@ -163,7 +163,7 @@ class DocumentTest : GXmlTest {
 					percy.append_child (percy_name);
 					percy.append_child (percy_email);
 					fragment.append_child (percy);
-					
+
 					Element ginny = doc.create_element ("Author");
 					Element ginny_name = doc.create_element ("Name");
 					Element ginny_email = doc.create_element ("Email");
@@ -172,7 +172,7 @@ class DocumentTest : GXmlTest {
 					ginny.append_child (ginny_name);
 					ginny.append_child (ginny_email);
 					fragment.append_child (ginny);
-					
+
 					NodeList authors_list = doc.get_elements_by_tag_name ("Authors");
 					assert (authors_list.length == 1);
 					Element authors = (Element)authors_list.item (0);
diff --git a/test/ElementTest.vala b/test/ElementTest.vala
index 50b3df3..a89e0b1 100644
--- a/test/ElementTest.vala
+++ b/test/ElementTest.vala
@@ -15,7 +15,7 @@ class ElementTest : GXmlTest  {
 	public static void add_tests () {
 		Test.add_func ("/gxml/element/namespace_support_manual", () => {
 				try {
-					// TODO: wanted to use TestElement but CAN'T because Vala won't let me access the internal constructor of Element? 
+					// TODO: wanted to use TestElement but CAN'T because Vala won't let me access the internal constructor of Element?
 					Xml.Doc *xmldoc;
 					Xml.Node *xmlroot;
 					Xml.Node *xmlnode;
@@ -46,11 +46,11 @@ class ElementTest : GXmlTest  {
 				} catch (GXmlDom.DomError e) {
 					GLib.warning ("%s", e.message);
 					assert (false);
-				}				
+				}
 			});
 		Test.add_func ("/gxml/element/namespace_uri", () => {
 				try {
-					// TODO: wanted to use TestElement but CAN'T because Vala won't let me access the internal constructor of Element? 
+					// TODO: wanted to use TestElement but CAN'T because Vala won't let me access the internal constructor of Element?
 					Document doc = new Document.from_string ("<Potions><magic:Potion xmlns:magic=\"http://hogwarts.co.uk/magic\"; xmlns:products=\"http://diagonalley.co.uk/products\"/></Potions>");
 					XNode root = doc.document_element;
 					XNode node = root.child_nodes.item (0);
@@ -59,11 +59,11 @@ class ElementTest : GXmlTest  {
 				} catch (GXmlDom.DomError e) {
 					GLib.warning ("%s", e.message);
 					assert (false);
-				}				
+				}
 			});
 		Test.add_func ("/gxml/element/testing", () => {
 				try {
-					// TODO: wanted to use TestElement but CAN'T because Vala won't let me access the internal constructor of Element? 
+					// TODO: wanted to use TestElement but CAN'T because Vala won't let me access the internal constructor of Element?
 					Document doc = new Document.from_string ("<Potions><magic:Potion xmlns:magic=\"http://hogwarts.co.uk/magic\"; xmlns:products=\"http://diagonalley.co.uk/products\";><products:Ingredient /></magic:Potion></Potions>");
 					XNode root = doc.document_element;
 					XNode node = root.child_nodes.item (0);
@@ -106,7 +106,7 @@ class ElementTest : GXmlTest  {
 				} catch (GXmlDom.DomError e) {
 					GLib.warning ("%s", e.message);
 					assert (false);
-				}				
+				}
 			});
 		Test.add_func ("/gxml/element/namespace_definitions", () => {
 				try {
@@ -128,7 +128,7 @@ class ElementTest : GXmlTest  {
 				} catch (GXmlDom.DomError e) {
 					GLib.warning ("%s", e.message);
 					assert (false);
-				}				
+				}
 			});
 		Test.add_func ("/gxml/element/attributes", () => {
 				try {
diff --git a/test/ValaLibxml2Test.vala b/test/ValaLibxml2Test.vala
index 69977ba..a0081d6 100644
--- a/test/ValaLibxml2Test.vala
+++ b/test/ValaLibxml2Test.vala
@@ -25,7 +25,7 @@ class ValaLibxml2Test : GXmlTest {
 					// try removing it again, it shouldn't exist, should fail
 					assert (table->remove_entry ("maple", null) == -1);
 					assert (table->size () == 1);
-					
+
 					assert (table->lookup ("swiss") == "cheese");
 
 					table->free (/* should pass it a string deallocator */ null);



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