]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Style fixes only
authorJeremias Maerki <jeremias@apache.org>
Sat, 8 Nov 2003 19:58:03 +0000 (19:58 +0000)
committerJeremias Maerki <jeremias@apache.org>
Sat, 8 Nov 2003 19:58:03 +0000 (19:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197000 13f79535-47bb-0310-9956-ffa450edef68

15 files changed:
src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
src/java/org/apache/fop/render/rtf/RTFHandler.java
src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextrunContainer.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java
src/java/org/apache/fop/render/rtf/rtflib/testdocs/CreateTestDocuments.java

index f65b3bf0c7886b2b4ca59391100b58f39ebf6bc0..2a3734b3226d018c1b47808a15bb346aa2c29559 100644 (file)
@@ -114,8 +114,9 @@ class PageAttributesConverter {
                     (int)FoUnitsConverter.getInstance().convertToTwips(f.toString() + "pt"));
             }
         } catch (FOPException e) {
-            log.error("Exception in convertPageAttributes: " + e.getMessage() + "- page attributes ignored");
-            attrib=new RtfAttributes();
+            log.error("Exception in convertPageAttributes: " 
+                + e.getMessage() + "- page attributes ignored");
+            attrib = new RtfAttributes();
         }
 
         return attrib;
index 3ef09ab216722683e501cd9368c27c85a68308a2..f299595ce5607a837299e87f1bb3a6db6e4285ad 100644 (file)
@@ -58,7 +58,6 @@ import java.io.OutputStreamWriter;
 import org.apache.avalon.framework.logger.ConsoleLogger;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.fo.EnumProperty;
 import org.apache.fop.fo.FOInputHandler;
 import org.apache.fop.datatypes.FixedLength;
@@ -81,26 +80,19 @@ import org.apache.fop.fo.pagination.SimplePageMaster;
 import org.apache.fop.fo.properties.Constants;
 import org.apache.fop.fo.Property;
 import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.PropertyList;
 import org.apache.fop.apps.Document;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfAfterContainer;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfBeforeContainer;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfExternalGraphicContainer;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfPageNumberContainer;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfParagraphContainer;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfTextrunContainer;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAfter;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfBefore;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfColorTable;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFile;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFontManager;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTable;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
@@ -125,7 +117,7 @@ public class RTFHandler extends FOInputHandler {
     private final Logger log = new ConsoleLogger();
     private RtfSection sect;
     private RtfDocumentArea docArea;
-    private RtfParagraph para;
+    //private RtfParagraph para; //never used
     private boolean warned = false;
     private boolean bPrevHeaderSpecified = false;//true, if there has been a
                                                  //header in any page-sequence
@@ -188,17 +180,17 @@ public class RTFHandler extends FOInputHandler {
 
             //read page size and margins, if specified
             Property prop;
-            if((prop=pageSeq.properties.get("master-reference"))!=null) {
-                String reference=prop.getString();
+            if ((prop = pageSeq.properties.get("master-reference")) != null) {
+                String reference = prop.getString();
 
-                SimplePageMaster pagemaster=
-                    pageSeq.getLayoutMasterSet().getSimplePageMaster(reference);
+                SimplePageMaster pagemaster 
+                    pageSeq.getLayoutMasterSet().getSimplePageMaster(reference);
 
                 //only simple-page-master supported, so pagemaster may be null
-                if(pagemaster!=null) {
+                if (pagemaster != null) {
                     sect.getRtfAttributes().set(
                         PageAttributesConverter.convertPageAttributes(
-                            pagemaster.properties,null));
+                            pagemaster.properties, null));
                 }
             }
 
@@ -232,8 +224,8 @@ public class RTFHandler extends FOInputHandler {
                     RtfAttributes attr = new RtfAttributes();
                     attr.set(RtfBefore.HEADER);
 
-                    final IRtfBeforeContainer contBefore =
-                            (IRtfBeforeContainer)builderContext.getContainer
+                    final IRtfBeforeContainer contBefore 
+                        = (IRtfBeforeContainer)builderContext.getContainer
                                 (IRtfBeforeContainer.class, true, this);
                     contBefore.newBefore(attr);
                 }
@@ -244,8 +236,8 @@ public class RTFHandler extends FOInputHandler {
                     RtfAttributes attr = new RtfAttributes();
                     attr.set(RtfAfter.FOOTER);
 
-                    final IRtfAfterContainer contAfter =
-                            (IRtfAfterContainer)builderContext.getContainer
+                    final IRtfAfterContainer contAfter
+                        = (IRtfAfterContainer)builderContext.getContainer
                                 (IRtfAfterContainer.class, true, this);
                     contAfter.newAfter(attr);
                 }
@@ -259,8 +251,9 @@ public class RTFHandler extends FOInputHandler {
                 bHeaderSpecified = true;
                 bPrevHeaderSpecified = true;
 
-                final IRtfBeforeContainer c =
-                        (IRtfBeforeContainer)builderContext.getContainer(IRtfBeforeContainer.class,
+                final IRtfBeforeContainer c 
+                    = (IRtfBeforeContainer)builderContext.getContainer(
+                        IRtfBeforeContainer.class,
                         true, this);
 
                 RtfAttributes beforeAttributes = ((RtfElement)c).getRtfAttributes();
@@ -275,8 +268,9 @@ public class RTFHandler extends FOInputHandler {
                 bFooterSpecified = true;
                 bPrevFooterSpecified = true;
 
-                final IRtfAfterContainer c =
-                        (IRtfAfterContainer)builderContext.getContainer(IRtfAfterContainer.class,
+                final IRtfAfterContainer c 
+                    = (IRtfAfterContainer)builderContext.getContainer(
+                        IRtfAfterContainer.class,
                         true, this);
 
                 RtfAttributes afterAttributes = ((RtfElement)c).getRtfAttributes();
@@ -321,14 +315,15 @@ public class RTFHandler extends FOInputHandler {
      */
     public void startBlock(Block bl) {
         try {
-            RtfAttributes rtfAttr = 
-                    TextAttributesConverter.convertAttributes(bl.properties, null);
+            RtfAttributes rtfAttr
+                = TextAttributesConverter.convertAttributes(bl.properties, null);
                     
-            IRtfTextrunContainer container =
-                    (IRtfTextrunContainer)builderContext.getContainer(IRtfTextrunContainer.class,
-                    true,this);
+            IRtfTextrunContainer container 
+                = (IRtfTextrunContainer)builderContext.getContainer(
+                    IRtfTextrunContainer.class,
+                    true, this);
 
-            RtfTextrun textrun=container.getTextrun();
+            RtfTextrun textrun = container.getTextrun();
             
             textrun.addParagraphBreak();
             textrun.pushAttributes(rtfAttr);
@@ -348,11 +343,12 @@ public class RTFHandler extends FOInputHandler {
      */
     public void endBlock(Block bl) {
         try {
-            IRtfTextrunContainer container =
-                    (IRtfTextrunContainer)builderContext.getContainer(IRtfTextrunContainer.class,
-                    true,this);
+            IRtfTextrunContainer container 
+                = (IRtfTextrunContainer)builderContext.getContainer(
+                    IRtfTextrunContainer.class,
+                    true, this);
                     
-            RtfTextrun textrun=container.getTextrun();
+            RtfTextrun textrun = container.getTextrun();
             
             textrun.addParagraphBreak();
             textrun.popAttributes();
@@ -374,12 +370,12 @@ public class RTFHandler extends FOInputHandler {
         TableContext tableContext = new TableContext(builderContext);
 
         try {
-            RtfAttributes atts 
-                    TableAttributesConverter.convertTableAttributes(tbl.properties);
+            RtfAttributes atts 
+                = TableAttributesConverter.convertTableAttributes(tbl.properties);
             
-            final IRtfTableContainer tc =
-                   (IRtfTableContainer)builderContext.getContainer(IRtfTableContainer.class,
-                   true, null);
+            final IRtfTableContainer tc 
+                = (IRtfTableContainer)builderContext.getContainer(
+                    IRtfTableContainer.class, true, null);
             builderContext.pushContainer(tc.newTable(atts, tableContext));
         } catch (Exception e) {
             log.error("startTable:" + e.getMessage());
@@ -450,17 +446,17 @@ public class RTFHandler extends FOInputHandler {
      *
      * @param inl Inline that is starting.
      */
-    public void startInline(Inline inl){
+    public void startInline(Inline inl) {
 
         try {
-            RtfAttributes rtfAttr = 
-                    TextAttributesConverter.convertCharacterAttributes(inl.properties, null);
+            RtfAttributes rtfAttr
+                = TextAttributesConverter.convertCharacterAttributes(inl.properties, null);
                     
-            IRtfTextrunContainer container =
-                    (IRtfTextrunContainer)builderContext.getContainer(IRtfTextrunContainer.class,
-                    true,this);
+            IRtfTextrunContainer container
+                = (IRtfTextrunContainer)builderContext.getContainer(
+                    IRtfTextrunContainer.class, true, this);
                     
-            RtfTextrun textrun=container.getTextrun();
+            RtfTextrun textrun = container.getTextrun();
             textrun.pushAttributes(rtfAttr);
         } catch (IOException ioe) {
             log.error("startInline:" + ioe.getMessage());
@@ -478,13 +474,13 @@ public class RTFHandler extends FOInputHandler {
      *
      * @param inl Inline that is ending.
      */
-    public void endInline(Inline inl){
+    public void endInline(Inline inl) {
         try {
-            IRtfTextrunContainer container =
-                    (IRtfTextrunContainer)builderContext.getContainer(IRtfTextrunContainer.class,
-                    true,this);
+            IRtfTextrunContainer container
+                = (IRtfTextrunContainer)builderContext.getContainer(
+                    IRtfTextrunContainer.class, true, this);
                     
-            RtfTextrun textrun=container.getTextrun();
+            RtfTextrun textrun = container.getTextrun();
             textrun.popAttributes();
         } catch (IOException ioe) {
             log.error("startInline:" + ioe.getMessage());
@@ -703,16 +699,16 @@ public class RTFHandler extends FOInputHandler {
         try {
        
         
-            final IRtfTextrunContainer c =
-                    (IRtfTextrunContainer)builderContext.getContainer(IRtfTextrunContainer.class,
-                    true, this);
+            final IRtfTextrunContainer c 
+                = (IRtfTextrunContainer)builderContext.getContainer(
+                    IRtfTextrunContainer.class, true, this);
             
             final RtfExternalGraphic newGraphic = c.getTextrun().newImage();
        
-            Property p=null; 
+            Property p = null; 
                
             //get source file
-            if((p=eg.properties.get("src"))!=null) {
+            if ((p = eg.properties.get("src")) != null) {
                 newGraphic.setURL (p.getString());
             } else {
                 log.error("The attribute 'src' of <fo:external-graphic> is required.");
@@ -720,17 +716,17 @@ public class RTFHandler extends FOInputHandler {
             }
             
             //get scaling
-            if((p=eg.properties.get("scaling"))!=null) {
-                EnumProperty e=(EnumProperty)p;
-                if(p.getEnum()==Constants.UNIFORM) {
+            if ((p = eg.properties.get("scaling")) != null) {
+                EnumProperty e = (EnumProperty)p;
+                if (p.getEnum() == Constants.UNIFORM) {
                     newGraphic.setScaling ("uniform");
                 }
             }
             
             //get width
-            if((p=eg.properties.get("width"))!=null) {
-                LengthProperty lengthProp=(LengthProperty)p;
-                if(lengthProp.getLength() instanceof FixedLength) {
+            if ((p = eg.properties.get("width")) != null) {
+                LengthProperty lengthProp = (LengthProperty)p;
+                if (lengthProp.getLength() instanceof FixedLength) {
                     Float f = new Float(lengthProp.getLength().getValue() / 1000f);
                     String sValue = f.toString() + "pt";
                     newGraphic.setWidth(sValue);
@@ -738,9 +734,9 @@ public class RTFHandler extends FOInputHandler {
             }
             
             //get height
-            if((p=eg.properties.get("height"))!=null) {
-                LengthProperty lengthProp=(LengthProperty)p;
-                if(lengthProp.getLength() instanceof FixedLength) {
+            if ((p = eg.properties.get("height")) != null) {
+                LengthProperty lengthProp = (LengthProperty)p;
+                if (lengthProp.getLength() instanceof FixedLength) {
                     Float f = new Float(lengthProp.getLength().getValue() / 1000f);
                     String sValue = f.toString() + "pt";
                     newGraphic.setHeight(sValue);
@@ -751,11 +747,12 @@ public class RTFHandler extends FOInputHandler {
             //      int compression = m_context.m_options.getRtfExternalGraphicCompressionRate ();
             int compression = 0;
             if (compression != 0) {
-                if (! newGraphic.setCompressionRate (compression)) {
-                    log.warn("The compression rate " + compression + " is invalid. The value has to be between 1 and 100 %.");
+                if (!newGraphic.setCompressionRate(compression)) {
+                    log.warn("The compression rate " + compression 
+                        + " is invalid. The value has to be between 1 and 100 %.");
                 }
             }
-        } catch(Exception e) {
+        } catch (Exception e) {
             log.error("image: " + e.getMessage());
         }
     }
@@ -787,13 +784,13 @@ public class RTFHandler extends FOInputHandler {
     /**
      * @see org.apache.fop.fo.FOInputHandler#characters(char[], int, int)
      */
-    public void characters(char data[], int start, int length) {
+    public void characters(char[] data, int start, int length) {
         try {
-            IRtfTextrunContainer container =
-                    (IRtfTextrunContainer)builderContext.getContainer(IRtfTextrunContainer.class,
-                    true,this);
+            IRtfTextrunContainer container
+                = (IRtfTextrunContainer)builderContext.getContainer(
+                    IRtfTextrunContainer.class, true, this);
                     
-            RtfTextrun textrun=container.getTextrun();
+            RtfTextrun textrun = container.getTextrun();
             textrun.addString(new String(data, start, length));
          } catch (IOException ioe) {
             // FIXME could we throw Exception in all FOInputHandler events?
@@ -811,14 +808,15 @@ public class RTFHandler extends FOInputHandler {
      */
     public void startPageNumber(PageNumber pagenum) {
         try {
-            RtfAttributes rtfAttr = 
-                    TextAttributesConverter.convertCharacterAttributes(pagenum.properties, null);
+            RtfAttributes rtfAttr
+                = TextAttributesConverter.convertCharacterAttributes(
+                    pagenum.properties, null);
                     
-            IRtfTextrunContainer container =
-                    (IRtfTextrunContainer)builderContext.getContainer(IRtfTextrunContainer.class,
-                    true,this);
+            IRtfTextrunContainer container
+                = (IRtfTextrunContainer)builderContext.getContainer(
+                    IRtfTextrunContainer.class, true, this);
                     
-            RtfTextrun textrun=container.getTextrun();
+            RtfTextrun textrun = container.getTextrun();
             textrun.addPageNumber(rtfAttr);
         } catch (IOException ioe) {
             log.error("startPageNumber:" + ioe.getMessage());
index 650851e4bbecd91642b87656db53f08c1b795aa4..037a45ec5fd428935d95a0382b358e6b6eed01d0 100644 (file)
@@ -115,12 +115,12 @@ public class TableAttributesConverter {
      * @throws ConverterException On convertion error
      */
     static RtfAttributes convertTableAttributes(PropertyList properties)
-    throws FOPException {
+            throws FOPException {
         RtfAttributes attrib = new RtfAttributes();
 
-        LengthProperty lengthProp=null;
+        LengthProperty lengthProp = null;
         // margin-left
-        lengthProp=(LengthProperty)properties.get("margin-left");
+        lengthProp = (LengthProperty)properties.get("margin-left");
         if (lengthProp != null) {
             Float f = new Float(lengthProp.getLength().getValue() / 1000f);
             final String sValue = f.toString() + "pt";
index d8b8e0faba6e47288884bcb2a037e92691deb036..4d71125ccc3201226de4b6efc763e2f0e77ed4e3 100644 (file)
 
 package org.apache.fop.render.rtf;
 
-//XML
-import org.xml.sax.Attributes;
-
 //FOP
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.logger.ConsoleLogger;
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.EnumProperty;
-import org.apache.fop.fo.expr.NCnameProperty;
 import org.apache.fop.fo.properties.Constants;
 import org.apache.fop.fo.LengthProperty;
-import org.apache.fop.fo.ListProperty;
 import org.apache.fop.fo.PropertyList;
-import org.apache.fop.fo.Property;
 import org.apache.fop.fo.SpaceProperty;
 import org.apache.fop.fo.ColorTypeProperty;
-import org.apache.fop.fo.NumberProperty;
 import org.apache.fop.datatypes.ColorType;
 
 //RTF
@@ -123,8 +116,8 @@ class TextAttributesConverter {
      * @param props list of FO properites, which are to be converted
      * @param props list of default FO properites (usally null)
      */
-    public static RtfAttributes convertCharacterAttributes(PropertyList props, PropertyList defProps)
-    throws FOPException {
+    public static RtfAttributes convertCharacterAttributes(
+            PropertyList props, PropertyList defProps) throws FOPException {
 
         RtfAttributes attrib = null;
 
@@ -150,7 +143,8 @@ class TextAttributesConverter {
         String fopValue = properties.get("font-family").getString();
         
         if (fopValue != null) {
-            rtfAttr.set(RtfText.ATTR_FONT_FAMILY, RtfFontManager.getInstance().getFontNumber(fopValue));
+            rtfAttr.set(RtfText.ATTR_FONT_FAMILY, 
+                RtfFontManager.getInstance().getFontNumber(fopValue));
         }
     }
 
@@ -161,8 +155,8 @@ class TextAttributesConverter {
     
     private static void attrBlockFontColor(PropertyList properties, RtfAttributes rtfAttr) {
         // Cell background color
-        ColorTypeProperty colorTypeProp=(ColorTypeProperty)properties.get("color");
-        if(colorTypeProp != null) {
+        ColorTypeProperty colorTypeProp = (ColorTypeProperty)properties.get("color");
+        if (colorTypeProp != null) {
             ColorType colorType = colorTypeProp.getColorType();
             if (colorType != null) {
                 if (colorType.getAlpha() != 0
@@ -192,7 +186,7 @@ class TextAttributesConverter {
 
     private static void attrBlockFontItalic(PropertyList properties, RtfAttributes rtfAttr) {
         String fopValue = properties.get("font-style").getString();
-        if(fopValue.equals("italic")) {
+        if (fopValue.equals("italic")) {
             rtfAttr.set(RtfText.ATTR_ITALIC, 1);
         } else {
             rtfAttr.set(RtfText.ATTR_ITALIC, 0);
@@ -200,8 +194,8 @@ class TextAttributesConverter {
     }
     
     private static void attrBlockFontUnderline(PropertyList properties, RtfAttributes rtfAttr) {
-        EnumProperty enumProp=(EnumProperty)properties.get("text-decoration");
-        if(enumProp.getEnum()==Constants.UNDERLINE) {
+        EnumProperty enumProp = (EnumProperty)properties.get("text-decoration");
+        if (enumProp.getEnum() == Constants.UNDERLINE) {
             rtfAttr.set(RtfText.ATTR_UNDERLINE, 1);
         } else {
             rtfAttr.set(RtfText.ATTR_UNDERLINE, 0);
@@ -209,34 +203,36 @@ class TextAttributesConverter {
     }
      
     private static void attrBlockSpaceBeforeAfter(PropertyList properties, RtfAttributes rtfAttr) {
-        SpaceProperty spaceProp=null;
+        SpaceProperty spaceProp = null;
         
         //space-before
-        spaceProp=(SpaceProperty)properties.get("space-before");
-        if(spaceProp!=null) {
-            Float f = new Float(spaceProp.getLengthRange().getOptimum().getLength().getValue() / 1000f);
+        spaceProp = (SpaceProperty)properties.get("space-before");
+        if (spaceProp != null) {
+            Float f = new Float(
+                spaceProp.getLengthRange().getOptimum().getLength().getValue() / 1000f);
             String sValue = f.toString() + "pt";
             
             try {
                 rtfAttr.set(
                         RtfText.SPACE_BEFORE,
                         (int)FoUnitsConverter.getInstance().convertToTwips(sValue));           
-            } catch(FOPException fe) {
+            } catch (FOPException fe) {
                 log.warn("attrBlockSpaceBeforeAfter: " + fe.getMessage()); 
             }
         }
         
         //space-after
-        spaceProp=(SpaceProperty)properties.get("space-after");
-        if(spaceProp!=null) {
-            Float f = new Float(spaceProp.getLengthRange().getOptimum().getLength().getValue() / 1000f);
+        spaceProp = (SpaceProperty)properties.get("space-after");
+        if (spaceProp != null) {
+            Float f = new Float(
+                spaceProp.getLengthRange().getOptimum().getLength().getValue() / 1000f);
             String sValue = f.toString() + "pt";
             
             try {
                 rtfAttr.set(
                         RtfText.SPACE_AFTER,
                         (int)FoUnitsConverter.getInstance().convertToTwips(sValue));
-            } catch(FOPException fe) {
+            } catch (FOPException fe) {
                 log.warn("attrBlockSpaceBeforeAfter: " + fe.getMessage()); 
             }
         }
@@ -244,10 +240,10 @@ class TextAttributesConverter {
 
     private static void attrBlockMargins(PropertyList properties, RtfAttributes rtfAttr) {
         try {
-            LengthProperty lengthProp=null;
+            LengthProperty lengthProp = null;
             
             // margin-left
-            lengthProp=(LengthProperty)properties.get("margin-left");
+            lengthProp = (LengthProperty)properties.get("margin-left");
             if (lengthProp != null) {
                 Float f = new Float(lengthProp.getLength().getValue() / 1000f);
                 String sValue = f.toString() + "pt";
@@ -260,7 +256,7 @@ class TextAttributesConverter {
             }
 
             // margin-right
-            lengthProp=(LengthProperty)properties.get("margin-right");
+            lengthProp = (LengthProperty)properties.get("margin-right");
             if (lengthProp != null) {
                 Float f = new Float(lengthProp.getLength().getValue() / 1000f);
                 String sValue = f.toString() + "pt";
@@ -271,7 +267,7 @@ class TextAttributesConverter {
             } else {
                 rtfAttr.set(RtfText.RIGHT_INDENT_BODY, 0);
             }
-        } catch(FOPException fe) {
+        } catch (FOPException fe) {
             log.warn("attrBlockSpaceBeforeAfter: " + fe.getMessage()); 
         }
     }
@@ -282,22 +278,18 @@ class TextAttributesConverter {
         int fopValue = properties.get("text-align").getEnum();
         String rtfValue = null;
         switch (fopValue) {
-            case Constants.CENTER: {
+            case Constants.CENTER:
                 rtfValue = RtfText.ALIGN_CENTER;
                 break;
-            }
-            case Constants.END: {
+            case Constants.END:
                 rtfValue = RtfText.ALIGN_RIGHT;
                 break;
-            }
-            case Constants.JUSTIFY: {
+            case Constants.JUSTIFY:
                 rtfValue = RtfText.ALIGN_JUSTIFIED;
                 break;
-            }
-            default: {
+            default:
                 rtfValue = RtfText.ALIGN_LEFT;
                 break;
-            }
         }
         
         rtfAttr.set(rtfValue);
index 93cae8e2c6a67eabe62d1ca0ed4f6edc1fea7636..01ee1326d48d88acef202f7489ff24e748b7d6ca 100644 (file)
  * This file is part of the RTF library of the FOP project.
  */
 
-
 package org.apache.fop.render.rtf.rtflib.rtfdoc;
 
 import java.io.IOException;
-import java.io.Writer;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Iterator;
-import java.io.IOException;
-import org.apache.fop.render.rtf.rtflib.exceptions.RtfStructureException;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
 
 /**  Interface which enables an implementing class to contain linear text runs.
@@ -70,5 +63,5 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
  */
 
 public interface IRtfTextrunContainer {
-    public RtfTextrun getTextrun()  throws IOException;
+    RtfTextrun getTextrun() throws IOException;
 }
index f46109b93569da13b11f9e388115f12a031afa55..a4c562bb91401e34576f11bdfb243745286a9800 100644 (file)
@@ -66,40 +66,40 @@ package org.apache.fop.render.rtf.rtflib.rtfdoc;
  */
 public interface ITableAttributes {
     /** to process column spanning */
-    public static final String COLUMN_SPAN = "number-columns-spanned";
+    String COLUMN_SPAN = "number-columns-spanned";
     /** to process row spanning */
-    public static final String ROW_SPAN = "number-rows-spanned";
+    String ROW_SPAN = "number-rows-spanned";
 
 // RTF 1.5 attributes (word 97)
 
     /** half the space between the cells of a table row in twips */
-    public static final String ATTR_RTF_15_TRGAPH = "trgaph";
-    public static final String ATTR_ROW_LEFT_INDENT = "trleft";
+    String ATTR_RTF_15_TRGAPH = "trgaph";
+    String ATTR_ROW_LEFT_INDENT = "trleft";
 
 // RTF 1.6 Row and table attributes
     /** table row padding, top */
-    public static final String ATTR_ROW_PADDING_TOP = "trpaddt";
+    String ATTR_ROW_PADDING_TOP = "trpaddt";
     /** table row padding, bottom */
-    public static final String ATTR_ROW_PADDING_BOTTOM = "trpaddb";
+    String ATTR_ROW_PADDING_BOTTOM = "trpaddb";
     /** table row padding, left */
-    public static final String ATTR_ROW_PADDING_LEFT = "trpaddl";
+    String ATTR_ROW_PADDING_LEFT = "trpaddl";
     /** table row padding, right */
-    public static final String ATTR_ROW_PADDING_RIGHT = "trpaddr";
+    String ATTR_ROW_PADDING_RIGHT = "trpaddr";
 
     /** table row padding, top */
-    public static final String ATTR_ROW_U_PADDING_TOP = "trpaddft";
+    String ATTR_ROW_U_PADDING_TOP = "trpaddft";
     /** table row padding, bottom */
-    public static final String ATTR_ROW_U_PADDING_BOTTOM = "trpaddfb";
+    String ATTR_ROW_U_PADDING_BOTTOM = "trpaddfb";
     /** table row padding, left */
-    public static final String ATTR_ROW_U_PADDING_LEFT = "trpaddfl";
+    String ATTR_ROW_U_PADDING_LEFT = "trpaddfl";
     /** table row padding, right */
-    public static final String ATTR_ROW_U_PADDING_RIGHT = "trpaddfr";
+    String ATTR_ROW_U_PADDING_RIGHT = "trpaddfr";
 
     /**
      * List of ALL ROW PADDING attributes, used to select them when writing
      * attributes
      */
-    public static final String[] ATTRIB_ROW_PADDING = {
+    String[] ATTRIB_ROW_PADDING = {
         ATTR_ROW_PADDING_TOP, ATTR_ROW_U_PADDING_TOP,
         ATTR_ROW_PADDING_BOTTOM, ATTR_ROW_U_PADDING_BOTTOM,
         ATTR_ROW_PADDING_LEFT, ATTR_ROW_U_PADDING_LEFT,
@@ -109,76 +109,76 @@ public interface ITableAttributes {
 
 // Cell attributes
     /** cell padding, top */
-    public static final String ATTR_CELL_PADDING_TOP = "clpadt";
+    String ATTR_CELL_PADDING_TOP = "clpadt";
     /** cell padding, bottom */
-    public static final String ATTR_CELL_PADDING_BOTTOM = "clpadb";
+    String ATTR_CELL_PADDING_BOTTOM = "clpadb";
     /** cell padding, left */
-    public static final String ATTR_CELL_PADDING_LEFT = "clpadl";
+    String ATTR_CELL_PADDING_LEFT = "clpadl";
     /** cell padding, right */
-    public static final String ATTR_CELL_PADDING_RIGHT = "clpadr";
+    String ATTR_CELL_PADDING_RIGHT = "clpadr";
 
     /** cell padding, top */
-    public static final String ATTR_CELL_U_PADDING_TOP = "clpadft";
+    String ATTR_CELL_U_PADDING_TOP = "clpadft";
     /** cell padding, bottom */
-    public static final String ATTR_CELL_U_PADDING_BOTTOM = "clpadfb";
+    String ATTR_CELL_U_PADDING_BOTTOM = "clpadfb";
     /** cell padding, left */
-    public static final String ATTR_CELL_U_PADDING_LEFT = "clpadfl";
+    String ATTR_CELL_U_PADDING_LEFT = "clpadfl";
     /** cell padding, right */
-    public static final String ATTR_CELL_U_PADDING_RIGHT = "clpadfr";
+    String ATTR_CELL_U_PADDING_RIGHT = "clpadfr";
 
 // for border style file
     /** cell border, top */
-    public static final String CELL_BORDER_TOP = "clbrdrt";
+    String CELL_BORDER_TOP = "clbrdrt";
     /** cell border, bottom */
-    public static final String CELL_BORDER_BOTTOM = "clbrdrb";
+    String CELL_BORDER_BOTTOM = "clbrdrb";
     /** cell border, left */
-    public static final String CELL_BORDER_LEFT = "clbrdrl";
+    String CELL_BORDER_LEFT = "clbrdrl";
     /** cell border, right */
-    public static final String CELL_BORDER_RIGHT = "clbrdrr";
+    String CELL_BORDER_RIGHT = "clbrdrr";
 
 //Table row border attributes
     /** row border, top */
-    public static final String ROW_BORDER_TOP = "trbrdrt";
+    String ROW_BORDER_TOP = "trbrdrt";
     /** row border, bottom */
-    public static final String ROW_BORDER_BOTTOM = "trbrdrb";
+    String ROW_BORDER_BOTTOM = "trbrdrb";
     /** row border, left */
-    public static final String ROW_BORDER_LEFT = "trbrdrl";
+    String ROW_BORDER_LEFT = "trbrdrl";
     /** row border, right */
-    public static final String ROW_BORDER_RIGHT = "trbrdrr";
+    String ROW_BORDER_RIGHT = "trbrdrr";
     /** row border, horizontal */
-    public static final String ROW_BORDER_HORIZONTAL = "trbrdrh";
+    String ROW_BORDER_HORIZONTAL = "trbrdrh";
     /** row border, vertical */
-    public static final String ROW_BORDER_VERTICAL = "trbrdrv";
+    String ROW_BORDER_VERTICAL = "trbrdrv";
 
 //Table row attributes
     /** row attribute, keep-together */
-    public static final String ROW_KEEP_TOGETHER = "trkeep";
-    public static final String ROW_HEIGHT = "trrh";
+    String ROW_KEEP_TOGETHER = "trkeep";
+    String ROW_HEIGHT = "trrh";
 
     /**
      * This control word is nonexistent in RTF, used to simulate the
      * FO:keep-with-next attribute.
      */
-    public static final String ROW_KEEP_WITH_NEXT = "knext";
+    String ROW_KEEP_WITH_NEXT = "knext";
 
     /**
      * This control word is nonexistent in RTF, used to simulate the
      * FO:keep-with-previous attribute.
      */
-    public static final String ROW_KEEP_WITH_PREVIOUS = "kprevious";
+    String ROW_KEEP_WITH_PREVIOUS = "kprevious";
 
     /** cell shading, a unit-based attribute */
-    public static final String CELL_SHADE = "clshdng";
+    String CELL_SHADE = "clshdng";
     /** cell background color, a unit-based attribute */
-    public static final String CELL_COLOR_BACKGROUND = "clcbpat";
+    String CELL_COLOR_BACKGROUND = "clcbpat";
     /** cell foreground color, a unit-based attribute */
-    public static final String CELL_COLOR_FOREGROUND = "clcfpat";
+    String CELL_COLOR_FOREGROUND = "clcfpat";
 
     /**
      * List of ALL CELL PADDING attributes, used to select them when writing
      * attributes
      */
-    public static final String[] ATTRIB_CELL_PADDING = {
+    String[] ATTRIB_CELL_PADDING = {
         ATTR_CELL_PADDING_TOP, ATTR_CELL_U_PADDING_TOP,
         ATTR_CELL_PADDING_BOTTOM, ATTR_CELL_U_PADDING_BOTTOM,
         ATTR_CELL_PADDING_LEFT, ATTR_CELL_U_PADDING_LEFT,
@@ -189,7 +189,7 @@ public interface ITableAttributes {
      * List of ALL CELL BORDER attributes, used to select them when writing
      * attributes
      */
-    public static final String[] CELL_BORDER = {
+    String[] CELL_BORDER = {
         CELL_BORDER_TOP,    CELL_BORDER_BOTTOM,
         CELL_BORDER_LEFT,   CELL_BORDER_RIGHT
     };
@@ -198,7 +198,7 @@ public interface ITableAttributes {
      * List of ALL ROW BORDER attributes, used to select them when writing
      * attributes
      */
-    public static final String[] ROW_BORDER = {
+    String[] ROW_BORDER = {
         ROW_BORDER_TOP,     ROW_BORDER_BOTTOM,        ROW_BORDER_LEFT,
         ROW_BORDER_RIGHT,   ROW_BORDER_HORIZONTAL,    ROW_BORDER_VERTICAL
     };
@@ -207,7 +207,7 @@ public interface ITableAttributes {
      * List of ALL CELL SHADING AND COLOR attributes, used to select them when
      * writing attributes
      */
-    public static final String[] CELL_COLOR = {
+    String[] CELL_COLOR = {
         CELL_SHADE,    CELL_COLOR_BACKGROUND,    CELL_COLOR_FOREGROUND
     };
 }
\ No newline at end of file
index f05f56b998b052f8c9ba2e0d2e71be056c997b96..7d878c51f8240df795851aa4488a9050457ebc72 100644 (file)
@@ -244,7 +244,7 @@ extends RtfContainer {
      * @param args command-line arguments
      * @throws Exception for problems
      */
-    public static void main(String args[])
+    public static void main(String[] args)
     throws Exception {
         Writer w = null;
         if (args.length != 0) {
index 66a8a07c27b9b13f6fa0070369b13713d7627b8f..2d7f3507a6d2919bcbc6f5554e70cff2fc00442f 100644 (file)
@@ -110,10 +110,10 @@ public class RtfPageNumberCitation extends RtfContainer {
             // Build page reference field
             String pageRef = RTF_FIELD_PAGEREF_MODEL;
             final int insertionIndex = pageRef.indexOf("}");
-            pageRef =
-                pageRef.substring(0, insertionIndex) + "\"" + id + "\"" + " "
-                + pageRef.substring(insertionIndex, pageRef.length())
-            ;
+            pageRef = pageRef.substring(0, insertionIndex) 
+                + "\"" + id 
+                + "\"" + " "
+                + pageRef.substring(insertionIndex, pageRef.length());
             id = null;
 
             // Write RTF content
index 7891991507cd4257845d1b824decf5bcd33cddd4..878542c835604acc181db1e528c986326fdfa8b2 100644 (file)
@@ -90,7 +90,7 @@ implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer,
     private boolean writeForBreak = false;
 
     /** Set of attributes that must be copied at the start of a paragraph */
-    private static final String [] PARA_ATTRIBUTES = { "intbl" };
+    private static final String[] PARA_ATTRIBUTES = {"intbl"};
 
     /** Create an RTF paragraph as a child of given container with default attributes */
     RtfParagraph(IRtfParagraphContainer parent, Writer w) throws IOException {
index 8ef95fe0cf6dbef327794c7ba8c7112a034c5dc3..ef8c7de6a17c0a4cef4fb427d8fe2061a132741e 100644 (file)
@@ -64,15 +64,14 @@ import java.io.Writer;
  *  @author Peter Herweg, pherweg@web.de
  */
 
-public class RtfString extends RtfElement
-{
-    String text="";
+public class RtfString extends RtfElement {
+    private String text = "";
         
     RtfString(RtfContainer parent, Writer w, String s)
     throws IOException {
         super(parent, w);
             
-        text=s;
+        text = s;
     }
         
     /**
@@ -95,6 +94,6 @@ public class RtfString extends RtfElement
     }
         
     public void setText(String s) {
-        text=s;
+        text = s;
     }
 }
\ No newline at end of file
index de11831edf29afd67a70a8eda1f0570531c9e234..798db340154b9dab244a9679916f5be9dc74ec35 100644 (file)
@@ -130,8 +130,8 @@ implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer,
 
         if (parent.parent instanceof RtfTable) {
             // Get the context of the current table in order to get the width of each column
-            ITableColumnsInfo tableColumnsInfo =
-                    ((RtfTable)parent.parent).getITableColumnsInfo();
+            ITableColumnsInfo tableColumnsInfo
+                = ((RtfTable)parent.parent).getITableColumnsInfo();
             tableColumnsInfo.selectFirstColumn();
 
             // Reach the column index in table context corresponding to the current column cell
@@ -481,7 +481,7 @@ implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer,
         RtfAttributes attrs = new RtfAttributes();
         attrs.set("intbl");
         
-        RtfTextrun textrun=RtfTextrun.getTextrun(this, writer, attrs);
+        RtfTextrun textrun = RtfTextrun.getTextrun(this, writer, attrs);
 
         //Suppress the very last \par, because the closing \cell applies the
         //paragraph attributes. 
index d2031927d0e8cca5e7b1141a5238e9aa199b8c10..5342bdaf14b829115a711edea875c88348bb91ef 100644 (file)
@@ -184,7 +184,7 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
         writeAttributes(attrib, ITableAttributes.CELL_BORDER);
         writeAttributes(attrib, BorderAttributesConverter.BORDERS);
 
-        if(attrib.isSet(ITableAttributes.ROW_HEIGHT)) {
+        if (attrib.isSet(ITableAttributes.ROW_HEIGHT)) {
             writeOneAttribute(
                     ITableAttributes.ROW_HEIGHT,
                     attrib.getValue(ITableAttributes.ROW_HEIGHT));
@@ -214,9 +214,9 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
                           nestedTableFound = true;
                           indexesFound.addElement(new Integer(index));
                         } else if (subElement instanceof RtfParagraph) {
-                           for (Iterator it3 =
-                               ((RtfParagraph)subElement).getChildren().iterator(); it3.hasNext();)
-                             {
+                           for (Iterator it3
+                                = ((RtfParagraph)subElement).getChildren().iterator(); 
+                                it3.hasNext();) {
                                 final RtfElement subSubElement = (RtfElement)it3.next();
                                 if (subSubElement instanceof RtfTable) {
                                     nestedTableFound = true;
index aae0190d802ede676a386ab5a95dcb16d2ee84e6..6279d997e5ce965356f0c6de5d71972efbaabf1f 100644 (file)
@@ -58,25 +58,23 @@ package org.apache.fop.render.rtf.rtflib.rtfdoc;
 
 import java.io.IOException;
 import java.io.Writer;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Iterator;
-import java.io.IOException;
-import org.apache.fop.render.rtf.rtflib.exceptions.RtfStructureException;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic;
 
-/**  Class which contains a linear text run. It has methods to add attributes, text, paragraph breaks....
- *  @author Peter Herweg, pherweg@web.de
+/** 
+ * Class which contains a linear text run. It has methods to add attributes, 
+ * text, paragraph breaks....
+ * @author Peter Herweg, pherweg@web.de
  */
-
 public class RtfTextrun extends RtfContainer {
-    private boolean bSuppressLastPar=false;
+    private boolean bSuppressLastPar = false;
     
     /**  Class which represents the opening of a RTF group mark.*/
-    private class RtfOpenGroupMark extends RtfElement
-    {        
+    private class RtfOpenGroupMark extends RtfElement {
+                
         RtfOpenGroupMark(RtfContainer parent, Writer w, RtfAttributes attr)
-        throws IOException {
+                throws IOException {
             super(parent, w, attr);
         }
         
@@ -98,10 +96,10 @@ public class RtfTextrun extends RtfContainer {
     }
     
     /**  Class which represents the closing of a RTF group mark.*/
-    private class RtfCloseGroupMark extends RtfElement
-    {
+    private class RtfCloseGroupMark extends RtfElement {
+        
         RtfCloseGroupMark(RtfContainer parent, Writer w)
-        throws IOException {
+                throws IOException {
             super(parent, w);
         }
         
@@ -122,10 +120,10 @@ public class RtfTextrun extends RtfContainer {
     }
 
     /**  Class which represents a paragraph break.*/
-    private class RtfParagraphBreak extends RtfElement
-    {
+    private class RtfParagraphBreak extends RtfElement {
+        
         RtfParagraphBreak(RtfContainer parent, Writer w)
-        throws IOException {
+                throws IOException {
             super(parent, w);
         }
     
@@ -151,23 +149,23 @@ public class RtfTextrun extends RtfContainer {
     }
     
     public void pushAttributes(RtfAttributes attrs) throws IOException {
-        RtfOpenGroupMark r=new RtfOpenGroupMark(this, writer, attrs);
+        RtfOpenGroupMark r = new RtfOpenGroupMark(this, writer, attrs);
     }
     
     public void popAttributes() throws IOException {
-        RtfCloseGroupMark r=new RtfCloseGroupMark(this, writer);
+        RtfCloseGroupMark r = new RtfCloseGroupMark(this, writer);
     }
     
     public void addString(String s) throws IOException {
-        RtfString r=new RtfString(this, writer, s);
+        RtfString r = new RtfString(this, writer, s);
     }
     
     public void addParagraphBreak() throws IOException {
-        RtfParagraphBreak r=new RtfParagraphBreak(this, writer);
+        RtfParagraphBreak r = new RtfParagraphBreak(this, writer);
     }
     
     public void addPageNumber(RtfAttributes attr) throws IOException {
-        RtfPageNumber r=new RtfPageNumber(this, writer, attr);
+        RtfPageNumber r = new RtfPageNumber(this, writer, attr);
     }
     
     public RtfExternalGraphic newImage() throws IOException {
@@ -182,23 +180,23 @@ public class RtfTextrun extends RtfContainer {
      * @throws IOException for I/O problems
      */
     public static RtfTextrun getTextrun(RtfContainer container, Writer writer, RtfAttributes attrs)
-    throws IOException {
+            throws IOException {
         Object obj;
-        List list=container.getChildren();
+        List list = container.getChildren();
                 
-        if(list.size()==0) {
+        if (list.size() == 0) {
             //add a new RtfTextrun
-            RtfTextrun textrun=new RtfTextrun(container, writer, attrs);
+            RtfTextrun textrun = new RtfTextrun(container, writer, attrs);
             list.add(textrun);
 
             return textrun;
-        } else if ((obj=list.get(list.size()-1)) instanceof RtfTextrun ) {
+        } else if ((obj = list.get(list.size() - 1)) instanceof RtfTextrun ) {
             //if the last child is a RtfTextrun, return it
             return (RtfTextrun)obj;
         }
 
         //add a new RtfTextrun as the last child
-        RtfTextrun textrun=new RtfTextrun(container, writer, attrs);
+        RtfTextrun textrun = new RtfTextrun(container, writer, attrs);
         list.add(textrun);
         
         return textrun;
@@ -207,10 +205,9 @@ public class RtfTextrun extends RtfContainer {
     /**
      * specify, if the last paragraph control word (\par) should be suppressed.
      * @param bSuppress true, if the last \par should be suppressed
-     * @throws IOException for I/O problems
      */    
     public void setSuppressLastPar(boolean bSuppress) {
-        bSuppressLastPar=bSuppress;
+        bSuppressLastPar = bSuppress;
     }
    
     /**
@@ -233,26 +230,26 @@ public class RtfTextrun extends RtfContainer {
         }
         
         //determine, if this RtfTextrun is the last child of its parent
-        boolean bLast=false;
+        boolean bLast = false;
         for (Iterator it = parent.getChildren().iterator(); it.hasNext();) {
-            if(it.next() == this) {
-                bLast=!it.hasNext();
+            if (it.next() == this) {
+                bLast = !it.hasNext();
                 break;
             }
         }
         
         //get last RtfParagraphBreak, which is not followed by any visible child
-        RtfParagraphBreak lastParagraphBreak=null;
-        if(bLast) {
+        RtfParagraphBreak lastParagraphBreak = null;
+        if (bLast) {
             for (Iterator it = getChildren().iterator(); it.hasNext();) {
                 final RtfElement e = (RtfElement)it.next();
-                if(e instanceof RtfParagraphBreak) {
-                    lastParagraphBreak=(RtfParagraphBreak)e;
+                if (e instanceof RtfParagraphBreak) {
+                    lastParagraphBreak = (RtfParagraphBreak)e;
                 } else {
-                    if(!(e instanceof RtfOpenGroupMark)
-                    && !(e instanceof RtfCloseGroupMark)
-                    && e.isEmpty()) {
-                        lastParagraphBreak=null;
+                    if (!(e instanceof RtfOpenGroupMark)
+                            && !(e instanceof RtfCloseGroupMark)
+                            && e.isEmpty()) {
+                        lastParagraphBreak = null;
                     }
                 }
             }
@@ -276,26 +273,27 @@ public class RtfTextrun extends RtfContainer {
              * -If the RtfTextrun is the last child of its parent, write a
              * RtfParagraphBreak only, if it is not the last child.
              */
-            boolean bHide=false;
-            bHide=bRtfParagraphBreak;
-            bHide=bHide &&
-                    (bPrevPar || bFirst || 
-                        (bSuppressLastPar && bLast && lastParagraphBreak!=null && e==lastParagraphBreak)
-                    );
+            boolean bHide = false;
+            bHide = bRtfParagraphBreak;
+            bHide = bHide 
+                && (bPrevPar 
+                    || bFirst 
+                    || (bSuppressLastPar && bLast && lastParagraphBreak != null 
+                        && e == lastParagraphBreak));
                 
-            if!bHide) {
+            if (!bHide) {
                 e.writeRtf(); 
             }
             
-            if(e instanceof RtfParagraphBreak) {
-                bPrevPar=true;
-            } else if(e instanceof RtfCloseGroupMark) {
+            if (e instanceof RtfParagraphBreak) {
+                bPrevPar = true;
+            } else if (e instanceof RtfCloseGroupMark) {
                 //do nothing
-            } else if(e instanceof RtfOpenGroupMark) {
+            } else if (e instanceof RtfOpenGroupMark) {
                 //do nothing
             } else {
-                bPrevPar=bPrevPar && e.isEmpty();
-                bFirst=bFirst && e.isEmpty();
+                bPrevPar = bPrevPar && e.isEmpty();
+                bFirst = bFirst && e.isEmpty();
             }
         }
     }
index 98f1bed80881ef35a891593ee30ccb02896f310f..b0f58b8f90f7db17ed740b948adfef51cbcefdc5 100644 (file)
@@ -89,16 +89,16 @@ class WhitespaceCollapser {
 
     /** process one RtfText from our container */
     private void processText(RtfText txt) {
-        final String newString=processString(txt.getText());
-        if(newString!=null) {
+        final String newString = processString(txt.getText());
+        if (newString != null) {
             txt.setText(newString);
         }
     }
     
     /** process one RtfString from our container */
     private void processString(RtfString txt) {
-        final String newString=processString(txt.getText());
-        if(newString!=null) {
+        final String newString = processString(txt.getText());
+        if (newString != null) {
             txt.setText(newString);
         }
     }
@@ -109,7 +109,7 @@ class WhitespaceCollapser {
 
         // tokenize the text based on whitespace and regenerate it so as
         // to collapse multiple spaces into one
-        if(orig==null) {
+        if (orig == null) {
             return null;
         } else if (orig.length() > 0) { 
             final boolean allSpaces = orig.trim().length() == 0;
index c98ce3f51aedb82ea427a14ac989bb7cfb95c019..8f398a80bb4885b874614e5c11830168a8627ad0 100644 (file)
@@ -119,7 +119,7 @@ public class CreateTestDocuments {
      * @param args String array of arguments
      * @throws Exception for errors
      */
-    public static void main(String args[])
+    public static void main(String[] args)
     throws Exception {
         if (args.length < 1) {
             System.err.println("usage: CreateTestDocuments <output directory>");