From a9d4702a4ad319668a7ffe01016b9e4de03aeed1 Mon Sep 17 00:00:00 2001 From: Steve Coffman Date: Wed, 8 Nov 2000 23:47:44 +0000 Subject: [PATCH] This applies Dorothea Wiarda's patch to prevent "character dropping" when a new LineArea is created in BlockArea.AddText. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193753 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/layout/BlockArea.java | 6 ++++-- src/org/apache/fop/layout/LineArea.java | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/org/apache/fop/layout/BlockArea.java b/src/org/apache/fop/layout/BlockArea.java index 3c6e40495..782580eb3 100644 --- a/src/org/apache/fop/layout/BlockArea.java +++ b/src/org/apache/fop/layout/BlockArea.java @@ -167,9 +167,11 @@ public class BlockArea extends Area { while (ts != -1) { this.currentLineArea.align(this.align); this.addLineArea(this.currentLineArea); + this.currentLineArea = new LineArea(fontState, lineHeight, halfLeading, - allocationWidth, startIndent, endIndent); + allocationWidth, startIndent, endIndent, + currentLineArea); if (currentHeight + currentLineArea.getHeight() > this.maxHeight) { return ts; @@ -199,7 +201,7 @@ public class BlockArea extends Area { currentLineArea = new LineArea(fontState, lineHeight, halfLeading, allocationWidth, startIndent + textIndent, - endIndent); + endIndent,null); } public int getEndIndent() { diff --git a/src/org/apache/fop/layout/LineArea.java b/src/org/apache/fop/layout/LineArea.java index 6ce891051..e27651b33 100644 --- a/src/org/apache/fop/layout/LineArea.java +++ b/src/org/apache/fop/layout/LineArea.java @@ -125,7 +125,7 @@ public class LineArea extends Area { public LineArea(FontState fontState, int lineHeight, int halfLeading, int allocationWidth, int startIndent, - int endIndent) { + int endIndent,LineArea prevLineArea) { super(fontState); this.currentFontState = fontState; @@ -145,6 +145,13 @@ public class LineArea extends Area { this.startIndent = startIndent; this.endIndent = endIndent; + if(prevLineArea != null){ + Enumeration e=prevLineArea.pendingAreas.elements(); + while( e.hasMoreElements() ){ + pendingAreas.addElement(e.nextElement()); + } + pendingWidth=prevLineArea.getPendingWidth(); + } } public void render(Renderer renderer) { -- 2.39.5