Skip to content

Commit

Permalink
继续修复缩进问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ririv committed Nov 11, 2021
1 parent 7c295b9 commit 49cabb1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public abstract class Form {
* @return currentBookmark - 但应使用last接受返回值,因为add完current,last就得更新了,current变为新的last
*/
protected Bookmark addBookmarkByLevel(Bookmark current, Bookmark last, int level) {

if (level == 0) {
rootBookmark.getChildren().add(current);
current.setParent(rootBookmark);
Expand All @@ -36,9 +37,10 @@ protected Bookmark addBookmarkByLevel(Bookmark current, Bookmark last, int level
current.setParent(last);
} else { //回到上级,可能跳级
List<Bookmark> currentList = null;
Bookmark temp = last;
for (int dif = last.getLevel() - level; dif != 0; dif--) {
currentList = last.getParent().getOwnerList();
last = last.getParent(); //
currentList = temp.getParent().getOwnerList();
temp = temp.getParent();
}
assert currentList != null;
currentList.add(current);
Expand Down

0 comments on commit 49cabb1

Please sign in to comment.