getFontFaceRules() {
return _fontFaceRules;
}
-
-}// end class
+}
/*
* $Id$
diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/sheet/StylesheetInfo.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/sheet/StylesheetInfo.java
index 13fa54efc..0ebbb2b29 100644
--- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/sheet/StylesheetInfo.java
+++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/sheet/StylesheetInfo.java
@@ -21,12 +21,13 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
/**
* A reference to a stylesheet. If no stylesheet is set, the matcher will try to
- * find the stylesheet by uri, first from the StylesheetFactory cache, then by
+ * find the stylesheet by uri, first from the StylesheetFactory, then by
* loading the uri if it is not cached.
*
* Therefore, either a stylesheet must be set, or a uri must be set
@@ -37,19 +38,12 @@
*/
public class StylesheetInfo {
- /** Description of the Field */
private Stylesheet stylesheet = null;//just to be able to attach "dummy" stylesheets. Also might save a lookup if it's already looked up
- /** Description of the Field */
private String title;
- /** Description of the Field */
private String uri;
- /** Description of the Field */
private int origin = USER_AGENT;
- /** Description of the Field */
private String type;
-
- private List mediaTypes = new ArrayList();
-
+ private List mediaTypes = new ArrayList();
private String content;
/** Origin of stylesheet - user agent */
@@ -67,8 +61,8 @@ public class StylesheetInfo {
* @return true if the stylesheet referenced applies to the medium
*/
public boolean appliesToMedia(String m) {
- return m.toLowerCase().equals("all") ||
- mediaTypes.contains("all") || mediaTypes.contains(m.toLowerCase());
+ return m.toLowerCase(Locale.US).equals("all") ||
+ mediaTypes.contains("all") || mediaTypes.contains(m.toLowerCase(Locale.US));
}
/**
@@ -76,7 +70,7 @@ public boolean appliesToMedia(String m) {
*
* @param uri The new uri value
*/
- public void setUri( String uri ) {
+ public void setUri(String uri) {
this.uri = uri;
}
@@ -85,16 +79,16 @@ public void setUri( String uri ) {
*
* @param media The new media value
*/
- public void setMedia( String media ) {
+ public void setMedia(String media) {
String[] mediaTypes = media.split(",");
- List l = new ArrayList(mediaTypes.length);
+ this.mediaTypes.clear();
+
for (int i = 0; i < mediaTypes.length; i++) {
- l.add(mediaTypes[i].trim().toLowerCase());
+ this.mediaTypes.add(mediaTypes[i].trim().toLowerCase(Locale.US));
}
- this.mediaTypes = l;
}
- public void setMedia(List mediaTypes) {
+ public void setMedia(List mediaTypes) {
this.mediaTypes = mediaTypes;
}
@@ -152,7 +146,7 @@ public String getUri() {
*
* @return The media value
*/
- public List getMedia() {
+ public List getMedia() {
return mediaTypes;
}