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 bc...@apache.org on 2004/10/01 10:48:29 UTC

cvs commit: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfText.java

bckfnn      2004/10/01 01:48:29

  Modified:    src/java/org/apache/fop/render/rtf/rtflib/rtfdoc
                        RtfText.java
  Log:
  Style: fix indent.
  
  Revision  Changes    Path
  1.4       +42 -43    xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
  
  Index: RtfText.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RtfText.java	27 Feb 2004 17:54:01 -0000	1.3
  +++ RtfText.java	1 Oct 2004 08:48:29 -0000	1.4
  @@ -34,18 +34,18 @@
    */
   
   public class RtfText extends RtfElement {
  -        // char code for non-breakable space
  -        private static final int CHAR_NBSP = 160;
  -        private static final int CHAR_TAB = 137;
  -        private static final int CHAR_NEW_LINE = 141;
  -        /* these next two variables are used to encode bold formating in the
  -         * raw xml text. Usefull when specific words or phrases are to be bolded
  -         * but their placement and length change.  Thus the bold formatting becomes
  -         * part of the data.  The same method can be used for implementing other types
  -         * of raw text formatting.
  -         */
  -        private static final int CHAR_BOLD_START = 130;
  -        private static final int CHAR_BOLD_END = 131;
  +    // char code for non-breakable space
  +    private static final int CHAR_NBSP = 160;
  +    private static final int CHAR_TAB = 137;
  +    private static final int CHAR_NEW_LINE = 141;
  +    /* these next two variables are used to encode bold formating in the
  +     * raw xml text. Usefull when specific words or phrases are to be bolded
  +     * but their placement and length change.  Thus the bold formatting becomes
  +     * part of the data.  The same method can be used for implementing other types
  +     * of raw text formatting.
  +     */
  +    private static final int CHAR_BOLD_START = 130;
  +    private static final int CHAR_BOLD_END = 131;
   
       /** members */
       private String text;
  @@ -189,40 +189,39 @@
        * @throws IOException for I/O problems
        */
       public void writeRtfContent() throws IOException {
  -            writeChars: {
  -
  -                //these lines were added by Boris Pouderous
  -                  if (attr != null) {
  -                  writeAttributes(attr, new String[] {RtfText.SPACE_BEFORE});
  -                  writeAttributes(attr, new String[] {RtfText.SPACE_AFTER});
  -                }
  +        writeChars: {
   
  -                if (isTab()) {
  -                    writeControlWord("tab");
  -                } else if (isNewLine()) {
  -                    break writeChars;
  -                } else if (isBold(true)) {
  -                    writeControlWord("b");
  -                } else if (isBold(false)) {
  -                    writeControlWord("b0");
  -                // TODO not optimal, consecutive RtfText with same attributes
  -                // could be written without group marks
  -                } else {
  -                    writeGroupMark(true);
  -                    if (attr != null && mustWriteAttributes()) {
  -                        writeAttributes(attr, RtfText.ATTR_NAMES);
  -                    }
  -                    RtfStringConverter.getInstance().writeRtfString(writer, text);
  -                    writeGroupMark(false);
  +            //these lines were added by Boris Pouderous
  +            if (attr != null) {
  +                writeAttributes(attr, new String[] {RtfText.SPACE_BEFORE});
  +                writeAttributes(attr, new String[] {RtfText.SPACE_AFTER});
  +            }
  +
  +            if (isTab()) {
  +                writeControlWord("tab");
  +            } else if (isNewLine()) {
  +                break writeChars;
  +            } else if (isBold(true)) {
  +                writeControlWord("b");
  +            } else if (isBold(false)) {
  +                writeControlWord("b0");
  +            // TODO not optimal, consecutive RtfText with same attributes
  +            // could be written without group marks
  +            } else {
  +                writeGroupMark(true);
  +                if (attr != null && mustWriteAttributes()) {
  +                    writeAttributes(attr, RtfText.ATTR_NAMES);
                   }
  -
  -          }
  +                RtfStringConverter.getInstance().writeRtfString(writer, text);
  +                writeGroupMark(false);
  +            }
  +        }
       }
   
  -        /** true if our text attributes must be written */
  -        private boolean mustWriteAttributes() {
  -            return !isEmpty() && !isNbsp();
  -        }
  +    /** true if our text attributes must be written */
  +    private boolean mustWriteAttributes() {
  +        return !isEmpty() && !isNbsp();
  +    }
   
       /** IRtfTextContainer requirement:
        * @return a copy of our attributes */
  
  
  

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