Sfoglia il codice sorgente

Bugfix: keep-together on a table containing row-spanning cells was not honored


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1083863 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_1rc1old
Vincent Hennebert 13 anni fa
parent
commit
1337f45867

+ 1
- 3
src/java/org/apache/fop/layoutmgr/table/TableStepper.java Vedi File

@@ -239,7 +239,7 @@ public class TableStepper {
}
}

Keep keep = Keep.KEEP_AUTO;
Keep keep = getTableLM().getKeepTogether();
int stepPenalty = 0;
for (Iterator iter = activeCells.iterator(); iter.hasNext();) {
ActiveCell activeCell = (ActiveCell) iter.next();
@@ -248,8 +248,6 @@ public class TableStepper {
}
if (!rowFinished) {
keep = keep.compare(rowGroup[activeRowIndex].getKeepTogether());
//The above call doesn't take the penalty from the table into account, so...
keep = keep.compare(getTableLM().getKeepTogether());
} else if (activeRowIndex < rowGroup.length - 1) {
keep = keep.compare(rowGroup[activeRowIndex].getKeepWithNext());
keep = keep.compare(rowGroup[activeRowIndex + 1].getKeepWithPrevious());

+ 3
- 0
status.xml Vedi File

@@ -59,6 +59,9 @@
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
<action context="Layout" dev="VH" type="fix">
Bugfix: keep-together on a table containing row-spanning cells was not honored.
</action>
<action context="Layout" dev="VH" type="fix" fixes-bug="50196" due-to="Matthias Reischenbacher">
Bugzilla #50196: padding-start ignored when table-header/footer is repeated.
</action>

+ 69
- 0
test/layoutengine/standard-testcases/table_keep-together_row-span.xml Vedi File

@@ -0,0 +1,69 @@
<?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 keep-together works on tables that have a cell spanning several rows.
</p>
</info>
<fo>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
<fo:layout-master-set>
<fo:simple-page-master master-name="page"
page-height="320pt" page-width="420pt" margin="10pt">
<fo:region-body background-color="#F0F0F0"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="page">
<fo:flow flow-name="xsl-region-body" font-size="8pt" line-height="10pt">
<fo:block>Block</fo:block>
<fo:block space-before="245pt">Before the table</fo:block>
<fo:table table-layout="fixed" width="100%" id="table" keep-together.within-page="always">
<fo:table-body>
<fo:table-row>
<fo:table-cell id="Cell 1.1" border="1pt solid black" number-rows-spanned="2">
<fo:block>Cell 1.1</fo:block>
</fo:table-cell>
<fo:table-cell id="Cell 1.2" border="1pt solid black">
<fo:block>Cell 1.2</fo:block>
<fo:block>Cell 1.2</fo:block>
<fo:block>Cell 1.2</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell id="Cell 2.2" border="1pt solid black">
<fo:block>Cell 2.2</fo:block>
<fo:block>Cell 2.2</fo:block>
<fo:block>Cell 2.2</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>
</fo>
<checks>
<eval expected="0" xpath="count(//pageViewport[1]//block[@prod-id='table'])"/>
<eval expected="62000" xpath="//pageViewport[2]//block[@prod-id='table']/@bpd"/>
<eval expected="61000" xpath="//pageViewport[2]//block[@prod-id='Cell 1.1']/@bpd"/>
<eval expected="30000" xpath="//pageViewport[2]//block[@prod-id='Cell 1.2']/@bpd"/>
<eval expected="30000" xpath="//pageViewport[2]//block[@prod-id='Cell 2.2']/@bpd"/>
</checks>
</testcase>

Loading…
Annulla
Salva