From 54de5c5c3ba492a0f0576098d28f5518b28d698f Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Wed, 18 Jun 2008 09:02:45 +0000 Subject: [PATCH] Bugzilla #44412: Regression fix for empty pages caused by multiple collapsible breaks. No more empty block areas if a break-before occurs on the first child of an FO to match the behaviour of tables and other FO implementations (clarification by XSL WG pending). Added an accessor interface for break-before/-after to avoid long if..else lists in BlockStackingLayoutManager. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95@669118 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/flow/Block.java | 3 +- .../apache/fop/fo/flow/BlockContainer.java | 3 +- .../org/apache/fop/fo/flow/ListBlock.java | 3 +- src/java/org/apache/fop/fo/flow/ListItem.java | 3 +- .../org/apache/fop/fo/flow/table/Table.java | 6 +- .../fop/fo/flow/table/TableAndCaption.java | 2 +- .../apache/fop/fo/flow/table/TableRow.java | 8 +- .../fop/fo/properties/BreakPropertySet.java | 33 ++++ .../BlockContainerLayoutManager.java | 11 +- .../layoutmgr/BlockStackingLayoutManager.java | 75 ++++++--- .../apache/fop/layoutmgr/LayoutContext.java | 14 +- .../layoutmgr/list/ListItemLayoutManager.java | 5 +- .../layoutmgr/table/TableLayoutManager.java | 15 +- src/java/org/apache/fop/util/BreakUtil.java | 3 +- status.xml | 3 + .../block_break-before_bug44412.xml | 17 +- .../block_break-before_bug44412_2.xml | 151 ++++++++++++++++++ 17 files changed, 286 insertions(+), 69 deletions(-) create mode 100644 src/java/org/apache/fop/fo/properties/BreakPropertySet.java create mode 100644 test/layoutengine/standard-testcases/block_break-before_bug44412_2.xml diff --git a/src/java/org/apache/fop/fo/flow/Block.java b/src/java/org/apache/fop/fo/flow/Block.java index 30b4c5495..57bb52f05 100644 --- a/src/java/org/apache/fop/fo/flow/Block.java +++ b/src/java/org/apache/fop/fo/flow/Block.java @@ -32,6 +32,7 @@ import org.apache.fop.fo.FObjMixed; import org.apache.fop.fo.NullCharIterator; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; +import org.apache.fop.fo.properties.BreakPropertySet; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.fo.properties.CommonFont; import org.apache.fop.fo.properties.CommonHyphenation; @@ -43,7 +44,7 @@ import org.apache.fop.fo.properties.SpaceProperty; /** * Class modelling the fo:block object. */ -public class Block extends FObjMixed { +public class Block extends FObjMixed implements BreakPropertySet { // used for FO validation private boolean blockOrInlineItemFound = false; diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java index a71999938..6144df1cc 100644 --- a/src/java/org/apache/fop/fo/flow/BlockContainer.java +++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java @@ -28,6 +28,7 @@ import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; +import org.apache.fop.fo.properties.BreakPropertySet; import org.apache.fop.fo.properties.CommonAbsolutePosition; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.fo.properties.CommonMarginBlock; @@ -37,7 +38,7 @@ import org.apache.fop.fo.properties.LengthRangeProperty; /** * Class modelling the fo:block-container object. */ -public class BlockContainer extends FObj { +public class BlockContainer extends FObj implements BreakPropertySet { // The value of properties relevant for fo:block-container. private CommonAbsolutePosition commonAbsolutePosition; private CommonBorderPaddingBackground commonBorderPaddingBackground; diff --git a/src/java/org/apache/fop/fo/flow/ListBlock.java b/src/java/org/apache/fop/fo/flow/ListBlock.java index 86c581cc3..68f497a1a 100644 --- a/src/java/org/apache/fop/fo/flow/ListBlock.java +++ b/src/java/org/apache/fop/fo/flow/ListBlock.java @@ -27,6 +27,7 @@ import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; +import org.apache.fop.fo.properties.BreakPropertySet; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.fo.properties.CommonMarginBlock; import org.apache.fop.fo.properties.KeepProperty; @@ -34,7 +35,7 @@ import org.apache.fop.fo.properties.KeepProperty; /** * Class modelling the fo:list-block object. */ -public class ListBlock extends FObj { +public class ListBlock extends FObj implements BreakPropertySet { // The value of properties relevant for fo:list-block. private CommonBorderPaddingBackground commonBorderPaddingBackground; private CommonMarginBlock commonMarginBlock; diff --git a/src/java/org/apache/fop/fo/flow/ListItem.java b/src/java/org/apache/fop/fo/flow/ListItem.java index c09313ef6..029d746b3 100644 --- a/src/java/org/apache/fop/fo/flow/ListItem.java +++ b/src/java/org/apache/fop/fo/flow/ListItem.java @@ -26,6 +26,7 @@ import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; +import org.apache.fop.fo.properties.BreakPropertySet; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.fo.properties.CommonMarginBlock; import org.apache.fop.fo.properties.KeepProperty; @@ -33,7 +34,7 @@ import org.apache.fop.fo.properties.KeepProperty; /** * Class modelling the fo:list-item object. */ -public class ListItem extends FObj { +public class ListItem extends FObj implements BreakPropertySet { // The value of properties relevant for fo:list-item. private CommonBorderPaddingBackground commonBorderPaddingBackground; private CommonMarginBlock commonMarginBlock; diff --git a/src/java/org/apache/fop/fo/flow/table/Table.java b/src/java/org/apache/fop/fo/flow/table/Table.java index 7d6611435..31a24dd80 100644 --- a/src/java/org/apache/fop/fo/flow/table/Table.java +++ b/src/java/org/apache/fop/fo/flow/table/Table.java @@ -22,6 +22,8 @@ package org.apache.fop.fo.flow.table; import java.util.ArrayList; import java.util.List; +import org.xml.sax.Locator; + import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.ValidationPercentBaseContext; @@ -29,18 +31,18 @@ import org.apache.fop.fo.FONode; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.StaticPropertyList; import org.apache.fop.fo.ValidationException; +import org.apache.fop.fo.properties.BreakPropertySet; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.fo.properties.CommonMarginBlock; import org.apache.fop.fo.properties.KeepProperty; import org.apache.fop.fo.properties.LengthPairProperty; import org.apache.fop.fo.properties.LengthRangeProperty; import org.apache.fop.fo.properties.TableColLength; -import org.xml.sax.Locator; /** * Class modelling the fo:table object. */ -public class Table extends TableFObj implements ColumnNumberManagerHolder { +public class Table extends TableFObj implements ColumnNumberManagerHolder, BreakPropertySet { /** properties */ private CommonBorderPaddingBackground commonBorderPaddingBackground; diff --git a/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java b/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java index f16931cfc..e694d3ddd 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java +++ b/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java @@ -31,7 +31,7 @@ import org.apache.fop.fo.ValidationException; * Class modelling the fo:table-and-caption property. * @todo needs implementation */ -public class TableAndCaption extends FObj { +public class TableAndCaption extends FObj /*implements BreakPropertySet*/ { // The value of properties relevant for fo:table-and-caption. // Unused but valid items, commented out for performance: // private CommonAccessibility commonAccessibility; diff --git a/src/java/org/apache/fop/fo/flow/table/TableRow.java b/src/java/org/apache/fop/fo/flow/table/TableRow.java index a025f92fd..cec774934 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableRow.java +++ b/src/java/org/apache/fop/fo/flow/table/TableRow.java @@ -19,21 +19,23 @@ package org.apache.fop.fo.flow.table; +import org.xml.sax.Attributes; +import org.xml.sax.Locator; + import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; +import org.apache.fop.fo.properties.BreakPropertySet; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.fo.properties.KeepProperty; import org.apache.fop.fo.properties.LengthRangeProperty; -import org.xml.sax.Attributes; -import org.xml.sax.Locator; /** * Class modelling the fo:table-row object. */ -public class TableRow extends TableCellContainer { +public class TableRow extends TableCellContainer implements BreakPropertySet { // The value of properties relevant for fo:table-row. private LengthRangeProperty blockProgressionDimension; private CommonBorderPaddingBackground commonBorderPaddingBackground; diff --git a/src/java/org/apache/fop/fo/properties/BreakPropertySet.java b/src/java/org/apache/fop/fo/properties/BreakPropertySet.java new file mode 100644 index 000000000..2babe0f19 --- /dev/null +++ b/src/java/org/apache/fop/fo/properties/BreakPropertySet.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.fo.properties; + +/** + * Defines property access methods for the break-before and break-after properties. + */ +public interface BreakPropertySet { + + /** @return the "break-after" property. */ + int getBreakAfter(); + + /** @return the "break-before" property. */ + int getBreakBefore(); + +} diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 5e5613898..533da5cfa 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -21,6 +21,7 @@ package org.apache.fop.layoutmgr; import java.awt.Point; import java.awt.geom.Rectangle2D; +import java.lang.ref.WeakReference; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; @@ -253,12 +254,12 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager LinkedList returnList = new LinkedList(); if (!breakBeforeServed) { - try { + breakBeforeServed = true; + if (!context.suppressBreakBefore()) { if (addKnuthElementsForBreakBefore(returnList, context)) { + this.childLMForBreakSkip = new WeakReference(getChildLM()); return returnList; } - } finally { - breakBeforeServed = true; } } @@ -282,6 +283,10 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager childLC.setStackLimitBP(MinOptMax.subtract(context.getStackLimitBP(), stackLimit)); childLC.setRefIPD(relDims.ipd); childLC.setWritingMode(getBlockContainerFO().getWritingMode()); + if (this.childLMForBreakSkip != null && curLM == this.childLMForBreakSkip.get()) { + childLC.setFlags(LayoutContext.SUPPRESS_BREAK_BEFORE); + //Handled already by the parent (break collapsing, see above) + } // get elements from curLM returnedList = curLM.getNextKnuthElements(childLC, alignment); diff --git a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java index 67ed1de9f..27a19621e 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java @@ -19,6 +19,8 @@ package org.apache.fop.layoutmgr; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -31,11 +33,13 @@ import org.apache.fop.area.Area; import org.apache.fop.area.Block; import org.apache.fop.area.BlockParent; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.properties.BreakPropertySet; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.fo.properties.SpaceProperty; import org.apache.fop.layoutmgr.inline.InlineLayoutManager; import org.apache.fop.layoutmgr.inline.LineLayoutManager; import org.apache.fop.traits.MinOptMax; +import org.apache.fop.util.BreakUtil; /** * Base LayoutManager class for all areas which stack their child @@ -66,6 +70,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager protected LinkedList storedList = null; /** Indicates whether break before has been served or not */ protected boolean breakBeforeServed = false; + /** + * Holds a weak reference on the first layout manager for optionally skipping + * a break-before that has already been handled by the parent. + */ + protected Reference childLMForBreakSkip; /** Indicates whether the first visible mark has been returned by this LM, yet */ protected boolean firstVisibleMarkServed = false; /** Reference IPD available */ @@ -246,12 +255,12 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager LinkedList returnList = new LinkedList(); if (!breakBeforeServed) { - try { + breakBeforeServed = true; + if (!context.suppressBreakBefore()) { if (addKnuthElementsForBreakBefore(returnList, context)) { + this.childLMForBreakSkip = new WeakReference(getChildLM()); return returnList; } - } finally { - breakBeforeServed = true; } } @@ -284,6 +293,10 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager childLC.setStackLimitBP(context.getStackLimitBP()); childLC.setRefIPD(referenceIPD); } + if (this.childLMForBreakSkip != null && curLM == this.childLMForBreakSkip.get()) { + childLC.setFlags(LayoutContext.SUPPRESS_BREAK_BEFORE); + //Handled already by the parent (break collapsing, see above) + } // get elements from curLM returnedList = curLM.getNextKnuthElements(childLC, alignment); @@ -946,18 +959,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager */ protected boolean addKnuthElementsForBreakBefore(LinkedList returnList, LayoutContext context) { - int breakBefore = -1; - if (fobj instanceof org.apache.fop.fo.flow.Block) { - breakBefore = ((org.apache.fop.fo.flow.Block) fobj).getBreakBefore(); - } else if (fobj instanceof org.apache.fop.fo.flow.BlockContainer) { - breakBefore = ((org.apache.fop.fo.flow.BlockContainer) fobj).getBreakBefore(); - } else if (fobj instanceof org.apache.fop.fo.flow.ListBlock) { - breakBefore = ((org.apache.fop.fo.flow.ListBlock) fobj).getBreakBefore(); - } else if (fobj instanceof org.apache.fop.fo.flow.ListItem) { - breakBefore = ((org.apache.fop.fo.flow.ListItem) fobj).getBreakBefore(); - } else if (fobj instanceof org.apache.fop.fo.flow.table.Table) { - breakBefore = ((org.apache.fop.fo.flow.table.Table) fobj).getBreakBefore(); - } + int breakBefore = getBreakBefore(true); if (breakBefore == EN_PAGE || breakBefore == EN_COLUMN || breakBefore == EN_EVEN_PAGE @@ -971,6 +973,37 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager } } + /** + * Returns the break-before value of the current formatting object. + * @param mergedWithChildren true if any break-before on first children should be checked, too + * @return the break-before value (Constants.EN_*) + */ + protected int getBreakBefore(boolean mergedWithChildren) { + int breakBefore = getBreakBefore(); + if (mergedWithChildren /* uncomment to only partially merge: && breakBefore != EN_AUTO*/) { + LayoutManager lm = getChildLM(); + //It is assumed this is only called when the first LM is active. + if (lm instanceof BlockStackingLayoutManager) { + BlockStackingLayoutManager bslm = (BlockStackingLayoutManager)lm; + breakBefore = BreakUtil.compareBreakClasses( + breakBefore, bslm.getBreakBefore(true)); + } + } + return breakBefore; + } + + /** + * Returns the break-before value of the current formatting object. + * @return the break-before value (Constants.EN_*) + */ + protected int getBreakBefore() { + int breakBefore = EN_AUTO; + if (fobj instanceof BreakPropertySet) { + breakBefore = ((BreakPropertySet)fobj).getBreakBefore(); + } + return breakBefore; + } + /** * Creates Knuth elements for break-after and adds them to the return list. * @param returnList return list to add the additional elements to @@ -980,16 +1013,8 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager protected boolean addKnuthElementsForBreakAfter(LinkedList returnList, LayoutContext context) { int breakAfter = -1; - if (fobj instanceof org.apache.fop.fo.flow.Block) { - breakAfter = ((org.apache.fop.fo.flow.Block) fobj).getBreakAfter(); - } else if (fobj instanceof org.apache.fop.fo.flow.BlockContainer) { - breakAfter = ((org.apache.fop.fo.flow.BlockContainer) fobj).getBreakAfter(); - } else if (fobj instanceof org.apache.fop.fo.flow.ListBlock) { - breakAfter = ((org.apache.fop.fo.flow.ListBlock) fobj).getBreakAfter(); - } else if (fobj instanceof org.apache.fop.fo.flow.ListItem) { - breakAfter = ((org.apache.fop.fo.flow.ListItem) fobj).getBreakAfter(); - } else if (fobj instanceof org.apache.fop.fo.flow.table.Table) { - breakAfter = ((org.apache.fop.fo.flow.table.Table) fobj).getBreakAfter(); + if (fobj instanceof BreakPropertySet) { + breakAfter = ((BreakPropertySet)fobj).getBreakAfter(); } if (breakAfter == EN_PAGE || breakAfter == EN_COLUMN diff --git a/src/java/org/apache/fop/layoutmgr/LayoutContext.java b/src/java/org/apache/fop/layoutmgr/LayoutContext.java index 79b5e232f..b0378f74e 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutContext.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutContext.java @@ -47,12 +47,10 @@ public class LayoutContext { public static final int CHECK_REF_AREA = 0x08; /** - * If this flag is set, it indicates that any leading fo:character - * objects with suppress-at-line-break="suppress" should not generate - * areas. This is the case at the beginning of each new LineArea - * except the first. + * If this flag is set, it indicates that any break-before values other than "auto" should + * not cause a mandatory break as this break was already handled by a parent layout manager. */ - public static final int SUPPRESS_LEADING_SPACE = 0x10; + public static final int SUPPRESS_BREAK_BEFORE = 0x10; public static final int FIRST_AREA = 0x20; public static final int TRY_HYPHENATE = 0x40; public static final int LAST_AREA = 0x80; @@ -224,8 +222,8 @@ public class LayoutContext { return ((this.flags & LAST_AREA) != 0); } - public boolean suppressLeadingSpace() { - return ((this.flags & SUPPRESS_LEADING_SPACE) != 0); + public boolean suppressBreakBefore() { + return ((this.flags & SUPPRESS_BREAK_BEFORE) != 0); } public boolean isKeepWithNextPending() { @@ -590,7 +588,7 @@ public class LayoutContext { + "\nSpace Adjust: \t" + getSpaceAdjust() + "\nIPD Adjust: \t" + getIPDAdjust() + "\nResolve Leading Space: \t" + resolveLeadingSpace() - + "\nSuppress Leading Space: \t" + suppressLeadingSpace() + + "\nSuppress Break Before: \t" + suppressBreakBefore() + "\nIs First Area: \t" + isFirstArea() + "\nStarts New Area: \t" + startsNewArea() + "\nIs Last Area: \t" + isLastArea() diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index 5c6e9aeb1..1f5dfa7cd 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -195,12 +195,11 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager LinkedList returnList = new LinkedList(); if (!breakBeforeServed) { - try { + breakBeforeServed = true; + if (!context.suppressBreakBefore()) { if (addKnuthElementsForBreakBefore(returnList, context)) { return returnList; } - } finally { - breakBeforeServed = true; } } diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index 0b3967643..c79d5c067 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -26,6 +26,7 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.apache.fop.area.Area; import org.apache.fop.area.Block; import org.apache.fop.datatypes.LengthBase; @@ -265,12 +266,14 @@ public class TableLayoutManager extends BlockStackingLayoutManager } addKnuthElementsForSpaceAfter(returnList, alignment); - //addKnuthElementsForBreakBefore(returnList, context); - int breakBefore = BreakUtil.compareBreakClasses(getTable().getBreakBefore(), - childLC.getBreakBefore()); - if (breakBefore != Constants.EN_AUTO) { - returnList.addFirst(new BreakElement(getAuxiliaryPosition(), - 0, -KnuthElement.INFINITE, breakBefore, context)); + if (!context.suppressBreakBefore()) { + //addKnuthElementsForBreakBefore(returnList, context); + int breakBefore = BreakUtil.compareBreakClasses(getTable().getBreakBefore(), + childLC.getBreakBefore()); + if (breakBefore != Constants.EN_AUTO) { + returnList.addFirst(new BreakElement(getAuxiliaryPosition(), + 0, -KnuthElement.INFINITE, breakBefore, context)); + } } //addKnuthElementsForBreakAfter(returnList, context); diff --git a/src/java/org/apache/fop/util/BreakUtil.java b/src/java/org/apache/fop/util/BreakUtil.java index c0528464d..f78f22f89 100644 --- a/src/java/org/apache/fop/util/BreakUtil.java +++ b/src/java/org/apache/fop/util/BreakUtil.java @@ -36,7 +36,8 @@ public final class BreakUtil { case Constants.EN_PAGE: return 2; case Constants.EN_EVEN_PAGE: return 3; case Constants.EN_ODD_PAGE: return 3; - default: throw new IllegalArgumentException(); + default: throw new IllegalArgumentException( + "Illegal value for breakClass: " + breakClass); } } diff --git a/status.xml b/status.xml index b1236072d..7a9862cec 100644 --- a/status.xml +++ b/status.xml @@ -60,6 +60,9 @@ --> + + Regression bugfix: Multiple collapsable breaks don't cause empty pages anymore. + Fixed resolution handling inside AWT preview dialog. diff --git a/test/layoutengine/standard-testcases/block_break-before_bug44412.xml b/test/layoutengine/standard-testcases/block_break-before_bug44412.xml index 9ef4150b5..cc5bcd3c8 100644 --- a/test/layoutengine/standard-testcases/block_break-before_bug44412.xml +++ b/test/layoutengine/standard-testcases/block_break-before_bug44412.xml @@ -20,8 +20,7 @@

This test checks Bugzilla #44412 where a break-before on the first child of an otherwise - empty block is set. It is expected that the parent block creates two areas, the first with - only border-before on the first page and zero bpd. + empty block is set.

@@ -44,20 +43,12 @@ - - - - - + + + - - - - - - 3 diff --git a/test/layoutengine/standard-testcases/block_break-before_bug44412_2.xml b/test/layoutengine/standard-testcases/block_break-before_bug44412_2.xml new file mode 100644 index 000000000..3f54f809a --- /dev/null +++ b/test/layoutengine/standard-testcases/block_break-before_bug44412_2.xml @@ -0,0 +1,151 @@ + + + + + +

+ This test checks for the correct behaviour of multiple breaks at the same break possibility. +

+
+ + + + + + + + + + + page: + + + Before the break + + + This text should be on page 2. + + + + Inner block with break-after. + + + + This text should be on page 3. + + + + + page: + + + Before the break + + + This text should be on page 2. + + + + Inner block with break-after. + + + + This text should be on page 3. + + + + + page: + + + Before the break + + + + + + + This text should be on page 2. + + + + + + + + + + + Inner block in table with break-after. + + + + + + + This text should be on page 3. + + + + + page: + + + Before the break + + + + + + + + + This text should be on page 2. + + + + + + + + + Inner block in list-item with break-after. + + + + + This text should be on page 3. + + + + + + + + + + + + + + + + + + + + +
-- 2.39.5