From 7560a4eb47b80a95b10f6a07bda88128f0c30335 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Wed, 22 Jul 2015 15:26:41 +0000 Subject: [PATCH] Still more checks to track down why canComputeColumnWidth() returns true, but width is still returned 0 on freebsd... git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1692289 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/ss/usermodel/BaseTestBugzillaIssues.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java index e94a4d025..40ef329ed 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java @@ -373,13 +373,13 @@ public abstract class BaseTestBugzillaIssues { double widthBeforeCol = SheetUtil.getColumnWidth(sheet, 0, false); assertTrue("Expected to have cell width > 0 when computing manually, but had " + widthManual + "/" + widthBeforeCell + "/" + widthBeforeCol + "/" + - SheetUtil.canComputeColumnWidht(font) + "/" + computeCellWidthFixed(cell0, font, "1") + "/" + computeCellWidthFixed(cell0, font, longValue), + SheetUtil.canComputeColumnWidht(font) + "/" + computeCellWidthFixed(cell0, font, "1") + "/" + computeCellWidthFixed(cell0, font, "0000") + "/" + computeCellWidthFixed(cell0, font, longValue), widthManual > 0); assertTrue("Expected to have cell width > 0 BEFORE auto-size, but had " + widthManual + "/" + widthBeforeCell + "/" + widthBeforeCol + "/" + - SheetUtil.canComputeColumnWidht(font) + "/" + computeCellWidthFixed(cell0, font, "1") + "/" + computeCellWidthFixed(cell0, font, longValue), + SheetUtil.canComputeColumnWidht(font) + "/" + computeCellWidthFixed(cell0, font, "1") + "/" + computeCellWidthFixed(cell0, font, "0000") + "/" + computeCellWidthFixed(cell0, font, longValue), widthBeforeCell > 0); assertTrue("Expected to have column width > 0 BEFORE auto-size, but had " + widthManual + "/" + widthBeforeCell + "/" + widthBeforeCol + "/" + - SheetUtil.canComputeColumnWidht(font) + "/" + computeCellWidthFixed(cell0, font, "1") + "/" + computeCellWidthFixed(cell0, font, longValue), + SheetUtil.canComputeColumnWidht(font) + "/" + computeCellWidthFixed(cell0, font, "1") + "/" + computeCellWidthFixed(cell0, font, "0000") + "/" + computeCellWidthFixed(cell0, font, longValue), widthBeforeCol > 0); sheet.autoSizeColumn(0); @@ -417,7 +417,7 @@ public abstract class BaseTestBugzillaIssues { copyAttributes(font, str, 0, txt.length()); TextLayout layout = new TextLayout(str.getIterator(), fontRenderContext); - return ((layout.getBounds().getWidth() / 1) / 8); + return layout.getBounds().getWidth(); } private static void copyAttributes(Font font, AttributedString str, int startIdx, int endIdx) {