TAAS-89: fixed weird bug with empty sections

This commit is contained in:
Kilian Schuettler 2023-08-31 11:41:22 +02:00
parent de6760abc1
commit f87e2d75b5
2 changed files with 9 additions and 3 deletions

View File

@ -76,16 +76,22 @@ public class TableCell implements GenericSemanticNode {
} }
if (textBlock == null) { if (textBlock == null) {
textBlock = streamAllSubNodes().filter(SemanticNode::isLeaf).map(SemanticNode::getLeafTextBlock).collect(new TextBlockCollector()); textBlock = buildTextBlock();
} }
return textBlock; return textBlock;
} }
private TextBlock buildTextBlock() {
return streamAllSubNodes().filter(SemanticNode::isLeaf).map(SemanticNode::getLeafTextBlock).collect(new TextBlockCollector());
}
@Override @Override
public String toString() { public String toString() {
return treeId + ": " + NodeType.TABLE_CELL + ": " + this.getTextBlock().buildSummary(); return treeId + ": " + NodeType.TABLE_CELL + ": " + this.buildTextBlock().buildSummary();
} }
} }

View File

@ -45,7 +45,7 @@ public class TablePageBlock extends AbstractPageBlock {
@Override @Override
public boolean isEmpty() { public boolean isEmpty() {
return unrotatedColCount == 0 || unrotatedRowCount == 0; return getColCount() == 0 || getRowCount() == 0;
} }
public List<List<Cell>> getRows() { public List<List<Cell>> getRows() {