aboutsummaryrefslogtreecommitdiffstats
path: root/poi/src
diff options
context:
space:
mode:
Diffstat (limited to 'poi/src')
-rw-r--r--poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java8
1 files changed, 5 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 57ee821c5d..6d7bc7f8e0 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
@@ -38,6 +38,7 @@ import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.util.ExceptionUtil;
import org.apache.poi.util.Internal;
@@ -351,12 +352,13 @@ public class SheetUtil {
try {
TextLayout layout = new TextLayout(str.getIterator(), fontRenderContext);
return layout.getAdvance();
- } catch (UnsatisfiedLinkError | NoClassDefFoundError | InternalError e) {
- if (ignoreMissingFontSystem) {
+ } catch (Throwable t) {
+ // fatal exceptions will always be rethrown
+ if (!ExceptionUtil.isFatal(t) && ignoreMissingFontSystem) {
return DEFAULT_CHAR_WIDTH;
}
- throw e;
+ throw t;
}
}