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
This commit is contained in:
Dominik Stadler 2015-07-27 16:43:14 +00:00
parent 6db0a1057d
commit 99f8274bfc
1 changed files with 3 additions and 2 deletions

View File

@ -246,8 +246,9 @@ public class SheetUtil {
* @return true if computing the size for this Font will succeed, false otherwise * @return true if computing the size for this Font will succeed, false otherwise
*/ */
public static boolean canComputeColumnWidht(Font font) { public static boolean canComputeColumnWidht(Font font) {
AttributedString str = new AttributedString("1"); // not sure what is the best value sample-here, only "1" did not work on some platforms...
copyAttributes(font, str, 0, "1".length()); AttributedString str = new AttributedString("1w");
copyAttributes(font, str, 0, "1w".length());
TextLayout layout = new TextLayout(str.getIterator(), fontRenderContext); TextLayout layout = new TextLayout(str.getIterator(), fontRenderContext);
if(layout.getBounds().getWidth() > 0) { if(layout.getBounds().getWidth() > 0) {