You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2005/05/18 10:59:36 UTC
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockStackingLayoutManager.java LineLayoutManager.java
jeremias 2005/05/18 01:59:36
Modified: src/java/org/apache/fop/layoutmgr
BlockStackingLayoutManager.java
LineLayoutManager.java
Log:
Handle empty inlines/blocks better.
Revision Changes Path
1.16 +3 -2 xml-fop/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
Index: BlockStackingLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- BlockStackingLayoutManager.java 17 May 2005 17:00:24 -0000 1.15
+++ BlockStackingLayoutManager.java 18 May 2005 08:59:36 -0000 1.16
@@ -232,7 +232,8 @@
// get elements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
- if (returnedList.size() == 1
+ if (returnedList != null
+ && returnedList.size() == 1
&& ((KnuthElement) returnedList.getFirst()).isPenalty()
&& ((KnuthPenalty) returnedList.getFirst()).getP() == -KnuthElement.INFINITE) {
// a descendant of this block has break-before
@@ -281,7 +282,7 @@
// a penalty
}
}
- if (returnedList.size() == 0) {
+ if (returnedList == null || returnedList.size() == 0) {
//Avoid NoSuchElementException below (happens with empty blocks)
continue;
}
1.46 +3 -0 xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
Index: LineLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- LineLayoutManager.java 17 May 2005 17:00:24 -0000 1.45
+++ LineLayoutManager.java 18 May 2005 08:59:36 -0000 1.46
@@ -575,6 +575,9 @@
= curLM.getNextKnuthElements(inlineLC,
effectiveAlignment))
!= null) {
+ if (returnedList.size() == 0) {
+ continue;
+ }
// look at the first element
thisElement = (KnuthElement) returnedList.getFirst();
if (thisElement.isBox() && !thisElement.isAuxiliary()
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org