Skip to content

Commit

Permalink
0.32
Browse files Browse the repository at this point in the history
bug fix
  • Loading branch information
XenoAmess committed Dec 16, 2018
1 parent 3e58d39 commit 6c082b0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/xenoamess/x8l/TreeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ public TreeNode changeParent(ContentNode contentNode) {

public TreeNode changeParentAndRegister(ContentNode contentNode, int index) {
this.changeParent(contentNode);
this.parent.children.add(index, this);
if (index == -1) {
this.parent.children.add(this);
} else {
this.parent.children.add(index, this);
}
return this;
}

public TreeNode changeParentAndRegister(ContentNode contentNode) {
return this.changeParentAndRegister(contentNode, this.parent.children.size());
return this.changeParentAndRegister(contentNode, -1);
}

public abstract void output(Writer writer);
Expand Down

0 comments on commit 6c082b0

Please sign in to comment.