]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added helper method getWMPropertyList().
authorFinn Bock <bckfnn@apache.org>
Sun, 10 Oct 2004 21:05:21 +0000 (21:05 +0000)
committerFinn Bock <bckfnn@apache.org>
Sun, 10 Oct 2004 21:05:21 +0000 (21:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198031 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java

index 9d0292668a854ad8304ef5b0135cf3f888ade2d3..6bc38585f09d930cad48a2b05a9a20ecc01d6767 100644 (file)
@@ -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;
+        }
+    }
 }