From d6b0958beb79e5ad0edb8bb6071cea5347d50e3c Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Fri, 10 Jun 2005 03:56:49 +0000 Subject: [PATCH] Removed unused functions. Team, I switched from generatesInlineAreas() calls to "instanceof InlineLevelLayoutManager", because AFAICT there is a 1-to-1 mapping between the two. If no one has problems with this, I will be removing the generatesInlineAreas() implementations next. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198736 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/AbstractLayoutManager.java | 19 --------------- .../fop/layoutmgr/BlockLayoutManager.java | 4 ++-- .../fop/layoutmgr/CharacterLayoutManager.java | 18 -------------- .../fop/layoutmgr/ContentLayoutManager.java | 4 ---- .../fop/layoutmgr/FlowLayoutManager.java | 2 +- .../apache/fop/layoutmgr/LayoutManager.java | 12 ---------- .../fop/layoutmgr/LayoutManagerMapping.java | 2 +- .../fop/layoutmgr/LeaderLayoutManager.java | 8 ------- .../fop/layoutmgr/LineLayoutManager.java | 1 - .../layoutmgr/StaticContentLayoutManager.java | 2 +- .../fop/layoutmgr/TextLayoutManager.java | 24 ------------------- 11 files changed, 5 insertions(+), 91 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java index bed7187bb..5e3a1fdd1 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -175,25 +175,6 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants return null; } - public KnuthElement addALetterSpaceTo(KnuthElement element) { - log.warn("null implementation of addALetterSpaceTo() called!"); - return element; - } - - public void getWordChars(StringBuffer sbChars, Position bp1, - Position bp2) { - log.warn("null implementation of getWordChars() called!"); - } - - public void hyphenate(Position pos, HyphContext hc) { - log.warn("null implementation of hyphenate called!"); - } - - public boolean applyChanges(List oldList) { - log.warn("null implementation of applyChanges() called!"); - return false; - } - public LinkedList getChangedKnuthElements(List oldList, /*int flaggedPenalty,*/ int alignment) { diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java index d2ec1f82d..9f48f20b6 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java @@ -125,7 +125,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { while (proxyLMiter.hasNext()) { LayoutManager lm = (LayoutManager) proxyLMiter.next(); - if (lm.generatesInlineAreas()) { + if (lm instanceof InlineLevelLayoutManager) { LineLayoutManager lineLM = createLineManager(lm); addChildLM(lineLM); } else { @@ -151,7 +151,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { inlines.add(firstlm); while (proxyLMiter.hasNext()) { LayoutManager lm = (LayoutManager) proxyLMiter.next(); - if (lm.generatesInlineAreas()) { + if (lm instanceof InlineLevelLayoutManager) { inlines.add(lm); } else { proxyLMiter.previous(); diff --git a/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java b/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java index 10180122b..3352dc5c6 100644 --- a/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java @@ -166,24 +166,6 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager { (((org.apache.fop.area.inline.Character) curArea).getChar()); } - public KnuthElement addALetterSpaceTo(KnuthElement element) { - areaInfo.iLScount ++; - areaInfo.ipdArea.add(letterSpaceIPD); - - if (letterSpaceIPD.min == letterSpaceIPD.max) { - // constant letter space, return a new box - return new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead, - areaInfo.total, areaInfo.middle, - new LeafPosition(this, 0), false); - } else { - // adjustable letter space, return a new glue - return new KnuthGlue(letterSpaceIPD.opt, - letterSpaceIPD.max - letterSpaceIPD.opt, - letterSpaceIPD.opt - letterSpaceIPD.min, - new LeafPosition(this, -1), true); - } - } - public void hyphenate(Position pos, HyphContext hc) { if (hc.getNextHyphPoint() == 1) { // the character ends a syllable diff --git a/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java index 2a9fdae6c..c662dbad5 100644 --- a/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java @@ -218,10 +218,6 @@ public class ContentLayoutManager implements InlineLevelLayoutManager { //to be done } - /** @see org.apache.fop.layoutmgr.LayoutManager */ - public void getWordChars(StringBuffer sbChars, Position bp1, - Position bp2) { } - /** * @see org.apache.fop.layoutmgr.LayoutManager#createNextChildLMs */ diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java index a309ac91e..9408d03e8 100644 --- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java @@ -78,7 +78,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager LinkedList returnList = new LinkedList(); while ((curLM = ((BlockLevelLayoutManager) getChildLM())) != null) { - if (curLM.generatesInlineAreas()) { + if (curLM instanceof InlineLevelLayoutManager) { log.error("inline area not allowed under flow - ignoring"); curLM.setFinished(true); continue; diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManager.java b/src/java/org/apache/fop/layoutmgr/LayoutManager.java index 16a8f4e37..1cc40f689 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManager.java @@ -65,18 +65,6 @@ public interface LayoutManager { */ void resetPosition(Position position); - /** - * Get the word chars between two positions and - * append to the string buffer. The positions could - * span multiple layout managers. - * - * @param sbChars the string buffer to append the word chars - * @param bp1 the start position - * @param bp2 the end position - */ - void getWordChars(StringBuffer sbChars, Position bp1, - Position bp2); - /** * 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/LayoutManagerMapping.java b/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java index 85a2e6cc0..abc54efb3 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java @@ -219,7 +219,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker { super.make(node, childList); for (int count = childList.size() - 1; count >= 0; count--) { LayoutManager lm = (LayoutManager) childList.get(count); - if (lm.generatesInlineAreas()) { + if (lm instanceof InlineLevelLayoutManager) { LayoutManager blm = new BidiLayoutManager (node, (InlineLayoutManager) lm); lms.add(blm); diff --git a/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java index 70dde9baf..fc25ea57f 100644 --- a/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java @@ -281,14 +281,6 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { return returnList; } - public KnuthElement addALetterSpaceTo(KnuthElement element) { - // return the unchanged glue object - return new KnuthGlue(areaInfo.ipdArea.opt, - areaInfo.ipdArea.max - areaInfo.ipdArea.opt, - areaInfo.ipdArea.opt - areaInfo.ipdArea.min, - new LeafPosition(this, 0), false); - } - public void hyphenate(Position pos, HyphContext hc) { // use the AbstractLayoutManager.hyphenate() null implementation super.hyphenate(pos, hc); diff --git a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java index a5807ceac..f1063ad25 100644 --- a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java @@ -27,7 +27,6 @@ import org.apache.fop.hyphenation.Hyphenator; import org.apache.fop.area.LineArea; import java.util.ListIterator; -import java.util.Iterator; import java.util.List; import java.util.ArrayList; import java.util.LinkedList; diff --git a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java index 613f17a75..417ad467e 100644 --- a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java @@ -79,7 +79,7 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { LinkedList returnList = new LinkedList(); while ((curLM = ((BlockLevelLayoutManager) getChildLM())) != null) { - if (curLM.generatesInlineAreas()) { + if (curLM instanceof InlineLevelLayoutManager) { log.error("inline area not allowed under flow - ignoring"); curLM.setFinished(true); continue; diff --git a/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java index 2c64e4c4e..df7a218ce 100644 --- a/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java @@ -194,30 +194,6 @@ public class TextLayoutManager extends LeafNodeLayoutManager { return true; } - /** - * Get the word characters between two positions. - * This is used when doing hyphenation or other word manipulations. - * - * @param sbChars the string buffer to put the chars into - * @param bp1 the start position - * @param bp2 the end position - */ - public void getWordChars(StringBuffer sbChars, Position bp1, - Position bp2) { - LeafPosition endPos = (LeafPosition) bp2; - AreaInfo ai = - (AreaInfo) vecAreaInfo.get(endPos.getLeafPos()); - // Skip all leading spaces for hyphenation - int i; - for (i = ai.iStartIndex; - i < ai.iBreakIndex - && CharUtilities.isAnySpace(textArray[i]) == true; - i++) { - //nop - } - sbChars.append(new String(textArray, i, ai.iBreakIndex - i)); - } - /** * Reset position for returning next BreakPossibility. * -- 2.39.5