mirror of https://github.com/apache/poi.git
forbidden apis fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1700063 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
78c3f6f51c
commit
a9f220d154
|
@ -20,6 +20,7 @@ package org.apache.poi.sl.draw;
|
|||
import java.awt.Graphics2D;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.poi.sl.usermodel.PlaceableShape;
|
||||
import org.apache.poi.sl.usermodel.Shape;
|
||||
|
@ -72,7 +73,7 @@ public class DrawShape implements Drawable {
|
|||
// and later on, turn it around again to compare it with its original size ...
|
||||
|
||||
AffineTransform txs;
|
||||
if (ps.getClass().getCanonicalName().toLowerCase().contains("hslf")) {
|
||||
if (ps.getClass().getCanonicalName().toLowerCase(Locale.ROOT).contains("hslf")) {
|
||||
txs = new AffineTransform(tx);
|
||||
} else {
|
||||
// this handling is only based on try and error ... not sure why xslf is handled differently.
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
package org.apache.poi.sl.usermodel;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum AutoNumberingScheme {
|
||||
/** Lowercase alphabetic character enclosed in parentheses. Example: (a), (b), (c), ... */
|
||||
alphaLcParenBoth(0x0008, 1),
|
||||
|
@ -177,7 +179,7 @@ public enum AutoNumberingScheme {
|
|||
}
|
||||
|
||||
private String formatSeperator(String cased) {
|
||||
String name = name().toLowerCase();
|
||||
String name = name().toLowerCase(Locale.ROOT);
|
||||
if (name.contains("plain")) return cased;
|
||||
if (name.contains("parenright")) return cased+")";
|
||||
if (name.contains("parenboth")) return "("+cased+")";
|
||||
|
@ -187,9 +189,9 @@ public enum AutoNumberingScheme {
|
|||
}
|
||||
|
||||
private String formatCase(String index) {
|
||||
String name = name().toLowerCase();
|
||||
if (name.contains("lc")) return index.toLowerCase();
|
||||
if (name.contains("uc")) return index.toUpperCase();
|
||||
String name = name().toLowerCase(Locale.ROOT);
|
||||
if (name.contains("lc")) return index.toLowerCase(Locale.ROOT);
|
||||
if (name.contains("uc")) return index.toUpperCase(Locale.ROOT);
|
||||
return index;
|
||||
}
|
||||
|
||||
|
@ -203,7 +205,7 @@ public enum AutoNumberingScheme {
|
|||
"\u2776\u2777\u2778\u2779\u277A\u277B\u277C\u277D\u277E";
|
||||
|
||||
private String formatIndex(int value) {
|
||||
String name = name().toLowerCase();
|
||||
String name = name().toLowerCase(Locale.ROOT);
|
||||
if (name.startsWith("roman")) {
|
||||
return formatRomanIndex(value);
|
||||
} else if (name.startsWith("arabic") && !name.contains("db")) {
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
==================================================================== */
|
||||
package org.apache.poi.util;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class JvmBugs {
|
||||
private static final POILogger LOG = POILogFactory.getLogger(JvmBugs.class);
|
||||
|
||||
|
@ -42,7 +44,7 @@ public class JvmBugs {
|
|||
*/
|
||||
public static boolean hasLineBreakMeasurerBug() {
|
||||
String version = System.getProperty("java.version");
|
||||
String os = System.getProperty("os.name").toLowerCase();
|
||||
String os = System.getProperty("os.name").toLowerCase(Locale.ROOT);
|
||||
boolean ignore = Boolean.getBoolean("org.apache.poi.JvmBugs.LineBreakMeasurer.ignore");
|
||||
boolean hasBug = (!ignore && (os.contains("win") && ("1.6.0_45".equals(version) || "1.7.0_21".equals(version))));
|
||||
if (hasBug) {
|
||||
|
|
Loading…
Reference in New Issue