]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Add support for "mpt" (millipoints, non-standard!!!)
authorJeremias Maerki <jeremias@apache.org>
Sat, 30 Jul 2005 12:47:31 +0000 (12:47 +0000)
committerJeremias Maerki <jeremias@apache.org>
Sat, 30 Jul 2005 12:47:31 +0000 (12:47 +0000)
Reenabled warning message for unrecognized units. Otherwise, you simply get a zero value and don't know why.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@226500 13f79535-47bb-0310-9956-ffa450edef68

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

index 62852ae06b5bdb16e96dea5e2591b779eb75b141..cba009e57fcf69e8f5c7b6f44ef27139d12c35a0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -68,6 +68,9 @@ public class FixedLength extends LengthProperty {
         } else if (unit.equals("pt")) {
             // Do nothing.
             // dvalue = dvalue;
+        } else if (unit.equals("mpt")) { //mpt is non-standard!!! mpt=millipoints
+            // Do nothing.
+            // dvalue = dvalue;
         } else if (unit.equals("pc")) {
             dvalue = dvalue * 12;
             /*
@@ -78,10 +81,13 @@ public class FixedLength extends LengthProperty {
             dvalue = dvalue * assumedResolution;
         } else {
             dvalue = 0;
-            //log.error("unknown length unit '" + unit
-            //                       + "'");
+            log.error("Unknown length unit '" + unit + "'");
+        }
+        if (unit.equals("mpt")) {
+            millipoints = (int)dvalue;
+        } else {
+            millipoints = (int)(dvalue * 1000);
         }
-        millipoints = (int)(dvalue * 1000);
     }
 
     /**