From: William Victor Mote Date: Fri, 4 Jul 2003 06:28:34 +0000 (+0000) Subject: extract method adjustBorderProperties from writeRtfContent, primarily to satisfy... X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1353 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=376f43d88f907565471073a2afa67032ef2b1856;p=xmlgraphics-fop.git extract method adjustBorderProperties from writeRtfContent, primarily to satisfy checkstyle requirements for method size. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196586 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java index 27a9164a5..81dc8cf52 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java @@ -177,25 +177,8 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { 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 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { /** * 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; @@ -315,6 +299,27 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { 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); + } + } + } + /** * Overridden to write RTF suffix code, what comes after our children * @throws IOException for I/O problems