Skip to content

Commit

Permalink
Merge pull request #38 from airslateinc/fix-ibody-elements-insert
Browse files Browse the repository at this point in the history
fixed iBodies element injection
  • Loading branch information
alekseytatarynov authored May 10, 2022
2 parents 0e981e2 + 373ec6e commit 7139ec2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public XWPFTable insertNewTbl(XmlCursor cursor) {
cursor = t.newCursor();
while (cursor.toPrevSibling()) {
o = cursor.getObject();
if (o instanceof CTP || o instanceof CTTbl)
if (o instanceof CTP || o instanceof CTTbl || o instanceof CTSdtBlock)
i++;
}
bodyElements.add(i, newT);
Expand Down Expand Up @@ -383,7 +383,7 @@ public XWPFParagraph insertNewParagraph(final XmlCursor cursor) {
}
while (cursor.toPrevSibling()) {
o = cursor.getObject();
if (o instanceof CTP || o instanceof CTTbl)
if (o instanceof CTP || o instanceof CTTbl || o instanceof CTSdtBlock)
i++;
}
bodyElements.add(i, newP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public XWPFParagraph insertNewParagraph(XmlCursor cursor) {
p2.dispose();
while (cursor.toPrevSibling()) {
o = cursor.getObject();
if (o instanceof CTP || o instanceof CTTbl)
if (o instanceof CTP || o instanceof CTTbl || o instanceof CTSdtBlock)
i++;
}
bodyElements.add(i, newP);
Expand Down Expand Up @@ -224,7 +224,7 @@ public XWPFTable insertNewTbl(XmlCursor cursor) {
XmlCursor cursor2 = t.newCursor();
while (cursor2.toPrevSibling()) {
o = cursor2.getObject();
if (o instanceof CTP || o instanceof CTTbl) {
if (o instanceof CTP || o instanceof CTTbl || o instanceof CTSdtBlock) {
i++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ public XWPFTable insertNewTbl(XmlCursor cursor) {
cursor.toCursor(tableCursor);
while (cursor.toPrevSibling()) {
o = cursor.getObject();
if (o instanceof CTP || o instanceof CTTbl) {
if (o instanceof CTP || o instanceof CTTbl || o instanceof CTSdtBlock) {
i++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public XWPFParagraph insertNewParagraph(XmlCursor cursor) {
}
while (cursor.toPrevSibling()) {
o = cursor.getObject();
if (o instanceof CTP || o instanceof CTTbl)
if (o instanceof CTP || o instanceof CTTbl || o instanceof CTSdtBlock)
i++;
}
bodyElements.add(i, newP);
Expand Down Expand Up @@ -524,7 +524,7 @@ public XWPFTable insertNewTbl(final XmlCursor cursor) {
try {
while (cursor2.toPrevSibling()) {
o = cursor2.getObject();
if (o instanceof CTP || o instanceof CTTbl) {
if (o instanceof CTP || o instanceof CTTbl || o instanceof CTSdtBlock) {
i++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public XWPFParagraph insertNewParagraph(XmlCursor cursor) {
cursor.toCursor(newParaPos);
while (cursor.toPrevSibling()) {
o = cursor.getObject();
if (o instanceof CTP || o instanceof CTTbl) {
if (o instanceof CTP || o instanceof CTTbl || o instanceof CTSdtBlock) {
i++;
}
}
Expand Down Expand Up @@ -211,7 +211,7 @@ public XWPFTable insertNewTbl(XmlCursor cursor) {
cursor.toCursor(tableCursor);
while (cursor.toPrevSibling()) {
o = cursor.getObject();
if (o instanceof CTP || o instanceof CTTbl) {
if (o instanceof CTP || o instanceof CTTbl || o instanceof CTSdtBlock) {
i++;
}
}
Expand Down

0 comments on commit 7139ec2

Please sign in to comment.