You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ad...@apache.org on 2007/02/18 10:46:12 UTC
svn commit: r508890 -
/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java
Author: adelmelle
Date: Sun Feb 18 01:46:12 2007
New Revision: 508890
URL: http://svn.apache.org/viewvc?view=rev&rev=508890
Log:
Slight correction: value of "inherit" was not yet handled; delegate to the superclass in that case
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java?view=diff&rev=508890&r1=508889&r2=508890
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java Sun Feb 18 01:46:12 2007
@@ -47,46 +47,50 @@
* org.apache.fop.fo.FObj)
*/
public Property make(PropertyList propertyList, String value, FObj fo) throws PropertyException {
- ListProperty prop = new ListProperty();
- String tmpVal;
- int startIndex = 0;
- int commaIndex = value.indexOf(',');
- int quoteIndex;
- int aposIndex;
- char qChar;
- boolean parsed = false;
- while (!parsed) {
- if (commaIndex == -1) {
- tmpVal = value.substring(startIndex).trim();
- parsed = true;
- } else {
- tmpVal = value.substring(startIndex, commaIndex).trim();
- startIndex = commaIndex + 1;
- commaIndex = value.indexOf(',', startIndex);
- }
- aposIndex = tmpVal.indexOf('\'');
- quoteIndex = tmpVal.indexOf('\"');
- if (aposIndex != -1 || quoteIndex != -1) {
- qChar = (aposIndex == -1) ? '\"' : '\'';
- if (tmpVal.lastIndexOf(qChar) != tmpVal.length() - 1) {
- Property.log.warn("Skipping malformed value for font-family: "
- + tmpVal + " in \"" + value + "\".");
- tmpVal = "";
+ if ("inherit".equals(value)) {
+ return super.make(propertyList, value, fo);
+ } else {
+ ListProperty prop = new ListProperty();
+ String tmpVal;
+ int startIndex = 0;
+ int commaIndex = value.indexOf(',');
+ int quoteIndex;
+ int aposIndex;
+ char qChar;
+ boolean parsed = false;
+ while (!parsed) {
+ if (commaIndex == -1) {
+ tmpVal = value.substring(startIndex).trim();
+ parsed = true;
} else {
- tmpVal = tmpVal.substring(1, tmpVal.length() - 1);
+ tmpVal = value.substring(startIndex, commaIndex).trim();
+ startIndex = commaIndex + 1;
+ commaIndex = value.indexOf(',', startIndex);
}
- }
- if (!"".equals(tmpVal)) {
- int dblSpaceIndex = tmpVal.indexOf(" ");
- while (dblSpaceIndex != -1) {
- tmpVal = tmpVal.substring(0, dblSpaceIndex)
- + tmpVal.substring(dblSpaceIndex + 1);
- dblSpaceIndex = tmpVal.indexOf(" ");
+ aposIndex = tmpVal.indexOf('\'');
+ quoteIndex = tmpVal.indexOf('\"');
+ if (aposIndex != -1 || quoteIndex != -1) {
+ qChar = (aposIndex == -1) ? '\"' : '\'';
+ if (tmpVal.lastIndexOf(qChar) != tmpVal.length() - 1) {
+ log.warn("Skipping malformed value for font-family: "
+ + tmpVal + " in \"" + value + "\".");
+ tmpVal = "";
+ } else {
+ tmpVal = tmpVal.substring(1, tmpVal.length() - 1);
+ }
+ }
+ if (!"".equals(tmpVal)) {
+ int dblSpaceIndex = tmpVal.indexOf(" ");
+ while (dblSpaceIndex != -1) {
+ tmpVal = tmpVal.substring(0, dblSpaceIndex)
+ + tmpVal.substring(dblSpaceIndex + 1);
+ dblSpaceIndex = tmpVal.indexOf(" ");
+ }
+ prop.addProperty(new StringProperty(tmpVal));
}
- prop.addProperty(new StringProperty(tmpVal));
}
+ return prop;
}
- return prop;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org