From: Andreas L. Delmelle Date: Thu, 11 Jan 2007 21:03:07 +0000 (+0000) Subject: Code cleanup: X-Git-Tag: fop-0_94~246 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=aa8a93a60863373363fa7f02c11320b91fa688d4;p=xmlgraphics-fop.git Code cleanup: - avoid unnecessary calls to getLogger(); LengthBase gets its own logger, LMs log to the AbstractLM logger - CommonBorderPaddingBackground no longer implements Cloneable (changes suggested by Richard Wheeldon) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@495371 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/datatypes/LengthBase.java b/src/java/org/apache/fop/datatypes/LengthBase.java index 7270344fe..74150ca50 100644 --- a/src/java/org/apache/fop/datatypes/LengthBase.java +++ b/src/java/org/apache/fop/datatypes/LengthBase.java @@ -19,6 +19,8 @@ package org.apache.fop.datatypes; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.fo.Constants; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; @@ -26,6 +28,7 @@ import org.apache.fop.fo.expr.PropertyException; import org.apache.fop.fo.flow.Character; import org.apache.fop.fo.flow.ExternalGraphic; import org.apache.fop.fo.flow.InstreamForeignObject; +import org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager; /** * Models a length which can be used as a factor in a percentage length @@ -60,6 +63,11 @@ public class LengthBase implements PercentBase { /** constant for a alignment adjust percent-based length */ public static final int ALIGNMENT_ADJUST = 12; + /** + * logging instance + */ + protected static Log log = LogFactory.getLog(LengthBase.class); + /** * The FO for which this property is to be calculated. */ @@ -80,7 +88,7 @@ public class LengthBase implements PercentBase { * @param baseType a constant defining the type of teh percent base * @throws PropertyException In case an problem occurs while evaluating values */ - public LengthBase(FObj parentFO, PropertyList plist, int baseType) throws PropertyException { + public LengthBase(PropertyList plist, int baseType) throws PropertyException { this.fobj = plist.getFObj(); this.baseType = baseType; switch (baseType) { @@ -122,7 +130,7 @@ public class LengthBase implements PercentBase { } baseLen = context.getBaseLength(baseType, fobj); } else { - fobj.getLogger().error("getBaseLength called without context"); + log.error("getBaseLength called without context"); } return baseLen; } diff --git a/src/java/org/apache/fop/fo/FOText.java b/src/java/org/apache/fop/fo/FOText.java index f2c4c4e54..2205c0170 100644 --- a/src/java/org/apache/fop/fo/FOText.java +++ b/src/java/org/apache/fop/fo/FOText.java @@ -389,7 +389,7 @@ public class FOText extends FONode { return ca[i]; } default: - getLogger().warn("Invalid text-tranform value: " + textTransform); + log.warn("Invalid text-tranform value: " + textTransform); return ca[i]; } } @@ -624,6 +624,5 @@ public class FOText extends FONode { } else { return new String(ca).trim(); } - } - + } } \ No newline at end of file diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index 0d5b1fe65..53ba255f8 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -314,7 +314,7 @@ public abstract class FObj extends FONode implements Constants { if (node instanceof FObj || (node instanceof FOText && ((FOText) node).willCreateArea())) { - getLogger().error( + log.error( "fo:marker must be an initial child: " + mcname); return; } else if (node instanceof FOText) { @@ -329,7 +329,7 @@ public abstract class FObj extends FONode implements Constants { if (!markers.containsKey(mcname)) { markers.put(mcname, marker); } else { - getLogger().error("fo:marker 'marker-class-name' " + log.error("fo:marker 'marker-class-name' " + "must be unique for same parent: " + mcname); } } @@ -495,7 +495,7 @@ public abstract class FObj extends FONode implements Constants { extensionAttachments = new java.util.ArrayList(); } if (log.isDebugEnabled()) { - getLogger().debug("ExtensionAttachment of category " + log.debug("ExtensionAttachment of category " + attachment.getCategory() + " added to " + getName() + ": " + attachment); } diff --git a/src/java/org/apache/fop/fo/XMLObj.java b/src/java/org/apache/fop/fo/XMLObj.java index 5ce81e7b5..e2b459192 100644 --- a/src/java/org/apache/fop/fo/XMLObj.java +++ b/src/java/org/apache/fop/fo/XMLObj.java @@ -187,7 +187,7 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener { // in theory someone might want to embed some defined // xml (eg. fo) inside the foreign xml // they could use a different namespace - getLogger().debug("Invalid element: " + child.getName() + " inside foreign xml markup"); + log.debug("Invalid element: " + child.getName() + " inside foreign xml markup"); } } diff --git a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java index 39e5fafa2..8a02d21d6 100644 --- a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java +++ b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java @@ -66,7 +66,7 @@ public class LabelEndFunction extends FunctionBase { } Length startIndent = pList.get(Constants.PR_START_INDENT).getLength(); - LengthBase base = new LengthBase(pList.getFObj(), pInfo.getPropertyList(), + LengthBase base = new LengthBase(pInfo.getPropertyList(), LengthBase.CONTAINING_REFAREA_WIDTH); PercentLength refWidth = new PercentLength(1.0, base); diff --git a/src/java/org/apache/fop/fo/expr/PropertyInfo.java b/src/java/org/apache/fop/fo/expr/PropertyInfo.java index 08b95628c..dc104b465 100644 --- a/src/java/org/apache/fop/fo/expr/PropertyInfo.java +++ b/src/java/org/apache/fop/fo/expr/PropertyInfo.java @@ -47,10 +47,10 @@ public class PropertyInfo { * @param plist PropertyList object * @param fo FObj */ - public PropertyInfo(PropertyMaker maker, PropertyList plist, FObj fo) { + public PropertyInfo(PropertyMaker maker, PropertyList plist) { this.maker = maker; this.plist = plist; - this.fo = fo; + this.fo = plist.getParentFObj(); } /** @@ -61,7 +61,7 @@ public class PropertyInfo { */ public PercentBase getPercentBase() throws PropertyException { PercentBase pcbase = getFunctionPercentBase(); - return (pcbase != null) ? pcbase : maker.getPercentBase(fo, plist); + return (pcbase != null) ? pcbase : maker.getPercentBase(plist); } /** diff --git a/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java index 49394ea3c..cb6e69a13 100644 --- a/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java +++ b/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java @@ -64,7 +64,7 @@ public class BatikExtensionElementMapping extends ElementMapping { } protected void initialize() { - if (foObjs == null && batikAvail == true) { + if (foObjs == null && batikAvail) { // this sets the parser that will be used // by default (SVGBrokenLinkProvider) // normally the user agent value is used diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java b/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java index a6958acdb..351327a26 100644 --- a/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java +++ b/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java @@ -101,7 +101,7 @@ public class SVGElement extends SVGObj { //svgdoc.setDocumentURI(baseURL.toString()); } } catch (Exception e) { - getLogger().error("Could not set base URL for svg", e); + log.error("Could not set base URL for svg", e); } Element e = ((SVGDocument)doc).getRootElement(); diff --git a/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java b/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java index c5277323e..39efce2cd 100644 --- a/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java +++ b/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java @@ -97,7 +97,7 @@ public abstract class AbstractListItemPart extends FObj { .append(" is missing child elements. ") .append("Required Content Model: ") .append(contentModel); - getLogger().warn(message.toString()); + log.warn(message.toString()); } } } diff --git a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java index 5925613ba..f31c43abf 100644 --- a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java +++ b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java @@ -67,11 +67,11 @@ public class ExternalGraphic extends AbstractGraphics { ImageFactory fact = userAgent.getFactory().getImageFactory(); FopImage fopimage = fact.getImage(url, userAgent); if (fopimage == null) { - getLogger().error("Image not available: " + getSrc()); + log.error("Image not available: " + getSrc()); } else { // load dimensions if (!fopimage.load(FopImage.DIMENSIONS)) { - getLogger().error("Cannot read image dimensions: " + getSrc()); + log.error("Cannot read image dimensions: " + getSrc()); } this.intrinsicWidth = fopimage.getIntrinsicWidth(); this.intrinsicHeight = fopimage.getIntrinsicHeight(); diff --git a/src/java/org/apache/fop/fo/flow/Float.java b/src/java/org/apache/fop/fo/flow/Float.java index 48ae86471..d68264b64 100644 --- a/src/java/org/apache/fop/fo/flow/Float.java +++ b/src/java/org/apache/fop/fo/flow/Float.java @@ -46,7 +46,7 @@ public class Float extends FObj { super(parent); if (!notImplementedWarningGiven) { - getLogger().warn("fo:float is not yet implemented."); + log.warn("fo:float is not yet implemented."); notImplementedWarningGiven = true; } } diff --git a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java index 790785a6b..43dcd575d 100644 --- a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java +++ b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java @@ -102,7 +102,7 @@ public class InstreamForeignObject extends AbstractGraphics { Point2D csize = new Point2D.Float(-1, -1); intrinsicDimensions = child.getDimension(csize); if (intrinsicDimensions == null) { - getLogger().error("Intrinsic dimensions of " + log.error("Intrinsic dimensions of " + " instream-foreign-object could not be determined"); } } diff --git a/src/java/org/apache/fop/fo/flow/MultiCase.java b/src/java/org/apache/fop/fo/flow/MultiCase.java index 898cf370a..ee87cfdc6 100644 --- a/src/java/org/apache/fop/fo/flow/MultiCase.java +++ b/src/java/org/apache/fop/fo/flow/MultiCase.java @@ -48,7 +48,7 @@ public class MultiCase extends FObj { super(parent); if (!notImplementedWarningGiven) { - getLogger().warn("fo:multi-case is not yet implemented."); + log.warn("fo:multi-case is not yet implemented."); notImplementedWarningGiven = true; } } diff --git a/src/java/org/apache/fop/fo/flow/MultiProperties.java b/src/java/org/apache/fop/fo/flow/MultiProperties.java index 2d94154cd..0443c786f 100644 --- a/src/java/org/apache/fop/fo/flow/MultiProperties.java +++ b/src/java/org/apache/fop/fo/flow/MultiProperties.java @@ -52,7 +52,7 @@ public class MultiProperties extends FObj { super(parent); if (!notImplementedWarningGiven) { - getLogger().warn("fo:multi-properties is not yet implemented."); + log.warn("fo:multi-properties is not yet implemented."); notImplementedWarningGiven = true; } } diff --git a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java index a647af6b1..d15c6b07f 100644 --- a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java +++ b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java @@ -46,7 +46,7 @@ public class MultiPropertySet extends FObj { super(parent); if (!notImplementedWarningGiven) { - getLogger().warn("fo:multi-property-set is not yet implemented."); + log.warn("fo:multi-property-set is not yet implemented."); notImplementedWarningGiven = true; } } diff --git a/src/java/org/apache/fop/fo/flow/MultiSwitch.java b/src/java/org/apache/fop/fo/flow/MultiSwitch.java index 96600daa7..22ba27e9a 100644 --- a/src/java/org/apache/fop/fo/flow/MultiSwitch.java +++ b/src/java/org/apache/fop/fo/flow/MultiSwitch.java @@ -50,7 +50,7 @@ public class MultiSwitch extends FObj { super(parent); if (!notImplementedWarningGiven) { - getLogger().warn("fo:multi-switch is not yet implemented."); + log.warn("fo:multi-switch is not yet implemented."); notImplementedWarningGiven = true; } } diff --git a/src/java/org/apache/fop/fo/flow/MultiToggle.java b/src/java/org/apache/fop/fo/flow/MultiToggle.java index 971e2754d..b8466e073 100644 --- a/src/java/org/apache/fop/fo/flow/MultiToggle.java +++ b/src/java/org/apache/fop/fo/flow/MultiToggle.java @@ -48,7 +48,7 @@ public class MultiToggle extends FObj { super(parent); if (!notImplementedWarningGiven) { - getLogger().warn("fo:multi-toggle is not yet implemented."); + log.warn("fo:multi-toggle is not yet implemented."); notImplementedWarningGiven = true; } } diff --git a/src/java/org/apache/fop/fo/flow/TableAndCaption.java b/src/java/org/apache/fop/fo/flow/TableAndCaption.java index 4e74de8a0..748ee0cb3 100644 --- a/src/java/org/apache/fop/fo/flow/TableAndCaption.java +++ b/src/java/org/apache/fop/fo/flow/TableAndCaption.java @@ -70,7 +70,7 @@ public class TableAndCaption extends FObj { super(parent); if (!notImplementedWarningGiven) { - getLogger().warn("fo:table-and-caption is not yet implemented."); + log.warn("fo:table-and-caption is not yet implemented."); notImplementedWarningGiven = true; } } diff --git a/src/java/org/apache/fop/fo/flow/TableBody.java b/src/java/org/apache/fop/fo/flow/TableBody.java index 570901046..891141c26 100644 --- a/src/java/org/apache/fop/fo/flow/TableBody.java +++ b/src/java/org/apache/fop/fo/flow/TableBody.java @@ -132,7 +132,7 @@ public class TableBody extends TableFObj { if (getUserAgent().validateStrictly()) { missingChildElementError("marker* (table-row+|table-cell+)"); } else { - getLogger().error("fo:table-body must not be empty. " + log.error("fo:table-body must not be empty. " + "Expected: marker* (table-row+|table-cell+)"); getParent().removeChild(this); } diff --git a/src/java/org/apache/fop/fo/flow/TableCaption.java b/src/java/org/apache/fop/fo/flow/TableCaption.java index bb6978bb2..da516060f 100644 --- a/src/java/org/apache/fop/fo/flow/TableCaption.java +++ b/src/java/org/apache/fop/fo/flow/TableCaption.java @@ -68,7 +68,7 @@ public class TableCaption extends FObj { super(parent); if (!notImplementedWarningGiven) { - getLogger().warn("fo:table-caption is not yet implemented."); + log.warn("fo:table-caption is not yet implemented."); notImplementedWarningGiven = true; } } diff --git a/src/java/org/apache/fop/fo/flow/TableCell.java b/src/java/org/apache/fop/fo/flow/TableCell.java index a54144b91..066d6493a 100644 --- a/src/java/org/apache/fop/fo/flow/TableCell.java +++ b/src/java/org/apache/fop/fo/flow/TableCell.java @@ -110,13 +110,13 @@ public class TableCell extends TableFObj { if (getUserAgent().validateStrictly()) { missingChildElementError("marker* (%block;)+"); } else if (childNodes != null && childNodes.size() > 0) { - getLogger().warn("fo:table-cell content that is not " + log.warn("fo:table-cell content that is not " + "enclosed by a fo:block will be dropped/ignored."); } } if ((startsRow() || endsRow()) && getParent().getNameId() == FO_TABLE_ROW ) { - getLogger().warn("starts-row/ends-row for fo:table-cells " + log.warn("starts-row/ends-row for fo:table-cells " + "non-applicable for children of an fo:table-row."); } getFOEventHandler().endCell(this); diff --git a/src/java/org/apache/fop/fo/flow/TableFObj.java b/src/java/org/apache/fop/fo/flow/TableFObj.java index 05877bbf2..65d32b76a 100644 --- a/src/java/org/apache/fop/fo/flow/TableFObj.java +++ b/src/java/org/apache/fop/fo/flow/TableFObj.java @@ -371,7 +371,7 @@ public abstract class TableFObj extends FObj { int columnIndex = p.getNumeric().getValue(); if (columnIndex <= 0) { - fo.getLogger().warn("Specified negative or zero value for " + log.warn("Specified negative or zero value for " + "column-number on " + fo.getName() + ": " + columnIndex + " forced to " + parent.getCurrentColumnIndex()); @@ -381,7 +381,7 @@ public abstract class TableFObj extends FObj { double tmpIndex = p.getNumeric().getNumericValue(); if (tmpIndex - columnIndex > 0.0) { columnIndex = (int) Math.round(tmpIndex); - fo.getLogger().warn("Rounding specified column-number of " + log.warn("Rounding specified column-number of " + tmpIndex + " to " + columnIndex); return new NumberProperty(columnIndex); } diff --git a/src/java/org/apache/fop/fo/pagination/Declarations.java b/src/java/org/apache/fop/fo/pagination/Declarations.java index 4f8273caf..86fa1b3f4 100644 --- a/src/java/org/apache/fop/fo/pagination/Declarations.java +++ b/src/java/org/apache/fop/fo/pagination/Declarations.java @@ -85,10 +85,10 @@ public class Declarations extends FObj { if (!"".equals(cp.getColorProfileName())) { addColorProfile(cp); } else { - getLogger().warn("color-profile-name required for color profile"); + log.warn("color-profile-name required for color profile"); } } else { - getLogger().debug("Ignoring element " + node.getName() + log.debug("Ignoring element " + node.getName() + " inside fo:declarations."); } } @@ -102,7 +102,7 @@ public class Declarations extends FObj { } if (colorProfiles.get(cp.getColorProfileName()) != null) { // duplicate names - getLogger().warn("Duplicate fo:color-profile profile name: " + log.warn("Duplicate fo:color-profile profile name: " + cp.getColorProfileName()); } colorProfiles.put(cp.getColorProfileName(), cp); diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index 386ed694b..1e8f1f52b 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -454,8 +454,8 @@ public class PageSequence extends FObj { return simplePageMaster; } boolean isOddPage = ((page % 2) == 1); - if (getLogger().isDebugEnabled()) { - getLogger().debug("getNextSimplePageMaster(page=" + page + if (log.isDebugEnabled()) { + log.debug("getNextSimplePageMaster(page=" + page + " isOdd=" + isOddPage + " isFirst=" + isFirstPage + " isLast=" + isLastPage diff --git a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java index 56b156012..e48d0dc64 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java @@ -201,7 +201,7 @@ public class PageSequenceMaster extends FObj { + masterName + "', cannot recover"); } - getLogger().warn("subsequences exhausted in page-sequence-master '" + log.warn("subsequences exhausted in page-sequence-master '" + masterName + "', using previous subsequence"); currentSubSequence.reset(); diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java index 9b2c8b2ef..f83bf005f 100644 --- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java +++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java @@ -108,7 +108,7 @@ public class RepeatablePageMasterAlternatives extends FObj } else { int mr = maximumRepeats.getNumeric().getValue(); if (mr < 0) { - getLogger().debug("negative maximum-repeats: " + log.debug("negative maximum-repeats: " + this.maximumRepeats); mr = 0; } diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java index a09b129a3..1f79d317b 100644 --- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java +++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java @@ -111,7 +111,7 @@ public class RepeatablePageMasterReference extends FObj } else { int mr = maximumRepeats.getNumeric().getValue(); if (mr < 0) { - getLogger().debug("negative maximum-repeats: " + log.debug("negative maximum-repeats: " + this.maximumRepeats); mr = 0; } diff --git a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java index 168a3b145..8697cc978 100755 --- a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java +++ b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java @@ -35,7 +35,7 @@ import org.apache.fop.image.ImageFactory; * Stores all common border and padding properties. * See Sec. 7.7 of the XSL-FO Standard. */ -public class CommonBorderPaddingBackground implements Cloneable { +public class CommonBorderPaddingBackground { /** * The "background-attachment" property. */ @@ -79,7 +79,7 @@ public class CommonBorderPaddingBackground implements Cloneable { /** the "end" edge */ public static final int END = 3; - public static class BorderInfo implements Cloneable { + public static class BorderInfo { private int mStyle; // Enum for border style private Color mColor; // Border color private CondLengthProperty mWidth; @@ -166,11 +166,11 @@ public class CommonBorderPaddingBackground implements Cloneable { ImageFactory fact = userAgent.getFactory().getImageFactory(); fopimage = fact.getImage(url, userAgent); if (fopimage == null) { - fobj.getLogger().error("Background image not available: " + backgroundImage); + Property.log.error("Background image not available: " + backgroundImage); } else { // load dimensions if (!fopimage.load(FopImage.DIMENSIONS)) { - fobj.getLogger().error("Cannot read background image dimensions: " + Property.log.error("Cannot read background image dimensions: " + backgroundImage); } } diff --git a/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java b/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java index e6f4ec393..c2eaeedc4 100644 --- a/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java @@ -87,7 +87,7 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker { FObj fo) throws PropertyException { Numeric numval = p.getNumeric(); if (numval != null && numval.getDimension() == 0) { - p = new PercentLength(numval.getNumericValue(), getPercentBase(fo, propertyList)); + p = new PercentLength(numval.getNumericValue(), getPercentBase(propertyList)); Property spaceProp = super.convertProperty(p, propertyList, fo); spaceProp.setSpecifiedValue(String.valueOf(numval.getNumericValue())); return spaceProp; diff --git a/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java b/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java index 8e0ad18ed..b41c3e87b 100644 --- a/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java +++ b/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java @@ -79,13 +79,13 @@ public class PageDimensionMaker extends LengthProperty.Maker { || refOrientation == -270))) { //set page-width to "auto" = use the fallback from FOUserAgent if (propId == Constants.PR_PAGE_WIDTH) { - fo.getLogger().warn("Both page-width and page-height set to " + Property.log.warn("Both page-width and page-height set to " + "\"indefinite\". Forcing page-width to \"auto\""); return make(propertyList, fallbackValue, fo); } } else { //set page-height to "auto" = use fallback from FOUserAgent - fo.getLogger().warn("Both page-width and page-height set to " + Property.log.warn("Both page-width and page-height set to " + "\"indefinite\". Forcing page-height to \"auto\""); if (propId == Constants.PR_PAGE_HEIGHT) { return make(propertyList, fallbackValue, fo); diff --git a/src/java/org/apache/fop/fo/properties/PropertyMaker.java b/src/java/org/apache/fop/fo/properties/PropertyMaker.java index 900e4b79d..a5373ef50 100644 --- a/src/java/org/apache/fop/fo/properties/PropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/PropertyMaker.java @@ -321,11 +321,11 @@ public class PropertyMaker implements Cloneable { * @return an object implementing the PercentBase interface. * @throws PropertyException if there is a problem while evaluating the base property */ - public PercentBase getPercentBase(FObj fo, PropertyList pl) throws PropertyException { + public PercentBase getPercentBase(PropertyList pl) throws PropertyException { if (percentBase == -1) { return null; } else { - return new LengthBase(fo, pl, percentBase); + return new LengthBase(pl, percentBase); } } @@ -436,7 +436,7 @@ public class PropertyMaker implements Cloneable { // Override parsePropertyValue in each subclass of Property.Maker newProp = PropertyParser.parse(pvalue, new PropertyInfo(this, - propertyList, fo)); + propertyList)); } if (newProp != null) { newProp = convertProperty(newProp, propertyList, fo); @@ -501,8 +501,7 @@ public class PropertyMaker implements Cloneable { // Substituted a value: must parse it Property p = PropertyParser.parse(pvalue, new PropertyInfo(this, - propertyList, - fo)); + propertyList)); pret = convertProperty(p, propertyList, fo); } } diff --git a/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java index da566ed91..8d63dc05f 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java @@ -71,7 +71,7 @@ public abstract class AbstractBaseLayoutManager * @see org.apache.fop.datatypes.PercentBaseContext#getBaseLength(int, FObj) */ public int getBaseLength(int lengthBase, FObj fobj) { - if (fobj == getFObj()) { + if (fobj == this.fobj) { switch (lengthBase) { case LengthBase.CONTAINING_BLOCK_WIDTH: return getAncestorBlockAreaIPD(); diff --git a/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java index 2b5bf3fbf..5397d470d 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java @@ -173,7 +173,7 @@ public abstract class AbstractGraphicsLayoutManager extends LeafNodeLayoutManage if (overflow == EN_HIDDEN) { clip = true; } else if (overflow == EN_ERROR_IF_OVERFLOW) { - fobj.getLogger().error("Object overflows the viewport: clipping"); + log.error("Object overflows the viewport: clipping"); clip = true; } } diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java index b730ab0cf..cb693d056 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java @@ -54,7 +54,7 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager /** * logging instance */ - private static Log log = LogFactory.getLog(LeafNodeLayoutManager.class); + protected static Log log = LogFactory.getLog(LeafNodeLayoutManager.class); /** * The inline area that this leafnode will add. diff --git a/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java b/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java index 56644d173..20100fb7d 100755 --- a/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java +++ b/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java @@ -90,7 +90,7 @@ public class FOPRtfAttributes extends RtfAttributes { // noop } - public int getBaseLength(int lengthBase, FObj fobj) { + public int getBaseLength(int lengthBase, FObj fo) { return 0; } }