From c333acfb9bc42ee91f7b7cd11ff88fa7dca64272 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 8 Dec 2005 08:51:14 +0000 Subject: [PATCH] Bugzilla #37828: Bugfix for column balancing with large amounts of text. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@355042 13f79535-47bb-0310-9956-ffa450edef68 --- .../layoutmgr/PageSequenceLayoutManager.java | 4 +- status.xml | 10 +++ .../region-body_column-count_bug37828.xml | 69 +++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 test/layoutengine/standard-testcases/region-body_column-count_bug37828.xml diff --git a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java index 9bc09c2f5..59d331028 100644 --- a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java @@ -349,6 +349,8 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager { AbstractBreaker.log.debug("restart: iOptPageCount= " + iOptPageCount + " pageBreaks.size()= " + algRestart.getPageBreaks().size()); if (iOptPageCount > getCurrentPV().getBodyRegion().getColumnCount()) { + AbstractBreaker.log.warn( + "Breaking algorithm produced more columns than are available."); /* reenable when everything works throw new IllegalStateException( "Breaking algorithm must not produce more columns than available."); @@ -787,7 +789,7 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager { PageViewport pv = getPageViewport( false, pageIndex, RELTO_CURRENT_ELEMENT_LIST); while (idx < partCount) { - if ((idx < partCount - 1) && (colIndex >= pv.getCurrentSpan().getColumnCount())) { + if ((colIndex >= pv.getCurrentSpan().getColumnCount())) { colIndex = 0; pageIndex++; pv = getPageViewport( diff --git a/status.xml b/status.xml index c05434c7c..8f1584344 100644 --- a/status.xml +++ b/status.xml @@ -27,6 +27,16 @@ + + Bugfix: Column balancing produced strange break decisions in certain multi-column + documents with large amounts of text. + + + Added an alternative set of rules for calculating text indents which tries to mimic + the behaviour of many commercial FO implementations that chose to break the rules + in the FO specification in order to better meet the natural expectations of + inexperienced FO users. + Bugfix: The combination of content-width="scale-to-fit" and content-height="100%" did not work as expected due to a datatype conversion bug. diff --git a/test/layoutengine/standard-testcases/region-body_column-count_bug37828.xml b/test/layoutengine/standard-testcases/region-body_column-count_bug37828.xml new file mode 100644 index 000000000..add696573 --- /dev/null +++ b/test/layoutengine/standard-testcases/region-body_column-count_bug37828.xml @@ -0,0 +1,69 @@ + + + + + +

+ This test checks multi-column documents. Checks a problem described in Bugzilla #37828. + A problem with column balancing and large amounts of text. +

+
+ + + + + + + + + + + This line is spanned over all columns. + + + line1 + line2 + line3 + line4 + line5 + line6 + line7 + line8 + line9 + line10 + + + This line is spanned over all columns. + + + + + + + + + + + + + + + + + + +
-- 2.39.5