From f9e3b1618b874262f2e37afb724e6fe52b639889 Mon Sep 17 00:00:00 2001 From: Finn Bock Date: Sun, 10 Oct 2004 21:05:21 +0000 Subject: [PATCH] Added helper method getWMPropertyList(). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198031 13f79535-47bb-0310-9956-ffa450edef68 --- .../CorrespondingPropertyMaker.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java index 9d0292668..6bc38585f 100644 --- a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java @@ -74,9 +74,7 @@ public class CorrespondingPropertyMaker { return false; } - PropertyList pList = (useParent) ? propertyList.getParentPropertyList() : - propertyList; - + PropertyList pList = getWMPropertyList(propertyList); int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl); if (pList.getExplicit(correspondingId) != null) { @@ -97,14 +95,9 @@ public class CorrespondingPropertyMaker { * @throws FOPException for invalid or inconsistent FO input */ public Property compute(PropertyList propertyList) throws FOPException { - PropertyList pList; - if (useParent) { - pList = propertyList.getParentPropertyList(); - if (pList == null) { - return null; - } - } else { - pList = propertyList; + PropertyList pList = getWMPropertyList(propertyList); + if (pList == null) { + return null; } int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl); @@ -115,5 +108,17 @@ public class CorrespondingPropertyMaker { } return p; } + + /** + * Return the property list to use for fetching writing mode depending property + * ids. + */ + protected PropertyList getWMPropertyList(PropertyList pList) { + if (useParent) { + return pList.getParentPropertyList(); + } else { + return pList; + } + } } -- 2.39.5