Browse Source

Added default empty String to the border-* shorthands. Added warning for the case where inherit is used, but no value is available from the parent.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@378017 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-0_92-beta
Andreas L. Delmelle 18 years ago
parent
commit
9d382c1d90

+ 7
- 0
src/java/org/apache/fop/fo/FOPropertyMapping.java View File

@@ -2640,30 +2640,35 @@ public class FOPropertyMapping implements Constants {
// border-bottom
m = new ListProperty.Maker(PR_BORDER_BOTTOM);
m.setInherited(false);
m.setDefault("");
m.setDatatypeParser(new GenericShorthandParser());
addPropertyMaker("border-bottom", m);

// border-color
m = new ListProperty.Maker(PR_BORDER_COLOR);
m.setInherited(false);
m.setDefault("");
m.setDatatypeParser(new BoxPropShorthandParser());
addPropertyMaker("border-color", m);

// border-left
m = new ListProperty.Maker(PR_BORDER_LEFT);
m.setInherited(false);
m.setDefault("");
m.setDatatypeParser(new GenericShorthandParser());
addPropertyMaker("border-left", m);

// border-right
m = new ListProperty.Maker(PR_BORDER_RIGHT);
m.setInherited(false);
m.setDefault("");
m.setDatatypeParser(new GenericShorthandParser());
addPropertyMaker("border-right", m);

// border-style
m = new ListProperty.Maker(PR_BORDER_STYLE);
m.setInherited(false);
m.setDefault("");
m.setDatatypeParser(new BoxPropShorthandParser());
addPropertyMaker("border-style", m);

@@ -2677,12 +2682,14 @@ public class FOPropertyMapping implements Constants {
// border-top
m = new ListProperty.Maker(PR_BORDER_TOP);
m.setInherited(false);
m.setDefault("");
m.setDatatypeParser(new GenericShorthandParser());
addPropertyMaker("border-top", m);

// border-width
m = new ListProperty.Maker(PR_BORDER_WIDTH);
m.setInherited(false);
m.setDefault("");
m.setDatatypeParser(new BoxPropShorthandParser());
addPropertyMaker("border-width", m);


+ 10
- 4
src/java/org/apache/fop/fo/properties/PropertyMaker.java View File

@@ -413,6 +413,12 @@ public class PropertyMaker implements Cloneable {
if ((propId & Constants.COMPOUND_MASK) != 0) {
newProp = getSubprop(newProp, propId & Constants.COMPOUND_MASK);
}
if (newProp.getString() == null) {
log.warn("Specified value of \"inherit\" for "
+ FOPropertyMapping.getPropertyName(getPropId()) + " on "
+ propertyList.getFObj().getName() + ", but no "
+ "inherited or specified value found on the parent FO.");
}
} else {
// Check for keyword shorthand values to be substituted.
pvalue = checkValueKeywords(pvalue);
@@ -477,13 +483,13 @@ public class PropertyMaker implements Cloneable {
// If value is a name token, may be keyword or Enum
String sval = prop.getNCname();
if (sval != null) {
log.debug("Convert shorthand ncname " + sval);
//log.debug("Convert shorthand ncname " + sval);
pret = checkEnumValues(sval);
if (pret == null) {
/* Check for keyword shorthand values to be substituted. */
String pvalue = checkValueKeywords(sval);
if (!pvalue.equals(sval)) {
log.debug("Convert shorthand keyword" + pvalue);
//log.debug("Convert shorthand keyword" + pvalue);
// Substituted a value: must parse it
Property p = PropertyParser.parse(pvalue,
new PropertyInfo(this,
@@ -525,8 +531,8 @@ public class PropertyMaker implements Cloneable {
* file specifies a length value equivalent for these keywords,
* such as "0.5pt" for "thin".
* @param keyword the string value of property attribute.
* @return a String containing a parseable equivalent or null if
* the passed value isn't a keyword initializer for this Property.
* @return a String containing a parseable equivalent or null if
* the passed value isn't a keyword initializer for this Property
*/
protected String checkValueKeywords(String keyword) {
if (keywords != null) {

Loading…
Cancel
Save