diff options
Diffstat (limited to 'src/java/org/apache/fop/area')
-rw-r--r-- | src/java/org/apache/fop/area/inline/FilledArea.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/area/inline/FilledArea.java b/src/java/org/apache/fop/area/inline/FilledArea.java index afbcbe73f..84e905536 100644 --- a/src/java/org/apache/fop/area/inline/FilledArea.java +++ b/src/java/org/apache/fop/area/inline/FilledArea.java @@ -19,6 +19,7 @@ package org.apache.fop.area.inline; import java.util.List; +import java.util.ListIterator; import java.util.ArrayList; /** @@ -40,6 +41,29 @@ public class FilledArea extends InlineParent { } /** + * Set the offset of the descendant TextAreas, + * instead of the offset of the FilledArea itself. + * + * @param v the offset + */ + public void setOffset(int v) { + setChildOffset(inlines.listIterator(), v); + } + + private void setChildOffset(ListIterator childrenIterator, int v) { + while (childrenIterator.hasNext()) { + InlineArea child = (InlineArea) childrenIterator.next(); + if (child instanceof InlineParent) { + setChildOffset(((InlineParent) child).getChildAreas().listIterator(), v); + } else if (child instanceof org.apache.fop.area.inline.Viewport) { + // nothing + } else { + child.setOffset(v); + } + } + } + + /** * Set the unit width for the areas to fill the full width. * * @param w the unit width |