Commit 244169f6 authored by Nico Mack's avatar Nico Mack

Minor code cleanup

parent 0397581c
......@@ -853,9 +853,7 @@ public class BootstrappingUtils {
}
}
if (colour == null)
{
if (colour == null) {
if (optional) {
colour = defaultColour;
} else {
......@@ -878,7 +876,7 @@ public class BootstrappingUtils {
// ---------------------------------------------------------------------------
public static Font getContentAsFont(Element rootElement, String childName, boolean optional, Font defaultFont, BootstrapContext context) throws BuildException {
Font font = defaultFont;
Font font = null;
Element fontNode = (childName != null) ? rootElement.getChild(childName) : rootElement;
if (fontNode != null) {
......@@ -894,6 +892,14 @@ public class BootstrappingUtils {
font = new Font(fontName, FONT_STYLES.get(fontStyle.toLowerCase()), fontSize);
}
if (font == null) {
if (optional) {
font = defaultFont;
} else {
logAndThrowBuildException(new BuildException(StringUtils.build(MANDATORY_NODE_TEMPLATE, childName)), rootElement, childName);
}
}
return font;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment