diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2016-03-16 23:30:19 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2016-03-16 23:30:19 +0000 |
commit | 217ae0ea8f195c900c1a8f33cea1ed00d54b5c45 (patch) | |
tree | 32a51ae2822833477c122d2a8cf8202d4c136f41 /src | |
parent | 280cdd46117a466dcfe665324eea2b8e5635855b (diff) | |
download | poi-217ae0ea8f195c900c1a8f33cea1ed00d54b5c45.tar.gz poi-217ae0ea8f195c900c1a8f33cea1ed00d54b5c45.zip |
sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1735345 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
4 files changed, 11 insertions, 11 deletions
diff --git a/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java b/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java index 1d88afb38d..578c3a6799 100644 --- a/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java +++ b/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java @@ -185,7 +185,7 @@ public final class ApacheconEU08 { Dimension dim = ppt.getPageSize(); Rectangle2D oldAnchor = table1.getAnchor(); - table1.setAnchor(new Rectangle2D.Double((dim.width-450)/2, 100, oldAnchor.getWidth(), oldAnchor.getHeight())); + table1.setAnchor(new Rectangle2D.Double((dim.width-450)/2d, 100, oldAnchor.getWidth(), oldAnchor.getHeight())); TextBox<?,?> box1 = slide.createTextBox(); box1.setHorizontalCentered(true); diff --git a/src/java/org/apache/poi/ss/util/ImageUtils.java b/src/java/org/apache/poi/ss/util/ImageUtils.java index 0e7de24eec..991a2efab3 100644 --- a/src/java/org/apache/poi/ss/util/ImageUtils.java +++ b/src/java/org/apache/poi/ss/util/ImageUtils.java @@ -189,7 +189,7 @@ public class ImageUtils { if (isHSSF) {
h *= 1 - anchor.getDy1()/256d;
} else {
- h -= anchor.getDy1()/EMU_PER_PIXEL;
+ h -= anchor.getDy1()/(double)EMU_PER_PIXEL;
}
while(h < scaledHeight){
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java index 582e4e0643..1e10bd6e3f 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java @@ -341,11 +341,11 @@ public class WordToHtmlConverter extends AbstractWordConverter if ( aspectRatioX > 0 ) { - imageWidth = picture.getDxaGoal() * aspectRatioX / 1000 + imageWidth = picture.getDxaGoal() * aspectRatioX / 1000.f / TWIPS_PER_INCH; - cropRight = picture.getDxaCropRight() * aspectRatioX / 1000 + cropRight = picture.getDxaCropRight() * aspectRatioX / 1000.f / TWIPS_PER_INCH; - cropLeft = picture.getDxaCropLeft() * aspectRatioX / 1000 + cropLeft = picture.getDxaCropLeft() * aspectRatioX / 1000.f / TWIPS_PER_INCH; } else @@ -357,11 +357,11 @@ public class WordToHtmlConverter extends AbstractWordConverter if ( aspectRatioY > 0 ) { - imageHeight = picture.getDyaGoal() * aspectRatioY / 1000 + imageHeight = picture.getDyaGoal() * aspectRatioY / 1000.f / TWIPS_PER_INCH; - cropTop = picture.getDyaCropTop() * aspectRatioY / 1000 + cropTop = picture.getDyaCropTop() * aspectRatioY / 1000.f / TWIPS_PER_INCH; - cropBottom = picture.getDyaCropBottom() * aspectRatioY / 1000 + cropBottom = picture.getDyaCropBottom() * aspectRatioY / 1000.f / TWIPS_PER_INCH; } else diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToHtmlConverter.java b/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToHtmlConverter.java index a099b3f499..b1c3fa8b24 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToHtmlConverter.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToHtmlConverter.java @@ -252,11 +252,11 @@ public class TestWordToHtmlConverter // picture assertContains(result, "src=\"0.emf\""); // visible size - assertContains(result, "width:3.1305554in;height:1.7250001in;"); + assertContains(result, "width:3.1293333in;height:1.7247736in;"); // shift due to crop - assertContains(result, "left:-0.09375;top:-0.25694445;"); + assertContains(result, "left:-0.09433333;top:-0.2573611;"); // size without crop - assertContains(result, "width:3.4125in;height:2.325in;"); + assertContains(result, "width:3.4125in;height:2.3253334in;"); } @Test |