// FOP
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.datatypes.LengthBase;
-import org.apache.fop.datatypes.SimplePercentBaseContext;
+import org.apache.fop.datatypes.PercentBaseContext;
import org.apache.fop.fo.FONode;
/**
/* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
- SimplePercentBaseContext pageWidthContext;
- SimplePercentBaseContext pageHeightContext;
- if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
- LengthBase.CUSTOM_BASE,
- spm.getPageWidth().getValue());
- pageHeightContext = new SimplePercentBaseContext(null,
- LengthBase.CUSTOM_BASE,
- spm.getPageHeight().getValue());
- } else {
- // invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
- LengthBase.CUSTOM_BASE,
- spm.getPageHeight().getValue());
- pageHeightContext = new SimplePercentBaseContext(null,
- LengthBase.CUSTOM_BASE,
- spm.getPageWidth().getValue());
- }
- SimplePercentBaseContext neighbourContext;
+ PercentBaseContext pageWidthContext = getPageWidthContext(LengthBase.CUSTOM_BASE);
+ PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE);
+ PercentBaseContext neighbourContext;
Rectangle vpRect;
if (spm.getWritingMode() == EN_LR_TB || spm.getWritingMode() == EN_RL_TB) {
neighbourContext = pageWidthContext;