You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ke...@apache.org on 2002/01/11 11:20:51 UTC

cvs commit: xml-fop/src/org/apache/fop/layout LineArea.java

keiron      02/01/11 02:20:51

  Modified:    src/org/apache/fop/layout Tag: fop-0_20_2-maintain
                        LineArea.java
  Log:
  fixes infinite loop with hyphenation
  Submitted by:	Enrico Schnepel <en...@gmx.de>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.53.2.3  +5 -4      xml-fop/src/org/apache/fop/layout/LineArea.java
  
  Index: LineArea.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/LineArea.java,v
  retrieving revision 1.53.2.2
  retrieving revision 1.53.2.3
  diff -u -r1.53.2.2 -r1.53.2.3
  --- LineArea.java	9 Dec 2001 17:17:09 -0000	1.53.2.2
  +++ LineArea.java	11 Jan 2002 10:20:50 -0000	1.53.2.3
  @@ -1,5 +1,5 @@
   /*
  - * $Id: LineArea.java,v 1.53.2.2 2001/12/09 17:17:09 tore Exp $
  + * $Id: LineArea.java,v 1.53.2.3 2002/01/11 10:20:50 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -947,14 +947,15 @@
           // we will only handle hard hyphens and slashes
           if (getWordWidth(wordToHyphenate) < remainingWidth) {
               inwordPunctuation =
  -                characters[wordStart + wordToHyphenate.length()];
  +                characters[wordStart + remainingString.length()
  +                    + wordToHyphenate.length()];
               if (inwordPunctuation == '-' || inwordPunctuation == '/') {
                   preString = new StringBuffer(wordToHyphenate);
                   preString = preString.append(inwordPunctuation);
                   wordToHyphenate =
                       getHyphenationWord(characters,
  -                                       wordStart + wordToHyphenate.length()
  -                                       + 1);
  +                                       wordStart + remainingString.length()
  +                                       + wordToHyphenate.length() + 1);
                   remainingWidth -=
                       (getWordWidth(wordToHyphenate)
                        + this.currentFontState.width(currentFontState.mapChar(inwordPunctuation)));
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org