[gxml] Text.vala: address some compile time warnings; fail split more gracefully
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Text.vala: address some compile time warnings; fail split more gracefully
- Date: Fri, 23 Aug 2013 20:57:21 +0000 (UTC)
commit efadb74699549369034e1bd1549fd26b76eea156
Author: Richard Schwarting <aquarichy gmail com>
Date: Sun Jul 28 01:30:11 2013 -0400
Text.vala: address some compile time warnings; fail split more gracefully
gxml/Text.vala | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gxml/Text.vala b/gxml/Text.vala
index a56698f..edc885e 100644
--- a/gxml/Text.vala
+++ b/gxml/Text.vala
@@ -81,13 +81,13 @@ namespace GXml {
/* libxml2 doesn't handle this directly, in part because it doesn't
allow Text siblings. Boo! */
- if (! this.check_index_size ("split_text", this.data.length, offset, null)) {
- return null; // perhaps return "" Text
+ if (this.check_index_size ("split_text", this.data.length, offset, null)) {
+ other = this.owner_document.create_text_node (this.data.substring
((long)offset));
+ this.data = this.data.substring (0, (long)offset);
+ } else {
+ other = this.owner_document.create_text_node ("");
}
- other = this.owner_document.create_text_node (this.data.substring ((long)offset));
- this.data = this.data.substring (0, (long)offset);
-
/* TODO: Ugh, can't actually let them be siblings in the tree, as
the spec requests, because libxml2 automatically merges Text
siblings. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]