diff options
author | Simon Steiner <ssteiner@apache.org> | 2021-05-25 09:08:58 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2021-05-25 09:08:58 +0000 |
commit | d45049750af6e120424ced7aa7a057cc1540f535 (patch) | |
tree | 016097f293688e9a661913cb68b89916815b912a /fop-core | |
parent | 5ce5fe50a74b9e3f84cabcffee46f860c86dbd47 (diff) | |
download | xmlgraphics-fop-d45049750af6e120424ced7aa7a057cc1540f535.tar.gz xmlgraphics-fop-d45049750af6e120424ced7aa7a057cc1540f535.zip |
FOP-3014: ConcurrentModificationException for table cell
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1890190 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-core')
3 files changed, 11 insertions, 11 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java index 476860704..57f790912 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java @@ -436,10 +436,12 @@ public class TextLayoutManager extends LeafNodeLayoutManager { } private void setBlockProgressionOffset() { - if (blockProgressionDimension == alignmentContext.getHeight()) { - textArea.setBlockProgressionOffset(0); - } else { - textArea.setBlockProgressionOffset(alignmentContext.getOffset()); + if (alignmentContext != null) { + if (blockProgressionDimension == alignmentContext.getHeight()) { + textArea.setBlockProgressionOffset(0); + } else { + textArea.setBlockProgressionOffset(alignmentContext.getOffset()); + } } } diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/ActiveCell.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/ActiveCell.java index 81841b246..668bd9c19 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/ActiveCell.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/ActiveCell.java @@ -239,25 +239,23 @@ class ActiveCell { private void handleExplicitHeight(MinOptMax cellBPD, MinOptMax rowBPD) { int minBPD = Math.max(cellBPD.getMin(), rowBPD.getMin()); if (minBPD > 0) { - ListIterator iter = elementList.listIterator(); int cumulateLength = 0; boolean prevIsBox = false; - while (iter.hasNext() && cumulateLength < minBPD) { - KnuthElement el = (KnuthElement) iter.next(); + for (int i = 0; i < elementList.size() && cumulateLength < minBPD; i++) { + KnuthElement el = (KnuthElement) elementList.get(i); if (el.isBox()) { prevIsBox = true; cumulateLength += el.getWidth(); } else if (el.isGlue()) { if (prevIsBox) { - elementList.add(iter.nextIndex() - 1, - new FillerPenalty(minBPD - cumulateLength)); + elementList.add(i, new FillerPenalty(minBPD - cumulateLength)); } prevIsBox = false; cumulateLength += el.getWidth(); } else { prevIsBox = false; if (cumulateLength + el.getWidth() < minBPD) { - iter.set(new FillerPenalty((KnuthPenalty) el, minBPD - cumulateLength)); + elementList.set(i, new FillerPenalty((KnuthPenalty) el, minBPD - cumulateLength)); } } } diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java index a56b00ce7..cba4c2fae 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java @@ -703,7 +703,7 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager { * @param childArea the child to add to the cell */ public void addChildArea(Area childArea) { - if (curBlockArea != null) { + if (curBlockArea != null && childArea instanceof Block) { curBlockArea.addBlock((Block) childArea); } } |