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 vh...@apache.org on 2007/08/02 11:27:43 UTC

svn commit: r562053 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java

Author: vhennebert
Date: Thu Aug  2 02:27:42 2007
New Revision: 562053

URL: http://svn.apache.org/viewvc?view=rev&rev=562053
Log:
Clean up the handling of startIndent

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java?view=diff&rev=562053&r1=562052&r2=562053
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java Thu Aug  2 02:27:42 2007
@@ -69,8 +69,6 @@
     private int cellIPD;
     private int rowHeight;
     private int usedBPD;
-    private int startBorderWidth;
-    private int endBorderWidth;
     private int borderAndPaddingBPD;
     private boolean emptyCell = true;
 
@@ -124,18 +122,21 @@
 
     /** {@inheritDoc} */
     protected int getIPIndents() {
-        int iIndents = 0;
         int[] startEndBorderWidths = primaryGridUnit.getStartEndBorderWidths();
-        startBorderWidth += startEndBorderWidths[0];
-        endBorderWidth += startEndBorderWidths[1];
-        iIndents += startBorderWidth;
-        iIndents += endBorderWidth;
-        if (!isSeparateBorderModel()) {
-            iIndents /= 2;
+        startIndent = startEndBorderWidths[0];
+        endIndent = startEndBorderWidths[1];
+        if (isSeparateBorderModel()) {
+            int borderSep = getTable().getBorderSeparation().getLengthPair().getIPD().getLength()
+                    .getValue(this);
+            startIndent += borderSep / 2;
+            endIndent += borderSep / 2;
+        } else {
+            startIndent /= 2;
+            endIndent /= 2;
         }
-        iIndents += getTableCell().getCommonBorderPaddingBackground().getPaddingStart(false, this);
-        iIndents += getTableCell().getCommonBorderPaddingBackground().getPaddingEnd(false, this);
-        return iIndents;
+        startIndent += getTableCell().getCommonBorderPaddingBackground().getPaddingStart(false, this);
+        endIndent += getTableCell().getCommonBorderPaddingBackground().getPaddingEnd(false, this);
+        return startIndent + endIndent;
     }
 
     /**
@@ -147,11 +148,6 @@
         referenceIPD = context.getRefIPD();
         cellIPD = referenceIPD;
         cellIPD -= getIPIndents();
-        if (isSeparateBorderModel()) {
-            int borderSep = getTable().getBorderSeparation().getLengthPair()
-                    .getIPD().getLength().getValue(this);
-            cellIPD -= borderSep;
-        }
 
         LinkedList returnedList = null;
         LinkedList contentList = new LinkedList();
@@ -461,12 +457,6 @@
             curBlockArea.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
             TraitSetter.setProducerID(curBlockArea, getTableCell().getId());
             curBlockArea.setPositioning(Block.ABSOLUTE);
-            int indent = startBorderWidth;
-            if (!isSeparateBorderModel()) {
-                indent /= 2;
-            }
-            indent += getTableCell()
-                    .getCommonBorderPaddingBackground().getPaddingStart(false, this);
             // set position
             int borderAdjust = 0;
             if (!isSeparateBorderModel()) {
@@ -479,8 +469,7 @@
                 //borderAdjust += primaryGridUnit.getBorders().getBorderBeforeWidth(false);
             }
             TableLayoutManager tableLM = (TableLayoutManager)getParent();
-            curBlockArea.setXOffset(xoffset + inRowIPDOffset
-                    + tableLM.getHalfBorderSeparationIPD() + indent);
+            curBlockArea.setXOffset(xoffset + inRowIPDOffset + startIndent);
             curBlockArea.setYOffset(yoffset - borderAdjust
                     + tableLM.getHalfBorderSeparationBPD());
             curBlockArea.setIPD(cellIPD);



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