diff options
author | Adrian Cumiskey <acumiskey@apache.org> | 2008-06-10 09:52:27 +0000 |
---|---|---|
committer | Adrian Cumiskey <acumiskey@apache.org> | 2008-06-10 09:52:27 +0000 |
commit | f25d75a80cbb96a31e6d5b5a4da9d5e95d164cd8 (patch) | |
tree | 3fe2757c31e0f63f2004a0a5281b19f243a30ae4 /src/java/org/apache/fop/layoutmgr/inline | |
parent | 07ee324b35a7a7bf5d7cb8f704a0a2b62a89df5d (diff) | |
download | xmlgraphics-fop-f25d75a80cbb96a31e6d5b5a4da9d5e95d164cd8.tar.gz xmlgraphics-fop-f25d75a80cbb96a31e6d5b5a4da9d5e95d164cd8.zip |
Merged revisions 665740,665793,665995 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk
........
r665740 | adelmelle | 2008-06-09 17:20:08 +0100 (Mon, 09 Jun 2008) | 1 line
Minor update: make the codegen-unicode target create LineBreakUtils.java at the appropriate place in the source tree
........
r665793 | adelmelle | 2008-06-09 18:27:51 +0100 (Mon, 09 Jun 2008) | 9 lines
Some updates (improvements?) in the UAX#14-related files:
- LineBreakPairTable.txt: replace tabs with spaces to make the file a bit easier to read (constant column-width, instead of depending on an editor's settings for tabs)
- GenerateLineBreakUtils.java:
- generate a public final utility class
- add some spacing in the generated file, after commas and before/after '=' (same styling as manually created files)
- use Java 1.4 String.split() to tokenize lines, instead of StringTokenizer
- add javadoc comments for public constants and methods
- LineBreakUtils.java: regenerated after the above updates
........
r665995 | maxberger | 2008-06-10 08:52:36 +0100 (Tue, 10 Jun 2008) | 1 line
Replaced getLast() calls with calls to listUtil
........
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@666048 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/inline')
-rwxr-xr-x | src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java | 14 | ||||
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java | 5 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java index 123259cd4..d0874d626 100755 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java @@ -56,6 +56,7 @@ import org.apache.fop.layoutmgr.SpaceSpecifier; import org.apache.fop.layoutmgr.TraitSetter; import org.apache.fop.traits.MinOptMax; import org.apache.fop.traits.SpaceVal; +import org.apache.fop.util.ListUtil; /** * LayoutManager for objects which stack children in the inline direction, @@ -312,11 +313,11 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { // get KnuthElements from curLM returnedList = curLM.getNextKnuthElements(childLC, alignment); - if (returnList.size() == 0 && childLC.isKeepWithPreviousPending()) { + if (returnList.isEmpty() && childLC.isKeepWithPreviousPending()) { childLC.clearKeepWithPreviousPending(); } if (returnedList == null - || returnedList.size() == 0) { + || returnedList.isEmpty()) { // curLM returned null or an empty list, because it finished; // just iterate once more to see if there is another child continue; @@ -335,7 +336,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { returnedList.remove(0); } // add border and padding to the first complete sequence of this LM - if (!borderAdded && returnedList.size() != 0) { + if (!borderAdded && !returnedList.isEmpty()) { addKnuthElementsForBorderPaddingStart((KnuthSequence) returnedList.get(0)); borderAdded = true; } @@ -367,8 +368,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { context.updateKeepWithNextPending(childLC.getKeepWithNextPending()); childLC.clearKeepsPending(); } - lastSequence = (KnuthSequence) returnList - .get(returnList.size() - 1); + lastSequence = (KnuthSequence) ListUtil.getLast(returnList); lastChildLM = curLM; } @@ -379,7 +379,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { setFinished(true); log.trace(trace); - if (returnList.size() == 0) { + if (returnList.isEmpty()) { /* * if the FO itself is empty, but has an id specified * or associated fo:markers, then we still need a dummy @@ -396,7 +396,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { } } - return returnList.size() == 0 ? null : returnList; + return returnList.isEmpty() ? null : returnList; } /** diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java index eec2b1e91..575728f0d 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java @@ -46,6 +46,7 @@ import org.apache.fop.text.linebreak.LineBreakStatus; import org.apache.fop.traits.MinOptMax; import org.apache.fop.traits.SpaceVal; import org.apache.fop.util.CharUtilities; +import org.apache.fop.util.ListUtil; /** * LayoutManager for text (a sequence of characters) which generates one @@ -624,9 +625,9 @@ public class TextLayoutManager extends LeafNodeLayoutManager { sequence = this.processLinebreak(returnList, sequence); } - if (((List) returnList.get(returnList.size() - 1)).isEmpty()) { + if (((List) ListUtil.getLast(returnList)).isEmpty()) { //Remove an empty sequence because of a trailing newline - returnList.remove(returnList.size() - 1); + ListUtil.removeLast(returnList); } this.setFinished(true); |