]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
In addKnuthElementsForBorderPaddingXXX, if the returnlist is a
authorSimon Pepping <spepping@apache.org>
Fri, 8 Feb 2008 19:20:27 +0000 (19:20 +0000)
committerSimon Pepping <spepping@apache.org>
Fri, 8 Feb 2008 19:20:27 +0000 (19:20 +0000)
BlockKnuthSequence, the border and padding should be added to the
first or last paragraph inside it, but it is too late to do that
now. At least, avoid adding it to the bpd sequence.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@619979 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java

index b10e411324e949341dbf0d79f072bf728e49045c..b449b668990093c568a6bc4a8c15edd19e950303 100755 (executable)
@@ -548,6 +548,14 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
      */
     protected void addKnuthElementsForBorderPaddingStart(List returnList) {
         //Border and Padding (start)
+        /**
+         * If the returnlist is a BlockKnuthSequence, the border and padding should be added
+         * to the first paragraph inside it, but it is too late to do that now.
+         * At least, avoid adding it to the bpd sequence.
+         */
+        if (returnList instanceof BlockKnuthSequence) {
+            return;
+        }
         CommonBorderPaddingBackground borderAndPadding = fobj.getCommonBorderPaddingBackground();
         if (borderAndPadding != null) {
             int ipStart = borderAndPadding.getBorderStartWidth(false)
@@ -564,6 +572,14 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
      */
     protected void addKnuthElementsForBorderPaddingEnd(List returnList) {
         //Border and Padding (after)
+        /**
+         * If the returnlist is a BlockKnuthSequence, the border and padding should be added
+         * to the last paragraph inside it, but it is too late to do that now.
+         * At least, avoid adding it to the bpd sequence.
+         */
+        if (returnList instanceof BlockKnuthSequence) {
+            return;
+        }
         CommonBorderPaddingBackground borderAndPadding = fobj.getCommonBorderPaddingBackground();
         if (borderAndPadding != null) {
             int ipEnd = borderAndPadding.getBorderEndWidth(false)