aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2024-09-12 21:16:34 +0000
committerPJ Fanning <fanningpj@apache.org>2024-09-12 21:16:34 +0000
commit5fd1f28b4b886cc7c3024a22c1ecd516ece584e5 (patch)
tree34e6c59acef149c1bda5cb454c0056e74b4f06ec
parentd2866dae2440d8a4aba25e60285bb90004f88dc1 (diff)
downloadpoi-5fd1f28b4b886cc7c3024a22c1ecd516ece584e5.tar.gz
poi-5fd1f28b4b886cc7c3024a22c1ecd516ece584e5.zip
[bug-69209] default ignoreMissingFontSystem to true
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1920600 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java b/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java
index f90d229895..a6ea07893a 100644
--- a/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java
+++ b/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java
@@ -100,10 +100,10 @@ public class SheetUtil {
/**
* A system property which can be enabled to not fail when the
- * font-system is not available on the current machine
+ * font-system is not available on the current machine.
+ * Since POI 5.3.1, this flag is enabled by default.
*/
- private static boolean ignoreMissingFontSystem =
- Boolean.parseBoolean(System.getProperty("org.apache.poi.ss.ignoreMissingFontSystem"));
+ private static boolean ignoreMissingFontSystem = initIgnoreMissingFontSystemFlag();
/**
* Which default char-width to use if the font-system is unavailable.
@@ -507,4 +507,12 @@ public class SheetUtil {
protected static void setFontRenderContext(FontRenderContext fontRenderContext) {
SheetUtil.fontRenderContext = fontRenderContext;
}
+
+ private static boolean initIgnoreMissingFontSystemFlag() {
+ final String flag = System.getProperty("org.apache.poi.ss.ignoreMissingFontSystem");
+ if (flag != null) {
+ return !flag.trim().equalsIgnoreCase("false");
+ }
+ return true;
+ }
}