fix bug generating tables - cells with only imgs that are refs - and add convenience methods

This commit is contained in:
Grahame Grieve 2020-05-20 18:48:01 +10:00
parent e496907985
commit e2c955a8f4
2 changed files with 16 additions and 1 deletions

View File

@ -208,6 +208,11 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
children = new ArrayList<XhtmlNode>();
return children;
}
public Piece addHtml(XhtmlNode x) {
getChildren().add(x);
return this;
}
}
@ -735,7 +740,11 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
a.setAttribute("href", p.getReference());
if (!Utilities.noString(p.getHint()))
a.setAttribute("title", p.getHint());
a.addText(p.getText());
if (p.getText() != null) {
a.addText(p.getText());
} else {
a.addChildren(p.getChildren());
}
addStyle(a, p);
} else {
if (!Utilities.noString(p.getHint())) {

View File

@ -653,4 +653,10 @@ public class XhtmlNode implements IBaseXhtml {
return this;
}
public XhtmlNode addChildren(List<XhtmlNode> children) {
getChildNodes().addAll(children);
return this;
}
}