import org.apache.fop.fo.Constants;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
+import org.apache.fop.fo.properties.KeepProperty;
/**
* Shorthand parser for page-break-before, page-break-after and page-break-inside.
|| propId == Constants.PR_KEEP_WITH_NEXT
|| propId == Constants.PR_KEEP_TOGETHER) {
if (property.getEnum() == Constants.EN_AVOID) {
- return new EnumProperty(Constants.EN_ALWAYS, "ALWAYS");
- } else {
- return new EnumProperty(Constants.EN_AUTO, "AUTO");
+ return maker.make(null, Constants.CP_WITHIN_PAGE,
+ propertyList, "always", propertyList.getFObj());
}
} else if (propId == Constants.PR_BREAK_BEFORE
|| propId == Constants.PR_BREAK_AFTER) {
case Constants.EN_ALWAYS:
return new EnumProperty(Constants.EN_PAGE, "PAGE");
case Constants.EN_LEFT:
- return new EnumProperty(Constants.EN_EVEN_PAGE, "EVEN-PAGE");
+ return new EnumProperty(Constants.EN_EVEN_PAGE, "EVEN_PAGE");
case Constants.EN_RIGHT:
- return new EnumProperty(Constants.EN_ODD_PAGE, "ODD-PAGE");
+ return new EnumProperty(Constants.EN_ODD_PAGE, "ODD_PAGE");
case Constants.EN_AVOID:
default:
- return new EnumProperty(Constants.EN_AUTO, "AUTO");
+ //nop;
}
}
return null;
<fo:flow flow-name="xsl-region-body">
<fo:block page-break-before="avoid">
<test:assert property="break-before" expected="AUTO" />
- <test:assert property="keep-with-previous" expected="ALWAYS" />
+ <test:assert property="keep-with-previous.within-page" expected="ALWAYS" />
Block 1: testing page-break-before="avoid"
</fo:block>
<fo:block page-break-before="always">
<test:assert property="break-before" expected="PAGE" />
- <test:assert property="keep-with-previous" expected="AUTO" />
+ <test:assert property="keep-with-previous.within-page" expected="AUTO" />
Block 2: testing page-break-before="always"
</fo:block>
<fo:block page-break-before="left">
- <test:assert property="break-before" expected="EVEN-PAGE" />
- <test:assert property="keep-with-previous" expected="AUTO" />
+ <test:assert property="break-before" expected="EVEN_PAGE" />
+ <test:assert property="keep-with-previous.within-page" expected="AUTO" />
Block 3: testing page-break-before="left"
</fo:block>
<fo:block page-break-before="right">
- <test:assert property="break-before" expected="ODD-PAGE" />
- <test:assert property="keep-with-previous" expected="AUTO" />
+ <test:assert property="break-before" expected="ODD_PAGE" />
+ <test:assert property="keep-with-previous.within-page" expected="AUTO" />
Block 4: testing page-break-before="right"
</fo:block>
<fo:block page-break-after="avoid">
<test:assert property="break-after" expected="AUTO" />
- <test:assert property="keep-with-next" expected="ALWAYS" />
+ <test:assert property="keep-with-next.within-page" expected="ALWAYS" />
Block 5: testing page-break-after="avoid"
</fo:block>
<fo:block page-break-after="always">
<test:assert property="break-after" expected="PAGE" />
- <test:assert property="keep-with-next" expected="AUTO" />
+ <test:assert property="keep-with-next.within-page" expected="AUTO" />
Block 6: testing page-break-after="always"
</fo:block>
<fo:block page-break-after="left">
- <test:assert property="break-after" expected="EVEN-PAGE" />
- <test:assert property="keep-with-next" expected="AUTO" />
+ <test:assert property="break-after" expected="EVEN_PAGE" />
+ <test:assert property="keep-with-next.within-page" expected="AUTO" />
Block 7: testing page-break-after="left"
</fo:block>
<fo:block page-break-after="right">
- <test:assert property="break-after" expected="ODD-PAGE" />
- <test:assert property="keep-with-next" expected="AUTO" />
+ <test:assert property="break-after" expected="ODD_PAGE" />
+ <test:assert property="keep-with-next.within-page" expected="AUTO" />
Block 8: testing page-break-after="right"
</fo:block>
<fo:block page-break-inside="avoid">
- <test:assert property="keep-together" expected="ALWAYS" />
+ <test:assert property="keep-together.within-page" expected="ALWAYS" />
Block 9: testing page-break-inside="avoid"
</fo:block>
<fo:block page-break-before="left" page-break-inside="avoid"
page-break-after="right">
- <test:assert property="break-before" expected="EVEN-PAGE" />
- <test:assert property="keep-with-previous" expected="AUTO" />
- <test:assert property="break-after" expected="ODD-PAGE" />
- <test:assert property="keep-with-next" expected="AUTO" />
- <test:assert property="keep-together" expected="ALWAYS" />
+ <test:assert property="break-before" expected="EVEN_PAGE" />
+ <test:assert property="keep-with-previous.within-page" expected="AUTO" />
+ <test:assert property="break-after" expected="ODD_PAGE" />
+ <test:assert property="keep-with-next.within-page" expected="AUTO" />
+ <test:assert property="keep-together.within-page" expected="ALWAYS" />
Block 10: testing page-break-before="left", page-break-inside="avoid"
and page-break-after="right"
</fo:block>