import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.KeepProperty;
+import org.apache.fop.layoutmgr.BlockLayoutManager;
import org.apache.fop.layoutmgr.BreakElement;
import org.apache.fop.layoutmgr.BreakOpportunity;
import org.apache.fop.layoutmgr.BreakOpportunityHelper;
// add the original line where the float was but without the float now
returnList.add(new KnuthBlockBox(boxHeight, footnoteList, stepPosition, false));
}
-
+ if (originalBodyPosition != null) {
+ LayoutManager lm = originalBodyPosition.getLM();
+ if ((lm instanceof ListBlockLayoutManager || lm instanceof BlockLayoutManager)
+ && getKeepWithPrevious().isAuto()) {
+ stepPenalty++;
+ }
+ }
if (addedBoxHeight < totalHeight) {
Keep keep = keepWithNextActive.compare(getKeepTogether());
int p = stepPenalty;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that blocks of texts are re-laid out after a change of the flow ipd.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
+ <fo:layout-master-set>
+ <fo:simple-page-master margin-right="1in" margin-left="1in" margin-bottom="0.20in" margin-top="0.20in" page-width="8.5in" page-height="11in" master-name="PageA">
+ <fo:region-body margin-right="0in" margin-left="0in" margin-bottom="0.85in" margin-top="2.5in" region-name="Body"/>
+
+ </fo:simple-page-master>
+ <fo:simple-page-master margin-right="0.75in" margin-left="0.75in" margin-bottom="0.20in" margin-top="0.20in" page-width="8.5in" page-height="11in" master-name="PageB">
+ <fo:region-body margin-right="0in" margin-left="0in" margin-bottom="0.85in" margin-top="0.85in" region-name="Body"/>
+
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="PageSequence">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="PageA"/>
+ <fo:conditional-page-master-reference page-position="rest" master-reference="PageB"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence format="1" id="TH_LastPage" initial-page-number="auto" force-page-count="auto" master-reference="PageSequence">
+
+ <fo:flow flow-name="Body">
+ <fo:block>
+
+ <fo:list-block font-size="50pt">
+ <fo:list-item space-after="5px">
+ <fo:list-item-label>
+ <fo:block>4.</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>
+
+ <fo:list-block>
+
+ <fo:list-item space-after="5px">
+ <fo:list-item-label>
+ <fo:block>b.</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>Animals, birds or fish; </fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ <fo:list-item space-after="5px">
+ <fo:list-item-label>
+ <fo:block>c.</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>"Motor vehicles". However, this Paragraph 4.c. does not apply to: <fo:list-block>
+ <fo:list-item space-after="5px">
+ <fo:list-item-label>
+ <fo:block>(1)</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>Portable electronic equipment that:</fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+
+ </fo:list-block>
+ </fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+
+ </fo:list-block>
+ </fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </fo:list-block>
+
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="Paragraph" xpath="//pageViewport[2]//flow/block//word"/>
+ </checks>
+</testcase>