gmazza 2003/12/28 09:10:17 Modified: src/java/org/apache/fop/area Block.java src/java/org/apache/fop/fo/flow BasicLink.java ExternalGraphic.java InstreamForeignObject.java Leader.java ListBlock.java ListItem.java PageNumber.java PageNumberCitation.java RetrieveMarker.java Table.java TableBody.java TableCell.java TableColumn.java src/java/org/apache/fop/fo/pagination ColorProfile.java ConditionalPageMasterReference.java PageSequence.java Region.java RegionBA.java RegionBASE.java SimplePageMaster.java Title.java src/java/org/apache/fop/layoutmgr BlockContainerLayoutManager.java Log: Conversion of more properties from Strings to ints. Revision Changes Path 1.2 +13 -1 xml-fop/src/java/org/apache/fop/area/Block.java Index: Block.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/Block.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Block.java 11 Mar 2003 13:05:27 -0000 1.1 +++ Block.java 28 Dec 2003 17:10:16 -0000 1.2 @@ -93,10 +93,22 @@ * @param block the block area to add */ public void addBlock(Block block) { + addBlock(block, true); + } + + /** + * Add the block to this block area. + * + * @param block the block area to add + * @param autoHeight increase the height of the block. + */ + public void addBlock(Block block, boolean autoHeight) { if (children == null) { children = new ArrayList(); } - height += block.getHeight(); + if (autoHeight) { + height += block.getHeight(); + } children.add(block); } 1.8 +2 -2 xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java Index: BasicLink.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/BasicLink.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- BasicLink.java 20 Dec 2003 06:53:22 -0000 1.7 +++ BasicLink.java 28 Dec 2003 17:10:16 -0000 1.8 @@ -102,10 +102,10 @@ // this.propertyList.get("baseline-shift"); // this.propertyList.get("destination-place-offset"); // this.propertyList.get("dominant-baseline"); - String ext = propertyList.get("external-destination").getString(); + String ext = propertyList.get(PR_EXTERNAL_DESTINATION).getString(); setupID(); // this.propertyList.get("indicate-destination"); - String internal = propertyList.get("internal-destination").getString(); + String internal = propertyList.get(PR_INTERNAL_DESTINATION).getString(); if (ext.length() > 0) { link = ext; external = true; 1.14 +11 -11 xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java Index: ExternalGraphic.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ExternalGraphic.java 27 Dec 2003 20:40:04 -0000 1.13 +++ ExternalGraphic.java 28 Dec 2003 17:10:16 -0000 1.14 @@ -102,27 +102,27 @@ * This gets the sizes for the image and the dimensions and clipping. */ public void setup() { - url = this.propertyList.get("src").getString(); + url = this.propertyList.get(PR_SRC).getString(); if (url == null) { return; } url = ImageFactory.getURL(url); // assume lr-tb for now - Length ipd = propertyList.get("inline-progression-dimension.optimum").getLength(); + Length ipd = propertyList.get(PR_INLINE_PROGRESSION_DIMENSION).getLength(); if (!ipd.isAuto()) { viewWidth = ipd.getValue(); } else { - ipd = propertyList.get("width").getLength(); + ipd = propertyList.get(PR_WIDTH).getLength(); if (!ipd.isAuto()) { viewWidth = ipd.getValue(); } } - Length bpd = propertyList.get("block-progression-dimension.optimum").getLength(); + Length bpd = propertyList.get(PR_BLOCK_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength(); if (!bpd.isAuto()) { viewHeight = bpd.getValue(); } else { - bpd = propertyList.get("height").getLength(); + bpd = propertyList.get(PR_HEIGHT).getLength(); if (!bpd.isAuto()) { viewHeight = bpd.getValue(); } @@ -133,7 +133,7 @@ int cwidth = -1; int cheight = -1; - Length ch = propertyList.get("content-height").getLength(); + Length ch = propertyList.get(PR_CONTENT_HEIGHT).getLength(); if (!ch.isAuto()) { /*if (ch.scaleToFit()) { if (viewHeight != -1) { @@ -142,7 +142,7 @@ } else {*/ cheight = ch.getValue(); } - Length cw = propertyList.get("content-width").getLength(); + Length cw = propertyList.get(PR_CONTENT_WIDTH).getLength(); if (!cw.isAuto()) { /*if (cw.scaleToFit()) { if (viewWidth != -1) { @@ -152,7 +152,7 @@ cwidth = cw.getValue(); } - int scaling = propertyList.get("scaling").getEnum(); + int scaling = propertyList.get(PR_SCALING).getEnum(); if ((scaling == Scaling.UNIFORM) || (cwidth == -1) || cheight == -1) { ImageFactory fact = ImageFactory.getInstance(); fopimage = fact.getImage(url, getUserAgent()); @@ -195,7 +195,7 @@ } if (cwidth > viewWidth || cheight > viewHeight) { - int overflow = propertyList.get("overflow").getEnum(); + int overflow = propertyList.get(PR_OVERFLOW).getEnum(); if (overflow == Overflow.HIDDEN) { clip = true; } else if (overflow == Overflow.ERROR_IF_OVERFLOW) { @@ -207,7 +207,7 @@ int xoffset = 0; int yoffset = 0; - int da = propertyList.get("display-align").getEnum(); + int da = propertyList.get(PR_DISPLAY_ALIGN).getEnum(); switch(da) { case DisplayAlign.BEFORE: break; @@ -222,7 +222,7 @@ break; } - int ta = propertyList.get("text-align").getEnum(); + int ta = propertyList.get(PR_TEXT_ALIGN).getEnum(); switch(ta) { case TextAlign.CENTER: xoffset = (viewWidth - cwidth) / 2; 1.11 +2 -2 xml-fop/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java Index: InstreamForeignObject.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- InstreamForeignObject.java 20 Dec 2003 06:53:22 -0000 1.10 +++ InstreamForeignObject.java 28 Dec 2003 17:10:16 -0000 1.11 @@ -74,7 +74,7 @@ public int computeXOffset (int ipd, int cwidth) { int xoffset = 0; - int ta = propertyList.get("text-align").getEnum(); + int ta = propertyList.get(PR_TEXT_ALIGN).getEnum(); switch (ta) { case TextAlign.CENTER: xoffset = (ipd - cwidth) / 2; @@ -93,7 +93,7 @@ public int computeYOffset(int bpd, int cheight) { int yoffset = 0; - int da = propertyList.get("display-align").getEnum(); + int da = propertyList.get(PR_DISPLAY_ALIGN).getEnum(); switch (da) { case DisplayAlign.BEFORE: break; 1.17 +5 -5 xml-fop/src/java/org/apache/fop/fo/flow/Leader.java Index: Leader.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Leader.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Leader.java 20 Dec 2003 06:53:22 -0000 1.16 +++ Leader.java 28 Dec 2003 17:10:17 -0000 1.17 @@ -130,14 +130,14 @@ // this.propertyList.get("z-index"); // color properties - ColorType c = this.propertyList.get("color").getColorType(); + ColorType c = this.propertyList.get(PR_COLOR).getColorType(); float red = c.getRed(); float green = c.getGreen(); float blue = c.getBlue(); // fo:leader specific properties // determines the pattern of leader; allowed values: space, rule,dots, use-content - leaderPattern = this.propertyList.get("leader-pattern").getEnum(); + leaderPattern = this.propertyList.get(PR_LEADER_PATTERN).getEnum(); switch(leaderPattern) { case LeaderPattern.SPACE: // use Space @@ -146,8 +146,8 @@ // the following properties only apply // for leader-pattern = "rule" ruleThickness = - propertyList.get("rule-thickness").getLength().getValue(); - ruleStyle = propertyList.get("rule-style").getEnum(); + propertyList.get(PR_RULE_THICKNESS).getLength().getValue(); + ruleStyle = propertyList.get(PR_RULE_STYLE).getEnum(); break; case LeaderPattern.DOTS: break; @@ -159,7 +159,7 @@ // if leaderPatternWidth = 0 = default = use-font-metric patternWidth = - this.propertyList.get("leader-pattern-width").getLength().getValue(); + this.propertyList.get(PR_LEADER_PATTERN_WIDTH).getLength().getValue(); } 1.9 +8 -8 xml-fop/src/java/org/apache/fop/fo/flow/ListBlock.java Index: ListBlock.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ListBlock.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- ListBlock.java 20 Dec 2003 06:53:22 -0000 1.8 +++ ListBlock.java 28 Dec 2003 17:10:17 -0000 1.9 @@ -118,21 +118,21 @@ // this.propertyList.get("provisional-distance-between-starts"); // this.propertyList.get("provisional-label-separation"); - this.align = this.propertyList.get("text-align").getEnum(); - this.alignLast = this.propertyList.get("text-align-last").getEnum(); + this.align = this.propertyList.get(PR_TEXT_ALIGN).getEnum(); + this.alignLast = this.propertyList.get(PR_TEXT_ALIGN_LAST).getEnum(); this.lineHeight = - this.propertyList.get("line-height").getLength().getValue(); + this.propertyList.get(PR_LINE_HEIGHT).getLength().getValue(); this.startIndent = - this.propertyList.get("start-indent").getLength().getValue(); + this.propertyList.get(PR_START_INDENT).getLength().getValue(); this.endIndent = - this.propertyList.get("end-indent").getLength().getValue(); + this.propertyList.get(PR_END_INDENT).getLength().getValue(); this.spaceBefore = - this.propertyList.get("space-before.optimum").getLength().getValue(); + this.propertyList.get(PR_SPACE_BEFORE | CP_OPTIMUM).getLength().getValue(); this.spaceAfter = - this.propertyList.get("space-after.optimum").getLength().getValue(); + this.propertyList.get(PR_SPACE_AFTER | CP_OPTIMUM).getLength().getValue(); this.spaceBetweenListRows = 0; // not used at present this.backgroundColor = - this.propertyList.get("background-color").getColorType(); + this.propertyList.get(PR_BACKGROUND_COLOR).getColorType(); } 1.10 +5 -5 xml-fop/src/java/org/apache/fop/fo/flow/ListItem.java Index: ListItem.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ListItem.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ListItem.java 20 Dec 2003 06:53:22 -0000 1.9 +++ ListItem.java 28 Dec 2003 17:10:17 -0000 1.10 @@ -117,14 +117,14 @@ // this.propertyList.get("keep-with-previous"); // this.propertyList.get("relative-align"); - this.align = this.propertyList.get("text-align").getEnum(); - this.alignLast = this.propertyList.get("text-align-last").getEnum(); + this.align = this.propertyList.get(PR_TEXT_ALIGN).getEnum(); + this.alignLast = this.propertyList.get(PR_TEXT_ALIGN_LAST).getEnum(); this.lineHeight = - this.propertyList.get("line-height").getLength().getValue(); + this.propertyList.get(PR_LINE_HEIGHT).getLength().getValue(); this.spaceBefore = - this.propertyList.get("space-before.optimum").getLength().getValue(); + this.propertyList.get(PR_SPACE_BEFORE | CP_OPTIMUM).getLength().getValue(); this.spaceAfter = - this.propertyList.get("space-after.optimum").getLength().getValue(); + this.propertyList.get(PR_SPACE_AFTER | CP_OPTIMUM).getLength().getValue(); } 1.18 +2 -2 xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java Index: PageNumber.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- PageNumber.java 20 Dec 2003 06:53:22 -0000 1.17 +++ PageNumber.java 28 Dec 2003 17:10:17 -0000 1.18 @@ -125,12 +125,12 @@ // this.propertyList.get("text-transform"); // this.propertyList.get("word-spacing"); - ColorType c = this.propertyList.get("color").getColorType(); + ColorType c = this.propertyList.get(PR_COLOR).getColorType(); this.red = c.getRed(); this.green = c.getGreen(); this.blue = c.getBlue(); - this.wrapOption = this.propertyList.get("wrap-option").getEnum(); + this.wrapOption = this.propertyList.get(PR_WRAP_OPTION).getEnum(); } 1.19 +3 -3 xml-fop/src/java/org/apache/fop/fo/flow/PageNumberCitation.java Index: PageNumberCitation.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumberCitation.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- PageNumberCitation.java 20 Dec 2003 06:53:22 -0000 1.18 +++ PageNumberCitation.java 28 Dec 2003 17:10:17 -0000 1.19 @@ -140,13 +140,13 @@ // this.propertyList.get("text-transform"); // this.propertyList.get("word-spacing"); - ColorType c = this.propertyList.get("color").getColorType(); + ColorType c = this.propertyList.get(PR_COLOR).getColorType(); this.red = c.getRed(); this.green = c.getGreen(); this.blue = c.getBlue(); - this.wrapOption = this.propertyList.get("wrap-option").getEnum(); - this.refId = this.propertyList.get("ref-id").getString(); + this.wrapOption = this.propertyList.get(PR_WRAP_OPTION).getEnum(); + this.refId = this.propertyList.get(PR_REF_ID).getString(); if (this.refId.equals("")) { //throw new FOPException("page-number-citation must contain \"ref-id\""); 1.6 +3 -3 xml-fop/src/java/org/apache/fop/fo/flow/RetrieveMarker.java Index: RetrieveMarker.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/RetrieveMarker.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- RetrieveMarker.java 20 Dec 2003 06:53:22 -0000 1.5 +++ RetrieveMarker.java 28 Dec 2003 17:10:17 -0000 1.6 @@ -85,11 +85,11 @@ public void handleAttrs(Attributes attlist) throws FOPException { super.handleAttrs(attlist); this.retrieveClassName = - this.propertyList.get("retrieve-class-name").getString(); + this.propertyList.get(PR_RETRIEVE_CLASS_NAME).getString(); this.retrievePosition = - this.propertyList.get("retrieve-position").getEnum(); + this.propertyList.get(PR_RETRIEVE_POSITION).getEnum(); this.retrieveBoundary = - this.propertyList.get("retrieve-boundary").getEnum(); + this.propertyList.get(PR_RETRIEVE_BOUNDARY).getEnum(); } public String getRetrieveClassName() { 1.10 +10 -10 xml-fop/src/java/org/apache/fop/fo/flow/Table.java Index: Table.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Table.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Table.java 20 Dec 2003 06:53:22 -0000 1.9 +++ Table.java 28 Dec 2003 17:10:17 -0000 1.10 @@ -169,25 +169,25 @@ // this.propertyList.get("width"); // this.propertyList.get("writing-mode"); - this.breakBefore = this.propertyList.get("break-before").getEnum(); - this.breakAfter = this.propertyList.get("break-after").getEnum(); + this.breakBefore = this.propertyList.get(PR_BREAK_BEFORE).getEnum(); + this.breakAfter = this.propertyList.get(PR_BREAK_AFTER).getEnum(); this.spaceBefore = this.propertyList.get( - "space-before.optimum").getLength().getValue(); + PR_SPACE_BEFORE | CP_OPTIMUM).getLength().getValue(); this.spaceAfter = this.propertyList.get( - "space-after.optimum").getLength().getValue(); + PR_SPACE_AFTER | CP_OPTIMUM).getLength().getValue(); this.backgroundColor = - this.propertyList.get("background-color").getColorType(); + this.propertyList.get(PR_BACKGROUND_COLOR).getColorType(); this.ipd = this.propertyList.get( - "inline-progression-dimension").getLengthRange(); - this.height = this.propertyList.get("height").getLength().getValue(); + PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); + this.height = this.propertyList.get(PR_HEIGHT).getLength().getValue(); this.bAutoLayout = (this.propertyList.get( - "table-layout").getEnum() == TableLayout.AUTO); + PR_TABLE_LAYOUT).getEnum() == TableLayout.AUTO); this.omitHeaderAtBreak = this.propertyList.get( - "table-omit-header-at-break").getEnum() + PR_TABLE_OMIT_HEADER_AT_BREAK).getEnum() == TableOmitHeaderAtBreak.TRUE; this.omitFooterAtBreak = this.propertyList.get( - "table-omit-footer-at-break").getEnum() + PR_TABLE_OMIT_FOOTER_AT_BREAK).getEnum() == TableOmitFooterAtBreak.TRUE; } 1.9 +3 -3 xml-fop/src/java/org/apache/fop/fo/flow/TableBody.java Index: TableBody.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableBody.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- TableBody.java 20 Dec 2003 06:53:22 -0000 1.8 +++ TableBody.java 28 Dec 2003 17:10:17 -0000 1.9 @@ -101,11 +101,11 @@ setupID(); this.spaceBefore = this.propertyList.get( - "space-before.optimum").getLength().getValue(); + PR_SPACE_BEFORE | CP_OPTIMUM).getLength().getValue(); this.spaceAfter = this.propertyList.get( - "space-after.optimum").getLength().getValue(); + PR_SPACE_AFTER | CP_OPTIMUM).getLength().getValue(); this.backgroundColor = - this.propertyList.get("background-color").getColorType(); + this.propertyList.get(PR_BACKGROUND_COLOR).getColorType(); } 1.10 +10 -10 xml-fop/src/java/org/apache/fop/fo/flow/TableCell.java Index: TableCell.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableCell.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- TableCell.java 20 Dec 2003 06:53:22 -0000 1.9 +++ TableCell.java 28 Dec 2003 17:10:17 -0000 1.10 @@ -233,41 +233,41 @@ // this.propertyList.get("width"); this.iColNumber = - propertyList.get("column-number").getNumber().intValue(); + propertyList.get(PR_COLUMN_NUMBER).getNumber().intValue(); if (iColNumber < 0) { iColNumber = 0; } this.numColumnsSpanned = - this.propertyList.get("number-columns-spanned").getNumber().intValue(); + this.propertyList.get(PR_NUMBER_COLUMNS_SPANNED).getNumber().intValue(); if (numColumnsSpanned < 1) { numColumnsSpanned = 1; } this.numRowsSpanned = - this.propertyList.get("number-rows-spanned").getNumber().intValue(); + this.propertyList.get(PR_NUMBER_ROWS_SPANNED).getNumber().intValue(); if (numRowsSpanned < 1) { numRowsSpanned = 1; } this.backgroundColor = - this.propertyList.get("background-color").getColorType(); + this.propertyList.get(PR_BACKGROUND_COLOR).getColorType(); - bSepBorders = (this.propertyList.get("border-collapse").getEnum() + bSepBorders = (this.propertyList.get(PR_BORDER_COLLAPSE).getEnum() == BorderCollapse.SEPARATE); calcBorders(propMgr.getBorderAndPadding()); // Vertical cell alignment - verticalAlign = this.propertyList.get("display-align").getEnum(); + verticalAlign = this.propertyList.get(PR_DISPLAY_ALIGN).getEnum(); if (verticalAlign == DisplayAlign.AUTO) { // Depends on all cells starting in row bRelativeAlign = true; - verticalAlign = this.propertyList.get("relative-align").getEnum(); + verticalAlign = this.propertyList.get(PR_RELATIVE_ALIGN).getEnum(); } else { bRelativeAlign = false; // Align on a per-cell basis } this.minCellHeight = - this.propertyList.get("height").getLength().getValue(); + this.propertyList.get(PR_HEIGHT).getLength().getValue(); } /** @@ -285,7 +285,7 @@ * but it inherits. */ int iSep = propertyList.get( - "border-separation.inline-progression-direction").getLength().getValue(); + PR_BORDER_SEPARATION | CP_INLINE_PROGRESSION_DIRECTION).getLength().getValue(); this.startAdjust = iSep / 2 + bp.getBorderStartWidth(false) + bp.getPaddingStart(false); @@ -295,7 +295,7 @@ // Offset of content rectangle in the block-progression direction borderSeparation = propertyList.get( - "border-separation.block-progression-direction").getLength().getValue(); + PR_BORDER_SEPARATION | CP_BLOCK_PROGRESSION_DIRECTION).getLength().getValue(); this.beforeOffset = borderSeparation / 2 + bp.getBorderBeforeWidth(false) + bp.getPaddingBefore(false); 1.11 +5 -5 xml-fop/src/java/org/apache/fop/fo/flow/TableColumn.java Index: TableColumn.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableColumn.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- TableColumn.java 20 Dec 2003 06:53:22 -0000 1.10 +++ TableColumn.java 28 Dec 2003 17:10:17 -0000 1.11 @@ -138,17 +138,17 @@ // this.propertyList.get("number-columns-spanned"); // this.propertyList.get("visibility"); - iColumnNumber = propertyList.get("column-number").getNumber().intValue(); + iColumnNumber = propertyList.get(PR_COLUMN_NUMBER).getNumber().intValue(); numColumnsRepeated = - propertyList.get("number-columns-repeated").getNumber().intValue(); + propertyList.get(PR_NUMBER_COLUMNS_REPEATED).getNumber().intValue(); this.backgroundColor = - this.propertyList.get("background-color").getColorType(); + this.propertyList.get(PR_BACKGROUND_COLOR).getColorType(); - Property prop = this.propertyList.get("column-width"); + Property prop = this.propertyList.get(PR_COLUMN_WIDTH); if (prop != null) { - columnWidthPropVal = propertyList.get("column-width").getLength(); + columnWidthPropVal = propertyList.get(PR_COLUMN_WIDTH).getLength(); // This won't include resolved table-units or % values yet. columnWidth = columnWidthPropVal.getValue(); 1.6 +4 -4 xml-fop/src/java/org/apache/fop/fo/pagination/ColorProfile.java Index: ColorProfile.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/ColorProfile.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ColorProfile.java 20 Dec 2003 06:53:23 -0000 1.5 +++ ColorProfile.java 28 Dec 2003 17:10:17 -0000 1.6 @@ -86,9 +86,9 @@ * object. */ public void end() { - src = this.propertyList.get("src").getString(); - profileName = this.propertyList.get("color-profile-name").getString(); - intent = this.propertyList.get("rendering-intent").getEnum(); + src = this.propertyList.get(PR_SRC).getString(); + profileName = this.propertyList.get(PR_COLOR_PROFILE_NAME).getString(); + intent = this.propertyList.get(PR_RENDERING_INTENT).getEnum(); this.propertyList = null; } 1.5 +5 -5 xml-fop/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java Index: ConditionalPageMasterReference.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ConditionalPageMasterReference.java 20 Dec 2003 06:53:23 -0000 1.4 +++ ConditionalPageMasterReference.java 28 Dec 2003 17:10:17 -0000 1.5 @@ -98,9 +98,9 @@ validateParent(parent); - this.pagePosition = this.propertyList.get("page-position").getEnum(); - this.oddOrEven = this.propertyList.get("odd-or-even").getEnum(); - this.blankOrNotBlank = this.propertyList.get("blank-or-not-blank").getEnum(); + this.pagePosition = this.propertyList.get(PR_PAGE_POSITION).getEnum(); + this.oddOrEven = this.propertyList.get(PR_ODD_OR_EVEN).getEnum(); + this.blankOrNotBlank = this.propertyList.get(PR_BLANK_OR_NOT_BLANK).getEnum(); } /** @@ -136,7 +136,7 @@ if (pagePosition == PagePosition.REST) { return false; } else if (pagePosition == PagePosition.LAST) { - // how the hell do you know at this point? + // ?? how can one know at this point? getLogger().debug("LAST PagePosition NYI"); return false; } @@ -144,7 +144,7 @@ if (pagePosition == PagePosition.FIRST) { return false; } else if (pagePosition == PagePosition.LAST) { - // how the hell do you know at this point? + // ?? how can one know at this point? getLogger().debug("LAST PagePosition NYI"); // potentially valid, don't return } 1.17 +7 -7 xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java Index: PageSequence.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- PageSequence.java 20 Dec 2003 06:53:23 -0000 1.16 +++ PageSequence.java 28 Dec 2003 17:10:17 -0000 1.17 @@ -189,7 +189,7 @@ // we are now on the first page of the page sequence thisIsFirstPage = true; - ipnValue = this.propertyList.get("initial-page-number").getString(); + ipnValue = this.propertyList.get(PR_INITIAL_PAGE_NUMBER).getString(); if (ipnValue.equals("auto")) { pageNumberType = AUTO; @@ -209,7 +209,7 @@ } - String masterName = this.propertyList.get("master-reference").getString(); + String masterName = this.propertyList.get(PR_MASTER_REFERENCE).getString(); this.simplePageMaster = this.layoutMasterSet.getSimplePageMaster(masterName); if (this.simplePageMaster == null) { @@ -224,14 +224,14 @@ // get the 'format' properties this.pageNumberGenerator = - new PageNumberGenerator(this.propertyList.get("format").getString(), - this.propertyList.get("grouping-separator").getCharacter(), - this.propertyList.get("grouping-size").getNumber().intValue(), - this.propertyList.get("letter-value").getEnum()); + new PageNumberGenerator(this.propertyList.get(PR_FORMAT).getString(), + this.propertyList.get(PR_GROUPING_SEPARATOR).getCharacter(), + this.propertyList.get(PR_GROUPING_SIZE).getNumber().intValue(), + this.propertyList.get(PR_LETTER_VALUE).getEnum()); this.pageNumberGenerator.enableLogging(getLogger()); this.forcePageCount = - this.propertyList.get("force-page-count").getEnum(); + this.propertyList.get(PR_FORCE_PAGE_COUNT).getEnum(); // this.propertyList.get("country"); // this.propertyList.get("language"); 1.15 +2 -2 xml-fop/src/java/org/apache/fop/fo/pagination/Region.java Index: Region.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Region.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Region.java 20 Dec 2003 06:53:23 -0000 1.14 +++ Region.java 28 Dec 2003 17:10:17 -0000 1.15 @@ -133,11 +133,11 @@ + "of simple-page-master, not " + parent.getName()); } - this.wm = this.propertyList.get("writing-mode").getEnum(); + this.wm = this.propertyList.get(PR_WRITING_MODE).getEnum(); // this.propertyList.get("clip"); // this.propertyList.get("display-align"); - this.overflow = this.propertyList.get("overflow").getEnum(); + this.overflow = this.propertyList.get(PR_OVERFLOW).getEnum(); } public abstract Rectangle getViewportRectangle(FODimension pageRefRect); 1.5 +1 -1 xml-fop/src/java/org/apache/fop/fo/pagination/RegionBA.java Index: RegionBA.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionBA.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RegionBA.java 20 Dec 2003 06:53:23 -0000 1.4 +++ RegionBA.java 28 Dec 2003 17:10:17 -0000 1.5 @@ -86,7 +86,7 @@ public void end() { super.end(); bPrecedence = - (this.propertyList.get("precedence").getEnum() == Precedence.TRUE); + (this.propertyList.get(PR_PRECEDENCE).getEnum() == Precedence.TRUE); } /** 1.5 +1 -1 xml-fop/src/java/org/apache/fop/fo/pagination/RegionBASE.java Index: RegionBASE.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionBASE.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RegionBASE.java 20 Dec 2003 06:53:23 -0000 1.4 +++ RegionBASE.java 28 Dec 2003 17:10:17 -0000 1.5 @@ -74,7 +74,7 @@ public void end() { // The problem with this is that it might not be known yet.... // Supposing extent is calculated in terms of percentage - this.extent = this.propertyList.get("extent").getLength().getValue(); + this.extent = this.propertyList.get(PR_EXTENT).getLength().getValue(); } /** 1.13 +1 -1 xml-fop/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java Index: SimplePageMaster.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- SimplePageMaster.java 20 Dec 2003 06:53:23 -0000 1.12 +++ SimplePageMaster.java 28 Dec 2003 17:10:17 -0000 1.13 @@ -92,7 +92,7 @@ if (parent.getName().equals("fo:layout-master-set")) { LayoutMasterSet layoutMasterSet = (LayoutMasterSet)parent; - masterName = this.propertyList.get("master-name").getString(); + masterName = this.propertyList.get(PR_MASTER_NAME).getString(); if (masterName == null) { getLogger().warn("simple-page-master does not have " + "a master-name and so is being ignored"); 1.12 +7 -7 xml-fop/src/java/org/apache/fop/fo/pagination/Title.java Index: Title.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Title.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Title.java 20 Dec 2003 06:53:23 -0000 1.11 +++ Title.java 28 Dec 2003 17:10:17 -0000 1.12 @@ -97,18 +97,18 @@ CommonMarginInline mProps = propMgr.getMarginInlineProps(); Property prop; - prop = this.propertyList.get("baseline-shift"); + prop = this.propertyList.get(PR_BASELINE_SHIFT); if (prop instanceof LengthProperty) { Length bShift = prop.getLength(); } else if (prop instanceof EnumProperty) { int bShift = prop.getEnum(); } - ColorType col = this.propertyList.get("color").getColorType(); - Length lHeight = this.propertyList.get("line-height").getLength(); + ColorType col = this.propertyList.get(PR_COLOR).getColorType(); + Length lHeight = this.propertyList.get(PR_LINE_HEIGHT).getLength(); int lShiftAdj = this.propertyList.get( - "line-height-shift-adjustment").getEnum(); - int vis = this.propertyList.get("visibility").getEnum(); - Length zIndex = this.propertyList.get("z-index").getLength(); + PR_LINE_HEIGHT_SHIFT_ADJUSTMENT).getEnum(); + int vis = this.propertyList.get(PR_VISIBILITY).getEnum(); + Length zIndex = this.propertyList.get(PR_Z_INDEX).getLength(); } 1.9 +43 -5 xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java Index: BlockContainerLayoutManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- BlockContainerLayoutManager.java 20 Dec 2003 06:53:23 -0000 1.8 +++ BlockContainerLayoutManager.java 28 Dec 2003 17:10:17 -0000 1.9 @@ -63,6 +63,7 @@ import org.apache.fop.fo.PropertyList; import org.apache.fop.area.CTM; import org.apache.fop.datatypes.FODimension; +import org.apache.fop.datatypes.Length; import org.apache.fop.traits.MinOptMax; /** @@ -81,6 +82,8 @@ private boolean clip = false; private int overflow; private PropertyManager propManager; + private Length width; + private Length height; /** * Create a new block container layout manager. @@ -104,6 +107,8 @@ absoluteCTM = CTM.getCTMandRelDims(pm.getAbsRefOrient(), pm.getWritingMode(), rect, relDims); } + height = pm.getPropertyList().get("height").getLength(); + width = pm.getPropertyList().get("width").getLength(); } protected int getRotatedIPD() { @@ -120,15 +125,21 @@ return getAbsoluteBreakPoss(context); } - Rectangle2D rect = new Rectangle2D.Double(0, 0, context.getRefIPD(), - context.getStackLimit().opt); + int ipd = context.getRefIPD(); + int bpd = context.getStackLimit().opt; + if (!width.isAuto()) { + ipd = width.getValue(); + } + if (!height.isAuto()) { + bpd = height.getValue(); + } + Rectangle2D rect = new Rectangle2D.Double(0, 0, ipd, bpd); relDims = new FODimension(0, 0); absoluteCTM = CTM.getCTMandRelDims(propManager.getAbsRefOrient(), propManager.getWritingMode(), rect, relDims); double[] vals = absoluteCTM.toArray(); MinOptMax stackLimit; - int ipd = context.getRefIPD(); boolean rotated = vals[0] == 0.0; if (rotated) { // rotated 90 degrees @@ -160,6 +171,7 @@ stackSize)); childLC.setRefIPD(ipd); + boolean over = false; while (!curLM.isFinished()) { if ((bp = curLM.getNextBreakPoss(childLC)) != null) { stackSize.add(bp.getStackingSize()); @@ -170,11 +182,17 @@ } else { curLM.resetPosition(null); } + over = true; break; } lastPos = bp; childBreaks.add(bp); + if (bp.nextBreakOverflows()) { + over = true; + break; + } + childLC.setStackLimit(MinOptMax.subtract( stackLimit, stackSize)); } @@ -184,6 +202,9 @@ breakPoss = new BreakPoss(new LeafPosition(this, childBreaks.size() - 1)); breakPoss.setStackingSize(stackSize); + if (over) { + breakPoss.setFlag(BreakPoss.NEXT_OVERFLOWS, true); + } return breakPoss; } } @@ -281,6 +302,11 @@ public Area getParentArea(Area childArea) { if (curBlockArea == null) { viewportBlockArea = new BlockViewport(); + TraitSetter.addBorders(viewportBlockArea, + propManager.getBorderAndPadding()); + TraitSetter.addBackground(viewportBlockArea, + propManager.getBackgroundProps()); + if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) { viewportBlockArea.setXOffset(abProps.left); viewportBlockArea.setYOffset(abProps.top); @@ -304,11 +330,15 @@ viewportBlockArea.setWidth(relDims.bpd); viewportBlockArea.setCTM(absoluteCTM); viewportBlockArea.setClip(clip); + } else { + viewportBlockArea.setWidth(relDims.ipd); + if (!height.isAuto()) { + viewportBlockArea.setHeight(relDims.bpd); + } } } curBlockArea = new Block(); - viewportBlockArea.addBlock(curBlockArea); if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) { viewportBlockArea.setPositioning(Block.ABSOLUTE); @@ -332,7 +362,7 @@ */ public void addChild(Area childArea) { if (curBlockArea != null) { - curBlockArea.addBlock((Block) childArea); + curBlockArea.addBlock((Block) childArea, height.isAuto()); } } @@ -342,5 +372,13 @@ } } + /* + * Force current area to be added to parent area. + */ + protected void flush() { + super.flush(); + viewportBlockArea.addBlock(curBlockArea); + } + }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]