Revision: 12262
http://sourceforge.net/p/foray/code/12262
Author: victormote
Date: 2021-12-22 11:45:21 +0000 (Wed, 22 Dec 2021)
Log Message:
-----------
Conform to aXSL changes: Add property accessors previously considered unnecessary.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterValue.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2021-12-21 22:18:11 UTC (rev 12261)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2021-12-22 11:45:21 UTC (rev 12262)
@@ -84,6 +84,7 @@
import org.axsl.common.value.IntrusionDisplace;
import org.axsl.common.value.LeaderAlignment;
import org.axsl.common.value.LeaderPattern;
+import org.axsl.common.value.LetterValue;
import org.axsl.common.value.LineHeightShiftAdjustment;
import org.axsl.common.value.LineStackingStrategy;
import org.axsl.common.value.LinefeedTreatment;
@@ -1127,8 +1128,8 @@
* Returns the "letter-value" trait.
* @return The "letter-value" trait.
*/
- public FoValue traitLetterValue() {
- return getPropertyList().getLetterValue();
+ public LetterValue traitLetterValue() {
+ return getPropertyList().getLetterValue(this);
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2021-12-21 22:18:11 UTC (rev 12261)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2021-12-22 11:45:21 UTC (rev 12262)
@@ -239,6 +239,7 @@
import org.axsl.common.value.BlankOrNotBlank;
import org.axsl.common.value.Compass;
import org.axsl.common.value.Conditionality;
+import org.axsl.common.value.LetterValue;
import org.axsl.common.value.OddOrEven;
import org.axsl.common.value.PagePosition;
import org.axsl.common.value.RelativeAxis;
@@ -1189,12 +1190,13 @@
/**
* Returns the letter-value property.
+ * @param fobj The FoObj to which the property belongs.
* @return The letter-value property.
*/
- public FoValue getLetterValue() {
+ public LetterValue getLetterValue(final FoObj fobj) {
final PdLetterValue property = (PdLetterValue) getProperty(FoProperty.LETTER_VALUE);
if (property != null) {
- return property.getValue();
+ return property.getValue(null, fobj);
}
return PdLetterValue.getValueNoInstance();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterValue.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterValue.java 2021-12-21 22:18:11 UTC (rev 12261)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterValue.java 2021-12-22 11:45:21 UTC (rev 12262)
@@ -34,6 +34,9 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.common.value.LetterValue;
+import org.axsl.fotree.FoContext;
+
/**
* The "letter-value" property in XSL-FO.
* @see "XSL-FO Recommendation 1.1, Section 7.26.4."
@@ -75,12 +78,29 @@
/**
* Returns the value of this property.
+ * @param context An object that knows how to resolve FO context issues.
+ * @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public FoValue getValue() {
+ public LetterValue getValue(final FoContext context, final FoObj fobj) {
if (value().canEvalKeyword()) {
final FoValue keyword = this.convertValueToFoValue(value());
- return keyword;
+ switch (keyword) {
+ case AUTO: return LetterValue.AUTO;
+ case ALPHABETIC: return LetterValue.ALPHABETIC;
+ case TRADITIONAL: return LetterValue.TRADITIONAL;
+ case INHERIT: {
+ final FoObj parent = fobj.effectiveParent(null);
+ if (parent == null) {
+ return getValueNoInstance();
+ } else {
+ return parent.traitLetterValue();
+ }
+ }
+ default: {
+ break;
+ }
+ }
}
throw this.unexpectedRetrieval();
}
@@ -89,8 +109,8 @@
* Returns the default (initial) value for this property.
* @return The initial value for this property.
*/
- public static FoValue getValueNoInstance() {
- return FoValue.AUTO;
+ public static LetterValue getValueNoInstance() {
+ return LetterValue.AUTO;
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|