vmote       2003/07/03 23:28:34

  Modified:    src/java/org/apache/fop/rtf/rtflib/rtfdoc RtfTableRow.java
  Log:
  extract method adjustBorderProperties from writeRtfContent, primarily to satisfy 
checkstyle requirements for method size.
  
  Revision  Changes    Path
  1.7       +25 -20    
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java
  
  Index: RtfTableRow.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RtfTableRow.java  3 Jul 2003 19:14:47 -0000       1.6
  +++ RtfTableRow.java  4 Jul 2003 06:28:34 -0000       1.7
  @@ -177,25 +177,8 @@
   
           writePaddingAttributes();
   
  -        // if we have attributes, manipulate border properties
           final RtfTable parentTable = (RtfTable) parent;
  -        if (attrib != null && parentTable != null) {
  -
  -            //if table is only one row long
  -            if (isFirstRow() && parentTable.isHighestRow(id)) {
  -                attrib.unset(ITableAttributes.ROW_BORDER_HORIZONTAL);
  -                //or if row is the first row
  -            } else if (isFirstRow()) {
  -                attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM);
  -                //or if row is the last row
  -            } else if (parentTable.isHighestRow(id)) {
  -                attrib.unset(ITableAttributes.ROW_BORDER_TOP);
  -                //else the row is an inside row
  -            } else {
  -                attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM);
  -                attrib.unset(ITableAttributes.ROW_BORDER_TOP);
  -            }
  -        }
  +        adjustBorderProperties(parentTable);
   
           writeAttributes(attrib, ITableAttributes.ROW_BORDER);
           writeAttributes(attrib, ITableAttributes.CELL_BORDER);
  @@ -203,7 +186,8 @@
   
           /**
            * Added by Boris POUDEROUS on 07/02/2002
  -         * in order to get the indexes of the cells preceding a cell that contains 
a nested table.
  +         * in order to get the indexes of the cells preceding a cell that
  +         * contains a nested table.
            * Thus, the cells of the extra row will be merged with the cells above.
            */
           boolean nestedTableFound = false;
  @@ -313,6 +297,27 @@
   
           // now children can write themselves, we have the correct RTF prefix code
           super.writeRtfContent();
  +    }
  +
  +    private void adjustBorderProperties(RtfTable parentTable) {
  +        // if we have attributes, manipulate border properties
  +        if (attrib != null && parentTable != null) {
  +
  +            //if table is only one row long
  +            if (isFirstRow() && parentTable.isHighestRow(id)) {
  +                attrib.unset(ITableAttributes.ROW_BORDER_HORIZONTAL);
  +            //or if row is the first row
  +            } else if (isFirstRow()) {
  +                attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM);
  +            //or if row is the last row
  +            } else if (parentTable.isHighestRow(id)) {
  +                attrib.unset(ITableAttributes.ROW_BORDER_TOP);
  +            //else the row is an inside row
  +            } else {
  +                attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM);
  +                attrib.unset(ITableAttributes.ROW_BORDER_TOP);
  +            }
  +        }
       }
   
       /**
  
  
  

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

Reply via email to