wip: bookmark replace
This commit is contained in:
parent
4643237449
commit
efd01c8d2e
@ -82,6 +82,7 @@ public class BookmarkExec {
|
||||
List<XWPFRun> runs = paragraph.getRuns();
|
||||
XWPFRun run = null;
|
||||
int idx = 0;
|
||||
boolean doR = false;
|
||||
for (int i = 0; i < runs.size(); i++) {
|
||||
Node previousSibling = runs.get(i).getCTR().getDomNode().getPreviousSibling();
|
||||
if (previousSibling != null) {
|
||||
@ -92,16 +93,17 @@ public class BookmarkExec {
|
||||
Node nameAttribute = bookmarkStartNode.getAttributes().getNamedItem("w:name");
|
||||
if (nameAttribute != null && name.equals(nameAttribute.getNodeValue())) {
|
||||
idx = i - 1;
|
||||
doR = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (idx >= 0 && idx < runs.size()) {
|
||||
if (idx >= 0 && idx < runs.size() && doR) {
|
||||
run = runs.get(idx);
|
||||
} else {
|
||||
run = paragraph.createRun();
|
||||
run = runs.get(runs.size() - 1);
|
||||
}
|
||||
BookmarkReplaceDataModel model = map.get(name);
|
||||
BookmarkType type = model.getType();
|
||||
|
Loading…
Reference in New Issue
Block a user