diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2015-09-30 23:06:39 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2015-09-30 23:06:39 +0000 |
commit | fad6546d8a8172aaf197a95a4af086a387390fbb (patch) | |
tree | cb5dfa581dceb06959b03e825e6a1ea53c22c770 /src/examples | |
parent | 5366f02c2c317bc6ddf65a9c9d9d33136c38bf49 (diff) | |
download | poi-fad6546d8a8172aaf197a95a4af086a387390fbb.tar.gz poi-fad6546d8a8172aaf197a95a4af086a387390fbb.zip |
sonar fixes
Very interesting was the exception swallowing in PackagePropertiesPart. When it was properly thrown, it already led to various errors in the junits test - I've fixed the handling for at least the ones which are in our test set
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1706169 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r-- | src/examples/src/org/apache/poi/hssf/view/SVSheetTable.java | 2 | ||||
-rw-r--r-- | src/examples/src/org/apache/poi/xssf/usermodel/examples/EmbeddedObjects.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/examples/src/org/apache/poi/hssf/view/SVSheetTable.java b/src/examples/src/org/apache/poi/hssf/view/SVSheetTable.java index ed2fd8fb6d..1739eb6160 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVSheetTable.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVSheetTable.java @@ -163,7 +163,7 @@ public class SVSheetTable extends JTable { Row row = sheet.getRow(i - sheet.getFirstRowNum()); if (row != null) { short h = row.getHeight(); - int height = Math.round(Math.max(1, h / (res / 70 * 20) + 3)); + int height = (int)Math.round(Math.max(1., ((double)h) / (((double)res) / 70. * 20.) + 3.)); System.out.printf("%d: %d (%d @ %d)%n", i, height, h, res); setRowHeight(i, height); } diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/EmbeddedObjects.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/EmbeddedObjects.java index 69b570f7d3..3f044c839e 100644 --- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/EmbeddedObjects.java +++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/EmbeddedObjects.java @@ -19,10 +19,10 @@ package org.apache.poi.xssf.usermodel.examples; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackagePart;
+import org.apache.poi.xslf.usermodel.XSLFSlideShow;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.hslf.usermodel.HSLFSlideShowImpl;
import org.apache.poi.hwpf.HWPFDocument;
-import org.apache.poi.xslf.XSLFSlideShow;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import java.io.InputStream;
|