From: Jeremias Maerki Date: Wed, 2 Feb 2005 14:19:06 +0000 (+0000) Subject: Bugfix for omitted empty lines caused by forced linefeeds. X-Git-Tag: Root_Temp_KnuthStylePageBreaking~143 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=919269d14710aa48379b0e28b0a3122b7a44ce64;p=xmlgraphics-fop.git Bugfix for omitted empty lines caused by forced linefeeds. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198364 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java index c469ecadf..aa1fe8515 100644 --- a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,6 +111,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager { lineHeight = lh; baseline = bl; } + } @@ -469,6 +470,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager { // add the new elements to the paragraph knuthPar.addAll(returnedList); if (bForceLinefeed) { + if (knuthPar.size() == 0) { + //only a forced linefeed on this line + //-> compensate with a zero width box + knuthPar.add(new KnuthBox(0, 0, 0, 0, + null, false)); + } knuthPar.endParagraph(); knuthPar = new Paragraph(); knuthPar.startParagraph(availIPD.opt);