]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Avoid unnecessary penalties at the beginning of the returnList. They may also badly...
authorJeremias Maerki <jeremias@apache.org>
Mon, 21 Mar 2005 13:21:32 +0000 (13:21 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 21 Mar 2005 13:21:32 +0000 (13:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_KnuthStylePageBreaking@198524 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/LineLayoutManager.java

index 187225c3efdab042a29c3e5d167495526d566ac2..f93f02baaea1fab35ca90d98cf5e165108db25a4 100644 (file)
@@ -1053,11 +1053,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager
                 /* ALLINEAMENTO NON GIUSTIFICATO, elementi con Position effettive */
                 Position returnPosition = new LeafPosition(this, p);
                 for (int i = 0;
-                     i < lineLayouts.getChosenLineNumber();
-                     ++) {
+                        i < lineLayouts.getChosenLineNumber();
+                        i++) {
                     if (!((BlockLevelLayoutManager) parentLM).mustKeepTogether()
                         && i >= fobj.getOrphans()
-                        && i <= lineLayouts.getChosenLineNumber() - fobj.getWidows()) {
+                        && i <= lineLayouts.getChosenLineNumber() - fobj.getWidows()
+                        && returnList.size() > 0) {
                         // null penalty allowing a page break between lines
                         returnList.add(new KnuthPenalty(0, 0, false, returnPosition, false));
                     }