From: Andreas L. Delmelle Date: Thu, 26 Nov 2015 20:41:24 +0000 (+0000) Subject: Minor fixups: remove redundant null check, remove redundant initial assignment +... X-Git-Tag: fop-2_1~29 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bd129ada80e16c95106585181de31846127034c2;p=xmlgraphics-fop.git Minor fixups: remove redundant null check, remove redundant initial assignment + start of javadoc fixups git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1716765 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java index 06e1484cf..6c66646b0 100644 --- a/src/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java @@ -38,30 +38,40 @@ public class FloatContentLayoutManager extends SpacedBorderedPaddedBlockLayoutMa private int side; private int yOffset; + /** + * {@asf.todo - Add info} + * + * @param node the {@link Float} associated with this instance + */ public FloatContentLayoutManager(Float node) { super(node); generatesReferenceArea = true; side = node.getFloat(); } + @Override public Keep getKeepTogether() { return getParentKeepTogether(); } + @Override public Keep getKeepWithNext() { return Keep.KEEP_AUTO; } + @Override public Keep getKeepWithPrevious() { return Keep.KEEP_ALWAYS; } + @Override public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { floatContentArea = new SideFloat(); AreaAdditionUtil.addAreas(this, parentIter, layoutContext); flush(); } + @Override public void addChildArea(Area childArea) { floatContentArea.addChildArea(childArea); floatContentArea.setBPD(childArea.getAllocBPD()); @@ -89,6 +99,14 @@ public class FloatContentLayoutManager extends SpacedBorderedPaddedBlockLayoutMa } } + /** + * {@asf.todo - Add info} + * + * @param elemenList + * @param startIndex + * @param endIndex + * @return + */ public static List checkForFloats(List elemenList, int startIndex, int endIndex) { ListIterator iter = elemenList.listIterator(startIndex); @@ -108,10 +126,16 @@ public class FloatContentLayoutManager extends SpacedBorderedPaddedBlockLayoutMa } } + @Override protected CommonBorderPaddingBackground getCommonBorderPaddingBackground() { return null; } + /** + * {@asf.todo - Add info} + * + * @param layoutContext + */ public void processAreas(LayoutContext layoutContext) { if (getParent() instanceof FloatLayoutManager) { FloatLayoutManager flm = (FloatLayoutManager) getParent(); @@ -119,23 +143,27 @@ public class FloatContentLayoutManager extends SpacedBorderedPaddedBlockLayoutMa } } + /** + * @return the height of the float content area + */ public int getFloatHeight() { return floatContentArea.getAllocBPD(); } + /** + * @return the y-offset of the float content + */ public int getFloatYOffset() { return yOffset; } private int getStartIndent() { - int startIndent = 0; + int startIndent; LayoutManager lm = getParent(); while (!(lm instanceof BlockLayoutManager)) { lm = lm.getParent(); } - if (lm != null) { - startIndent = ((BlockLayoutManager) lm).startIndent; - } + startIndent = ((BlockLayoutManager) lm).startIndent; return startIndent; } }