From ab66977cddab31240ab6f132996939bddd243245 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Fri, 25 Jan 2008 12:14:52 +0000 Subject: [PATCH] Improved error tolerance: an enum property value with leading or trailing spaces is still recognized. Example: content-width="scale-to-fit " git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@615197 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/fo/properties/PropertyMaker.java | 4 +- test/fotree/testcases/enum-trim.fo | 37 +++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 test/fotree/testcases/enum-trim.fo diff --git a/src/java/org/apache/fop/fo/properties/PropertyMaker.java b/src/java/org/apache/fop/fo/properties/PropertyMaker.java index 3faf1971e..b1162563d 100644 --- a/src/java/org/apache/fop/fo/properties/PropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/PropertyMaker.java @@ -427,8 +427,8 @@ public class PropertyMaker implements Cloneable { } } } else { - // Check for keyword shorthand values to be substituted. - pvalue = checkValueKeywords(pvalue); + // Check for keyword shorthand values to be substituted. + pvalue = checkValueKeywords(pvalue.trim()); newProp = checkEnumValues(pvalue); } if (newProp == null) { diff --git a/test/fotree/testcases/enum-trim.fo b/test/fotree/testcases/enum-trim.fo new file mode 100644 index 000000000..001243d80 --- /dev/null +++ b/test/fotree/testcases/enum-trim.fo @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + Test font-family parsing + + + + -- 2.39.5