tore        01/07/17 13:27:14

  Modified:    src/org/apache/fop/layout LineArea.java
  Log:
  PR: 2556
  This fixes bug 2556 by changing the leader with pattern "space" to use an
  InlineSpace instead of adding actually spaces.
  
  Revision  Changes    Path
  1.45      +11 -17    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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- LineArea.java     2001/06/12 11:37:42     1.44
  +++ LineArea.java     2001/07/17 20:27:13     1.45
  @@ -1,4 +1,4 @@
  -/* $Id: LineArea.java,v 1.44 2001/06/12 11:37:42 keiron Exp $
  +/* $Id: LineArea.java,v 1.45 2001/07/17 20:27:13 tore 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.
  @@ -474,13 +474,9 @@
   
           switch (leaderPattern) {
               case LeaderPattern.SPACE:
  -                //whitespace setting must be false for this
  -                int whiteSpaceSetting = this.whiteSpaceCollapse;
  -                this.changeWhiteSpaceCollapse(WhiteSpaceCollapse.FALSE);
  -                pendingAreas.addElement(
  -                  this.buildSimpleLeader(whitespaceIndex,
  -                                         leaderLength));
  -                this.changeWhiteSpaceCollapse(whiteSpaceSetting);
  +                InlineSpace spaceArea =
  +                  new InlineSpace(leaderLength);
  +                pendingAreas.addElement(spaceArea);
                   break;
               case LeaderPattern.RULE:
                   LeaderArea leaderArea =
  @@ -751,19 +747,17 @@
          * creates a leader as String out of the given char and the leader length
          * and wraps it in an InlineArea which is returned
          */
  -    private InlineArea buildSimpleLeader(int charNumber, int leaderLength) {
  -             int width = this.currentFontState.width(charNumber);
  -             if (width == 0) {
  -                     char c = (char) charNumber;
  -                     MessageHandler.errorln("char " + c + " has width 0. Using 
width 100 instead.");
  -                     width = 100;
  -             }
  +    private InlineArea buildSimpleLeader(char c, int leaderLength) {
  +        int width = this.currentFontState.width(currentFontState.mapChar(c));
  +        if (width == 0)      {
  +            MessageHandler.errorln("char " + c + " has width 0. Using width 100 
instead.");
  +            width = 100;
  +        }
           int factor = (int) Math.floor (leaderLength /
                                          width);
           char [] leaderChars = new char [factor];
  -        char fillChar = (char) charNumber;
           for (int i = 0; i < factor; i ++) {
  -            leaderChars[i] = fillChar;
  +            leaderChars[i] = c;//currentFontState.mapChar(c);
           }
           WordArea leaderPatternArea =
             new WordArea(currentFontState, this.red, this.green,
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to