[FOray-commit] SF.net SVN: foray:[12353] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-01-07 12:46:15
|
Revision: 12353
http://sourceforge.net/p/foray/code/12353
Author: victormote
Date: 2022-01-07 12:46:13 +0000 (Fri, 07 Jan 2022)
Log Message:
-----------
Improvements to areatree/pioneer.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/SpanRa4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/SpanRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/SpanRa4a.java 2022-01-07 11:40:15 UTC (rev 12352)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/SpanRa4a.java 2022-01-07 12:46:13 UTC (rev 12353)
@@ -204,9 +204,19 @@
@Override
public SpanRa4a getOverflowArea(final Area4a childRequesting) throws AreaTreeException {
+ if (! (childRequesting instanceof NormalFlowRa4a)) {
+ throw new IllegalArgumentException();
+ }
+ final NormalFlowRa4a nfra = (NormalFlowRa4a) childRequesting;
+
/* Spans stack in the block-progression-direction, and the last span on the page extends to the end (after-edge)
* of the parent main-reference-area. Therefore, if the child has overflowed, we need a new page. */
final MainRa4a newMainRa = getParent().getOverflowArea(this);
+
+ /* Since this is overflow, the new span area should have the same number of columns as the one from the
+ * previous page. */
+ final int qtyColumns = nfra.getParent().areaNodeCount();
+ newMainRa.addSpanArea(qtyColumns);
return newMainRa.areaNodeAt(0);
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-01-07 11:40:15 UTC (rev 12352)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-01-07 12:46:13 UTC (rev 12353)
@@ -62,16 +62,14 @@
setProgress(0);
}
- if (! (areaNode instanceof ParaContext)) {
- throw new IllegalArgumentException("AreaNode must be an instance of ParaControl");
+ final NormalBlockArea normalBlockArea = areaNode instanceof NormalBlockArea ? (NormalBlockArea) areaNode :
+ areaNode.ancestorNormalBlockArea();
+ if (normalBlockArea == null) {
+ throw new IllegalArgumentException(AreaNode.class.getName() + " must be or have an ancestor " +
+ NormalBlockArea.class.getName());
}
- final ParaContext paraContext = (ParaContext) areaNode;
+ final ParaContext paraContext = normalBlockArea.getParaContext();
- if (! (areaNode instanceof NormalBlockArea)) {
- throw new IllegalArgumentException("AreaNode must be an instance of NormalBlockArea");
- }
- final NormalBlockArea normalBlockArea = (NormalBlockArea) areaNode;
-
final LineBreaker lb = areaNode.getAreaTree().getLineBreaker();
final LineBreakResult result = lb.breakIntoLines(this.node, (ParaConfig) this.node, paraContext);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|