From c6363fe8a30d2d5c6fa6f588966a35f4352f7ac0 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Fri, 14 Dec 2007 11:32:51 +0000 Subject: [PATCH] Clean up: removed all reset and resetPosition methods, which pre-date the Knuth era and are no longer needed git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@604171 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/AbstractLayoutManager.java | 39 ------------------- .../BlockContainerLayoutManager.java | 9 ----- .../fop/layoutmgr/BlockLayoutManager.java | 13 ------- .../fop/layoutmgr/FlowLayoutManager.java | 8 ---- .../apache/fop/layoutmgr/LayoutManager.java | 7 ---- .../inline/ContentLayoutManager.java | 7 ---- .../inline/InlineStackingLayoutManager.java | 35 ----------------- .../layoutmgr/inline/LineLayoutManager.java | 27 ------------- .../layoutmgr/inline/TextLayoutManager.java | 30 -------------- .../list/ListBlockLayoutManager.java | 13 ------- .../list/ListItemContentLayoutManager.java | 14 ------- .../layoutmgr/list/ListItemLayoutManager.java | 11 ------ .../table/TableAndCaptionLayoutManager.java | 11 ------ .../table/TableCaptionLayoutManager.java | 11 ------ .../table/TableCellLayoutManager.java | 11 ------ .../layoutmgr/table/TableLayoutManager.java | 11 ------ 16 files changed, 257 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java index 21af512fc..f0365d0e4 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -129,45 +129,6 @@ public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager return childLMiter.hasNext(); } - /** - * Reset the layoutmanager "iterator" so that it will start - * with the passed Position's generating LM - * on the next call to getChildLM. - * @param pos a Position returned by a child layout manager - * representing a potential break decision. - * If pos is null, then back up to the first child LM. - */ - protected void reset(org.apache.fop.layoutmgr.Position pos) { - //if (lm == null) return; - LayoutManager lm = (pos != null) ? pos.getLM() : null; - if (curChildLM != lm) { - // ASSERT curChildLM == (LayoutManager)childLMiter.previous() - if (childLMiter.hasPrevious() && curChildLM - != (LayoutManager) childLMiter.previous()) { - //log.error("LMiter problem!"); - } - while (curChildLM != lm && childLMiter.hasPrevious()) { - curChildLM.resetPosition(null); - curChildLM = (LayoutManager) childLMiter.previous(); - } - // Otherwise next returns same object - childLMiter.next(); - } - if (curChildLM != null) { - curChildLM.resetPosition(pos); - } - if (isFinished()) { - setFinished(false); - } - } - - /** {@inheritDoc} */ - public void resetPosition(Position resetPos) { - // if (resetPos == null) { - // reset(null); - // } - } - /** * Tell whether this LayoutManager has handled all of its content. * @return True if there are no more break possibilities, diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 9c3c8ce59..03aa380d2 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -938,15 +938,6 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager } } - /** - * {@inheritDoc} - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - reset(null); - } - } - /** * Force current area to be added to parent area. * {@inheritDoc} diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java index 62e41ac16..bb39def8d 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java @@ -476,19 +476,6 @@ public class BlockLayoutManager extends BlockStackingLayoutManager } } - /** - * {@inheritDoc} - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - reset(null); - childBreaks.clear(); - } else { - //reset(resetPos); - LayoutManager lm = resetPos.getLM(); - } - } - /** * convenience method that returns the Block node * @return the block node diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java index f5d912111..a70dd0883 100644 --- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java @@ -342,14 +342,6 @@ public class FlowLayoutManager extends BlockStackingLayoutManager return parentArea; } - /** - * {@inheritDoc} - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - reset(null); - } - } /** * Returns the IPD of the content area * @return the IPD of the content area diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManager.java b/src/java/org/apache/fop/layoutmgr/LayoutManager.java index 39b970682..0b17c9a27 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManager.java @@ -58,13 +58,6 @@ public interface LayoutManager extends PercentBaseContext { */ PageSequenceLayoutManager getPSLM(); - /** - * Reset to the position. - * - * @param position the Position to reset to - */ - void resetPosition(Position position); - /** * Return a value indicating whether this LayoutManager has laid out * all its content (or generated BreakPossibilities for all content.) diff --git a/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java index 22a01f9fb..03e9b382a 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java @@ -212,13 +212,6 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager //to be done } - /** - * {@inheritDoc} - */ - public void resetPosition(Position position) { - //to be done - } - /** * {@inheritDoc} */ diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java index 7da7cc49f..4d0872a6d 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java @@ -154,41 +154,6 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager return null; } - /** - * Reset position for returning next BreakPossibility. - * @param prevPos a Position returned by this layout manager - * representing a potential break decision. - */ - public void resetPosition(Position prevPos) { - if (prevPos != null) { - // ASSERT (prevPos.getLM() == this) - if (prevPos.getLM() != this) { - //getLogger().error( - // "InlineStackingLayoutManager.resetPosition: " + - // "LM mismatch!!!"); - } - // Back up the child LM Position - Position childPos = prevPos.getPosition(); - reset(childPos); - /* - if (prevBP != null - && prevBP.getLayoutManager() != childPos.getLM()) { - childLC = null; - } - prevBP = new BreakPoss(childPos); - */ - } else { - // Backup to start of first child layout manager - //prevBP = null; - // super.resetPosition(prevPos); - reset(prevPos); - // If any areas created, we are restarting! - bAreaCreated = false; - } - // Do we need to reset some context like pending or prevContent? - // What about prevBP? - } - /** * TODO: Explain this method * @param lm ??? diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index e722162d8..6df7ac00c 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -1555,33 +1555,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager } } - /** - * Reset the positions to the given position. - * - * @param resetPos the position to reset to - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - setFinished(false); - iReturnedLBP = 0; - } else { - if (isFinished()) { - // if isFinished is true, iReturned LBP == breakpoints.size() - // and breakpoints.get(iReturnedLBP) would generate - // an IndexOutOfBoundException - setFinished(false); - iReturnedLBP--; - } - // It is not clear that the member lineLayouts has the correct value; - // because the method is not called, this cannot be checked. - while ((LineBreakPosition) lineLayouts.getChosenPosition(iReturnedLBP) - != (LineBreakPosition) resetPos) { - iReturnedLBP--; - } - iReturnedLBP++; - } - } - /** * Add the areas with the break points. * diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java index 63f11147c..40e1c087a 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java @@ -224,36 +224,6 @@ public class TextLayoutManager extends LeafNodeLayoutManager { } - /** - * Reset position for returning next BreakPossibility. - * - * @param prevPos the position to reset to - */ - public void resetPosition(Position prevPos) { - if (prevPos != null) { - // ASSERT (prevPos.getLM() == this) - if (prevPos.getLM() != this) { - log.error("TextLayoutManager.resetPosition: " - + "LM mismatch!!!"); - } - LeafPosition tbp = (LeafPosition) prevPos; - AreaInfo ai = (AreaInfo) vecAreaInfo.get(tbp.getLeafPos()); - if (ai.iBreakIndex != iNextStart) { - iNextStart = ai.iBreakIndex; - vecAreaInfo.ensureCapacity(tbp.getLeafPos() + 1); - // TODO: reset or recalculate total IPD = sum of all word IPD - // up to the break position - ipdTotal = ai.ipdArea; - setFinished(false); - } - } else { - // Reset to beginning! - vecAreaInfo.clear(); - iNextStart = 0; - setFinished(false); - } - } - // TODO: see if we can use normal getNextBreakPoss for this with // extra hyphenation information in LayoutContext private boolean getHyphenIPD(HyphContext hc, MinOptMax hyphIPD) { diff --git a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java index acd9bf718..470cbbe9c 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java @@ -277,19 +277,6 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager } } - /** - * Reset the position of this layout manager. - * - * @param resetPos the position to reset to - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - reset(null); - } else { - //TODO Something to put here? - } - } - /** {@inheritDoc} */ public boolean mustKeepTogether() { //TODO Keeps will have to be more sophisticated sooner or later diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java index e1171d6fd..853b1a128 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java @@ -220,20 +220,6 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager { } } - /** - * Reset the position of the layout. - * - * @param resetPos the position to reset to - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - reset(null); - } else { - setFinished(false); - //reset(resetPos); - } - } - /** {@inheritDoc} */ public boolean mustKeepTogether() { //TODO Keeps will have to be more sophisticated sooner or later diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index 7b7cb52b0..dc28e98e2 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -623,17 +623,6 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager } } - /** - * Reset the position of this layout manager. - * - * @param resetPos the position to reset to - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - reset(null); - } - } - /** {@inheritDoc} */ public boolean mustKeepTogether() { //TODO Keeps will have to be more sophisticated sooner or later diff --git a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java index 55b67053f..6d2e49e96 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java @@ -194,16 +194,5 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager { curBlockArea.addBlock((Block) childArea); } } - - /** - * Reset the position of this layout manager. - * - * @param resetPos the position to reset to - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - reset(null); - } - } } diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java index 58c85e8cd..4c21df937 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java @@ -193,16 +193,5 @@ public class TableCaptionLayoutManager extends BlockStackingLayoutManager { curBlockArea.addBlock((Block) childArea); } } - - /** - * Reset the layout position. - * - * @param resetPos the position to reset to - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - reset(null); - } - } } diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java index 46bdecf63..63810e057 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java @@ -504,17 +504,6 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager } } - /** - * Reset the position of the layout. - * - * @param resetPos the position to reset to - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - reset(null); - } - } - /** * {@inheritDoc} */ diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index e33773695..2e366f36d 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -404,17 +404,6 @@ public class TableLayoutManager extends BlockStackingLayoutManager } } - /** - * Reset the position of this layout manager. - * - * @param resetPos the position to reset to - */ - public void resetPosition(Position resetPos) { - if (resetPos == null) { - reset(null); - } - } - /** {@inheritDoc} */ public int negotiateBPDAdjustment(int adj, KnuthElement lastElement) { // TODO Auto-generated method stub -- 2.39.5