From: Dominik Stadler Date: Mon, 27 Jul 2015 16:43:14 +0000 (+0000) Subject: Try to adjust the string that we use for canComputeColumnWidht() so it works on freeb... X-Git-Tag: REL_3_13_FINAL~200 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=99f8274bfc38b08921e81bfd738d1658ce9eedca;p=poi.git Try to adjust the string that we use for canComputeColumnWidht() so it works on freebsd/OpenJDK 1.6 as well git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1692911 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/ss/util/SheetUtil.java b/src/java/org/apache/poi/ss/util/SheetUtil.java index cc322293ae..d7edbcb305 100644 --- a/src/java/org/apache/poi/ss/util/SheetUtil.java +++ b/src/java/org/apache/poi/ss/util/SheetUtil.java @@ -246,8 +246,9 @@ public class SheetUtil { * @return true if computing the size for this Font will succeed, false otherwise */ public static boolean canComputeColumnWidht(Font font) { - AttributedString str = new AttributedString("1"); - copyAttributes(font, str, 0, "1".length()); + // not sure what is the best value sample-here, only "1" did not work on some platforms... + AttributedString str = new AttributedString("1w"); + copyAttributes(font, str, 0, "1w".length()); TextLayout layout = new TextLayout(str.getIterator(), fontRenderContext); if(layout.getBounds().getWidth() > 0) {