poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1692911 - /poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java
Date Mon, 27 Jul 2015 16:43:14 GMT
Author: centic
Date: Mon Jul 27 16:43:14 2015
New Revision: 1692911

URL: http://svn.apache.org/r1692911
Log:
Try to adjust the string that we use for canComputeColumnWidht() so it works on freebsd/OpenJDK
1.6 as well

Modified:
    poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java

Modified: poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java?rev=1692911&r1=1692910&r2=1692911&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java Mon Jul 27 16:43:14 2015
@@ -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) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message