From 376f43d88f907565471073a2afa67032ef2b1856 Mon Sep 17 00:00:00 2001 From: William Victor Mote Date: Fri, 4 Jul 2003 06:28:34 +0000 Subject: [PATCH] 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 --- .../fop/rtf/rtflib/rtfdoc/RtfTableRow.java | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) 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 -- 2.39.5