[gxml/gsoc2013: 85/150] Document.vala, DomNode.vala: move check_read_only to DomNode, so all its descendents can call it
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml/gsoc2013: 85/150] Document.vala, DomNode.vala: move check_read_only to DomNode, so all its descendents can call it
- Date: Sat, 24 Aug 2013 17:36:23 +0000 (UTC)
commit 0186d999d54def2e045d1bd261a5e8d4614f529e
Author: Richard Schwarting <aquarichy gmail com>
Date: Sat Jul 27 00:01:54 2013 -0400
Document.vala, DomNode.vala: move check_read_only to DomNode, so all its descendents can call it
gxml/Document.vala | 7 +------
gxml/DomNode.vala | 8 ++++++++
2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/gxml/Document.vala b/gxml/Document.vala
index 48b28a8..193dd5d 100644
--- a/gxml/Document.vala
+++ b/gxml/Document.vala
@@ -638,11 +638,6 @@ namespace GXml {
return this.document_element.get_elements_by_tag_name (tag_name);
}
- private bool check_read_only (DomNode node) {
- // TODO: introduce a concept of read-only-ness, perhaps
- return false;
- }
-
private void check_wrong_document (DomNode node) {
if (node.owner_document != this) {
GLib.warning ("WRONG_DOCUMENT_ERR: Node tried to interact with this document
'%p' but belonged to document '%p'", this, node.owner_document);
@@ -695,7 +690,7 @@ namespace GXml {
*/
public override DomNode? append_child (DomNode new_child) {
check_wrong_document (new_child);
- check_read_only (this);
+ this.check_read_only ();
if (new_child.node_type == NodeType.ELEMENT) {
if (xmldoc->get_root_element () == null) {
diff --git a/gxml/DomNode.vala b/gxml/DomNode.vala
index 868018d..b1e835c 100644
--- a/gxml/DomNode.vala
+++ b/gxml/DomNode.vala
@@ -47,6 +47,14 @@ namespace GXml {
}
/* Utility methods */
+
+ internal bool check_read_only () {
+ // TODO: introduce a concept of read-only-ness, perhaps
+ // if read-only, raise NO_MODIFICATION_ALLOWED_ERR
+ return false;
+ }
+
+
public void dbg_inspect () {
message ("node: %s", this.node_name);
message (" ns (prefix: %s, uri: %s)", this.prefix, this.namespace_uri);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]