pbwest 2002/10/03 06:24:57
Modified: src/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java
Log:
Added inherited and non-inherited bitsets.
Set inherited and non-inherited properties through bitsets.
Moved test of specified property against subtree attribute set to
top of attributes handling.
Revision Changes Path
No revision
No revision
1.19.2.13 +50 -30 xml-fop/src/org/apache/fop/fo/FONode.java
Index: FONode.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
retrieving revision 1.19.2.12
retrieving revision 1.19.2.13
diff -u -r1.19.2.12 -r1.19.2.13
--- FONode.java 2 Oct 2002 15:14:21 -0000 1.19.2.12
+++ FONode.java 3 Oct 2002 13:24:56 -0000 1.19.2.13
@@ -2,6 +2,7 @@
import org.apache.fop.fo.FOTree;
import org.apache.fop.fo.FOAttributes;
+import org.apache.fop.fo.FObjectNames;
import org.apache.fop.fo.FOPropertySets;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.fo.expr.PropertyParser;
@@ -76,7 +77,13 @@
/** The <i>attrSet</i> argument. */
public final int attrSet;
/** The <tt>ROBitSet</tt> of the <i>attrSet</i> argument. */
- protected ROBitSet nodeAttrBitSet;
+ protected ROBitSet attrBitSet;
+ /** The <tt>ROBitSet</tt> of inherited properties for the
+ <i>attrSet</i> argument. */
+ protected ROBitSet inheritedBitSet;
+ /** The <tt>ROBitSet</tt> of non-inherited prperties for the
+ <i>attrSet</i> argument. */
+ protected ROBitSet nonInheritedBitSet;
/** Ancestor reference area of this FONode. */
protected FONode ancestorRefArea = null;
@@ -100,7 +107,9 @@
this.parent = parent;
this.event = event;
this.attrSet = attrSet;
- nodeAttrBitSet = FOPropertySets.getAttrROBitSet(attrSet);
+ attrBitSet = FOPropertySets.getAttrROBitSet(attrSet);
+ inheritedBitSet = FOPropertySets.getInheritedROBitSet(attrSet);
+ nonInheritedBitSet = FOPropertySets.getNonInheritedROBitSet(attrSet);
xmlevents = foTree.xmlevents;
namespaces = xmlevents.getNamespaces();
exprParser = foTree.exprParser;
@@ -110,6 +119,23 @@
processAttributes();
}
// Set up the remaining properties.
+ for (int prop = inheritedBitSet.nextSetBit(0);
+ prop >= 0;
+ prop = inheritedBitSet.nextSetBit(++prop))
+ {
+ if (parent != null)
+ propertySet[prop] = parent.propertySet[prop];
+ else
+ propertySet[prop] = foTree.getInitialValue(prop);
+ }
+
+ for (int prop = nonInheritedBitSet.nextSetBit(0);
+ prop >= 0;
+ prop = inheritedBitSet.nextSetBit(++prop))
+ {
+ propertySet[prop] = foTree.getInitialValue(prop);
+ }
+
}
private void processAttributes() throws FOPException, PropertyException {
@@ -122,43 +148,37 @@
}
for (int propx = 0; propx < numAttrs; propx++) {
PropertyValue props;
- int type;
+ int ptype;
int property;
int prop = foKeys[propx].intValue();
+ if ( ! attrBitSet.get(prop)) {
+ MessageHandler.log("Ignoring "
+ + PropNames.getPropertyName(prop)
+ + " on "
+ + FObjectNames.getFOName(type)
+ + " for attribute set "
+ + FOPropertySets.getAttrSetName(attrSet)
+ + ".");
+ continue;
+ }
String attrValue = foAttributes.getFoAttrValue(prop);
props = handleAttrValue(prop, attrValue);
- type = props.getType();
- if (type != PropertyValue.LIST) {
+ ptype = props.getType();
+ if (ptype != PropertyValue.LIST) {
property = props.getProperty();
- if ( ! nodeAttrBitSet.get(property)) {
- MessageHandler.log("Ignoring property "
- + PropNames.getPropertyName(property)
- + " for attribute set "
- + FOPropertySets.getAttrSetName(attrSet)
- + ".");
- } else {
- stackValue(props);
- // Handle corresponding properties here
- // Update the propertySet
- propertySet[props.getProperty()] = props;
- }
+ stackValue(props);
+ // Handle corresponding properties here
+ // Update the propertySet
+ propertySet[props.getProperty()] = props;
} else { // a list
PropertyValue value;
Iterator propvals = ((PropertyValueList)props).iterator();
while (propvals.hasNext()) {
value = (PropertyValue)(propvals.next());
property = value.getProperty();
- if ( ! nodeAttrBitSet.get(property)) {
- MessageHandler.log("Ignoring property "
- + PropNames.getPropertyName(property)
- + " for attribute set "
- + FOPropertySets.getAttrSetName(attrSet)
- + ".");
- } else {
- stackValue(value);
- // Handle corresponding properties here
- propertySet[value.getProperty()] = value;
- }
+ stackValue(value);
+ // Handle corresponding properties here
+ propertySet[value.getProperty()] = value;
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]