Refactored table split method
This commit is contained in:
parent
b228bb9333
commit
50050c7de2
1 changed files with 10 additions and 6 deletions
|
@ -43,8 +43,7 @@ public class ODFPageSplitter {
|
|||
style = ofr.getParStyle(Misc.getAttribute(child, TEXT_STYLE_NAME));
|
||||
}
|
||||
} else if (nodeName.equals(TABLE_TABLE)) {
|
||||
if (handleTableTable(childFirstPart, child)){
|
||||
onode.insertBefore(childFirstPart, child);
|
||||
if (handleTableTable(child)){
|
||||
style = ofr.getTableStyle(Misc.getAttribute(child, TABLE_STYLE_NAME));
|
||||
}
|
||||
} else if (nodeName.equals(TEXT_LIST)) {
|
||||
|
@ -273,7 +272,7 @@ public class ODFPageSplitter {
|
|||
return dataMoved;
|
||||
}
|
||||
//Needs finish
|
||||
private static boolean handleTableTable(Node tableFirstPart, Node table) {
|
||||
private static boolean handleTableTable(Node table) {
|
||||
|
||||
/*
|
||||
* // TODO: 0.Test if soft-page-break not at start of table // - in that
|
||||
|
@ -287,7 +286,9 @@ public class ODFPageSplitter {
|
|||
* to the first SPB
|
||||
*
|
||||
*
|
||||
*/
|
||||
*/
|
||||
Node parent = table.getParentNode();
|
||||
Node tableFirstPart = table.cloneNode(false);
|
||||
NodeList tableChildNodes = table.getChildNodes();
|
||||
// Node counter
|
||||
int i = 0;
|
||||
|
@ -349,6 +350,9 @@ public class ODFPageSplitter {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (dataMoved) {
|
||||
parent.insertBefore(tableFirstPart, table);
|
||||
}
|
||||
return dataMoved;
|
||||
}
|
||||
|
||||
|
@ -571,8 +575,8 @@ public class ODFPageSplitter {
|
|||
i++;
|
||||
continue;
|
||||
} else if (nodeName.equals(TABLE_TABLE)) {
|
||||
if (handleTableTable(childFirstPart, child)){
|
||||
sectionFirstPart.appendChild(childFirstPart);
|
||||
if (handleTableTable(child)){
|
||||
sectionFirstPart.appendChild(child.getPreviousSibling());
|
||||
dataMoved=true;
|
||||
}
|
||||
} else if (nodeName.equals(TEXT_SECTION)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue