From 2466f253400d1ec0f7c4bc6f68a8dab87a3ab87e Mon Sep 17 00:00:00 2001
From: Jeremias Maerki
Date: Mon, 11 Sep 2006 18:24:35 +0000
Subject: [PATCH] Implemented limited support for extension properties through
new methods on ElementMapping (backwards-compatible). Moved
block-progression-unit into the fox: namespace. Implemented new extension
properties: fox:orphan-content-limit and fox:widow-content-limit for fo:table
and fo:list-block. See documentation for details. Bugfix in
ElementListUtils.removeLegalBreaks (concerning box/glue combinations). Added
a unit test to cover the problem.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@442282 13f79535-47bb-0310-9956-ffa450edef68
---
.../content/xdocs/trunk/extensions.xml | 22 ++-
src/java/org/apache/fop/fo/Constants.java | 8 +-
.../org/apache/fop/fo/ElementMapping.java | 16 ++
.../apache/fop/fo/ElementMappingRegistry.java | 10 ++
.../org/apache/fop/fo/FOElementMapping.java | 12 ++
.../org/apache/fop/fo/FOPropertyMapping.java | 22 ++-
src/java/org/apache/fop/fo/FObj.java | 19 +--
src/java/org/apache/fop/fo/PropertyList.java | 15 +-
.../extensions/ExtensionElementMapping.java | 25 +++
.../fo/extensions/svg/SVGElementMapping.java | 5 +
.../org/apache/fop/fo/flow/ListBlock.java | 26 +++-
src/java/org/apache/fop/fo/flow/Table.java | 26 +++-
.../fop/layoutmgr/ElementListUtils.java | 94 +++++++++--
.../list/ListBlockLayoutManager.java | 26 ++--
.../table/TableContentLayoutManager.java | 14 +-
status.xml | 4 +
.../fop/util/ElementListUtilsTestCase.java | 147 ++++++++++++++++++
.../list-block_fox_orphan-content-limit_1.xml | 123 +++++++++++++++
.../list-block_fox_widow-content-limit_1.xml | 123 +++++++++++++++
.../table_fox_orphan-content-limit_1.xml | 133 ++++++++++++++++
.../table_fox_widow-content-limit_1.xml | 133 ++++++++++++++++
.../table_fox_widow-content-limit_2.xml | 97 ++++++++++++
22 files changed, 1035 insertions(+), 65 deletions(-)
create mode 100644 test/java/org/apache/fop/util/ElementListUtilsTestCase.java
create mode 100644 test/layoutengine/standard-testcases/list-block_fox_orphan-content-limit_1.xml
create mode 100644 test/layoutengine/standard-testcases/list-block_fox_widow-content-limit_1.xml
create mode 100644 test/layoutengine/standard-testcases/table_fox_orphan-content-limit_1.xml
create mode 100644 test/layoutengine/standard-testcases/table_fox_widow-content-limit_1.xml
create mode 100644 test/layoutengine/standard-testcases/table_fox_widow-content-limit_2.xml
diff --git a/src/documentation/content/xdocs/trunk/extensions.xml b/src/documentation/content/xdocs/trunk/extensions.xml
index e2d19eca8..0c22ca123 100644
--- a/src/documentation/content/xdocs/trunk/extensions.xml
+++ b/src/documentation/content/xdocs/trunk/extensions.xml
@@ -51,8 +51,11 @@
http://xml.apache.org/fop/extensions
to the root element:
+ fox:orphan-content-limit and fox:widow-content-limit
+
+ The two proprietary extension properties, fox:orphan-content-limit and
+ fox:widow-content-limit, are used to improve the layout of list-blocks and tables.
+ If you have a table with many entries, you don't want a single row to be left over
+ on a page. You will want to make sure that at least two or three lines are kept
+ together. The properties take an absolute length which specifies the area at the
+ beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a
+ table or list-block. The properties are inherited and only have an effect on fo:table
+ and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure
+ the you'll have at least three lines (assuming line-height="1.2") together on a table
+ or list-block.
+
+