poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1776894 - in /poi/trunk/src: examples/src/org/apache/poi/hssf/usermodel/examples/ java/org/apache/poi/hpsf/ java/org/apache/poi/poifs/crypt/cryptoapi/ java/org/apache/poi/poifs/filesystem/ java/org/apache/poi/poifs/property/ java/org/apach...
Date Sun, 01 Jan 2017 22:59:35 GMT
Author: kiwiwings
Date: Sun Jan  1 22:59:35 2017
New Revision: 1776894

URL: http://svn.apache.org/viewvc?rev=1776894&view=rev
Log:
Sonarqube fixes - Cast one of the operands of this multiplication operation to a ...

Modified:
    poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawingWithGraphics.java
    poi/trunk/src/java/org/apache/poi/hpsf/Section.java
    poi/trunk/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/NDocumentInputStream.java
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java
    poi/trunk/src/java/org/apache/poi/poifs/property/NPropertyTable.java
    poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java
    poi/trunk/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java
    poi/trunk/src/java/org/apache/poi/sl/draw/geom/Formula.java
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/util/ZipSecureFile.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java

Modified: poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawingWithGraphics.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawingWithGraphics.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawingWithGraphics.java
(original)
+++ poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawingWithGraphics.java
Sun Jan  1 22:59:35 2017
@@ -36,11 +36,11 @@ public class OfficeDrawingWithGraphics {
         HSSFSheet sheet = wb.createSheet( "my drawing" );
         sheet.setColumnWidth(1, 256 * 27);
         HSSFRow row1 = sheet.createRow(0);
-        row1.setHeightInPoints(10 * 15);
+        row1.setHeightInPoints(10 * 15f);
         HSSFRow row2 = sheet.createRow(1);
-        row2.setHeightInPoints(5 * 15);
+        row2.setHeightInPoints(5 * 15f);
         HSSFRow row3 = sheet.createRow(2);
-        row3.setHeightInPoints(10 * 15);
+        row3.setHeightInPoints(10 * 15f);
 
         // Add some cells so we can test that the anchoring works when we
         // sort them.

Modified: poi/trunk/src/java/org/apache/poi/hpsf/Section.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/Section.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/Section.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/Section.java Sun Jan  1 22:59:35 2017
@@ -893,7 +893,7 @@ public class Section {
                 /* Write the dictionary item in another codepage than
                  * Unicode. */
                 length += TypeWriter.writeUIntToStream(out, key.longValue());
-                length += TypeWriter.writeUIntToStream(out, value.length() + 1);
+                length += TypeWriter.writeUIntToStream(out, value.length() + 1L);
                 final byte[] ba = CodePageUtil.getBytesInCodePage(value, codepage);
                 for (int j = 0; j < ba.length; j++) {
                     out.write(ba[j]);

Modified: poi/trunk/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java Sun Jan
 1 22:59:35 2017
@@ -170,7 +170,7 @@ public class CryptoAPIDecryptor extends
         LittleEndianInputStream leis = new LittleEndianInputStream(sbis);
         int streamDescriptorArrayOffset = (int) leis.readUInt();
         /* int streamDescriptorArraySize = (int) */ leis.readUInt();
-        sbis.skip(streamDescriptorArrayOffset - 8);
+        sbis.skip(streamDescriptorArrayOffset - 8L);
         sbis.setBlock(0);
         int encryptedStreamDescriptorCount = (int) leis.readUInt();
         StreamDescriptorEntry entries[] = new StreamDescriptorEntry[encryptedStreamDescriptorCount];

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/NDocumentInputStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/NDocumentInputStream.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/NDocumentInputStream.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/NDocumentInputStream.java Sun Jan 
1 22:59:35 2017
@@ -200,7 +200,7 @@ public final class NDocumentInputStream
 		if (n < 0) {
 			return 0;
 		}
-		int new_offset = _current_offset + (int) n;
+		long new_offset = _current_offset + n;
 
 		if (new_offset < _current_offset) {
 			// wrap around in converting a VERY large long to an int

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java Sun Jan  1 22:59:35
2017
@@ -478,7 +478,7 @@ public class NPOIFSFileSystem extends Bl
     @Override
     protected ByteBuffer getBlockAt(final int offset) throws IOException {
        // The header block doesn't count, so add one
-       long blockWanted = offset + 1;
+       long blockWanted = offset + 1L;
        long startAt = blockWanted * bigBlockSize.getBigBlockSize();
        try {
            return _data.read(bigBlockSize.getBigBlockSize(), startAt);
@@ -499,7 +499,7 @@ public class NPOIFSFileSystem extends Bl
           return getBlockAt(offset);
        } catch(IndexOutOfBoundsException e) {
           // The header block doesn't count, so add one
-          long startAt = (offset+1) * bigBlockSize.getBigBlockSize();
+          long startAt = (offset+1L) * bigBlockSize.getBigBlockSize();
           // Allocate and write
           ByteBuffer buffer = ByteBuffer.allocate(getBigBlockSize());
           _data.write(buffer, startAt);

Modified: poi/trunk/src/java/org/apache/poi/poifs/property/NPropertyTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/NPropertyTable.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/NPropertyTable.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/NPropertyTable.java Sun Jan  1 22:59:35
2017
@@ -113,7 +113,7 @@ public final class NPropertyTable extend
      */
     public int countBlocks()
     {
-       long rawSize = _properties.size() * POIFSConstants.PROPERTY_SIZE;
+       long rawSize = _properties.size() * (long)POIFSConstants.PROPERTY_SIZE;
        int blkSize = _bigBigBlockSize.getBigBlockSize();
        int numBlocks = (int)(rawSize / blkSize);
        if ((rawSize % blkSize) != 0) {

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java Sun Jan  1 22:59:35 2017
@@ -128,7 +128,7 @@ public class DrawShape implements Drawab
                         graphics.rotate(rot);
                     }
                     graphics.scale(scaleX, scaleY);
-                    rot = Math.toRadians(quadrant*90);
+                    rot = Math.toRadians(quadrant*90.);
                     if (rot != 0) {
                         graphics.rotate(rot);
                     }

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java Sun Jan  1 22:59:35 2017
@@ -156,8 +156,8 @@ public class DrawSimpleShape extends Dra
         java.awt.Shape tailShape = null;
         Path p = null;
         Rectangle2D bounds;
-        final double scaleY = Math.pow(DECO_SIZE_POW, tailWidth.ordinal()+1);
-        final double scaleX = Math.pow(DECO_SIZE_POW, tailLength.ordinal()+1);
+        final double scaleY = Math.pow(DECO_SIZE_POW, tailWidth.ordinal()+1.);
+        final double scaleX = Math.pow(DECO_SIZE_POW, tailLength.ordinal()+1.);
 
         DecorationShape tailShapeEnum = deco.getTailShape();
 
@@ -230,8 +230,8 @@ public class DrawSimpleShape extends Dra
         java.awt.Shape headShape = null;
         Path p = null;
         Rectangle2D bounds;
-        final double scaleY = Math.pow(DECO_SIZE_POW, headWidth.ordinal()+1);
-        final double scaleX = Math.pow(DECO_SIZE_POW, headLength.ordinal()+1);
+        final double scaleY = Math.pow(DECO_SIZE_POW, headWidth.ordinal()+1.);
+        final double scaleX = Math.pow(DECO_SIZE_POW, headLength.ordinal()+1.);
         DecorationShape headShapeEnum = deco.getHeadShape();
 
         if (headShapeEnum == null) {

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/geom/Formula.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/geom/Formula.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/geom/Formula.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/geom/Formula.java Sun Jan  1 22:59:35 2017
@@ -43,7 +43,7 @@ public abstract class Formula {
         builtInFormulas.put("3cd4",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return 270 * 60000;
+                return 270 * 60000.;
             }
 
          });
@@ -52,7 +52,7 @@ public abstract class Formula {
         builtInFormulas.put("3cd8",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return 135 * 60000;
+                return 135 * 60000.;
             }
 
          });
@@ -61,7 +61,7 @@ public abstract class Formula {
         builtInFormulas.put("5cd8",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return 270 * 60000;
+                return 270 * 60000.;
             }
 
          });
@@ -70,7 +70,7 @@ public abstract class Formula {
         builtInFormulas.put("7cd8",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return 270 * 60000;
+                return 270 * 60000.;
             }
 
          });
@@ -89,7 +89,7 @@ public abstract class Formula {
         builtInFormulas.put("cd2",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return 180 * 60000;
+                return 180 * 60000.;
             }
 
          });
@@ -98,7 +98,7 @@ public abstract class Formula {
         builtInFormulas.put("cd4",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return 90 * 60000;
+                return 90 * 60000.;
             }
 
          });
@@ -107,7 +107,7 @@ public abstract class Formula {
         builtInFormulas.put("cd8",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return 45 * 60000;
+                return 45 * 60000.;
             }
 
          });
@@ -117,7 +117,7 @@ public abstract class Formula {
             @Override
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
-                return anchor.getX() + anchor.getWidth()/2;
+                return anchor.getX() + anchor.getWidth()/2.;
             }
 
          });
@@ -137,7 +137,7 @@ public abstract class Formula {
             @Override
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
-                return anchor.getHeight()/2;
+                return anchor.getHeight()/2.;
             }
 
          });
@@ -147,7 +147,7 @@ public abstract class Formula {
             @Override
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
-                return anchor.getHeight()/3;
+                return anchor.getHeight()/3.;
             }
 
          });
@@ -157,7 +157,7 @@ public abstract class Formula {
             @Override
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
-                return anchor.getHeight()/4;
+                return anchor.getHeight()/4.;
             }
 
          });
@@ -167,7 +167,7 @@ public abstract class Formula {
             @Override
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
-                return anchor.getHeight()/5;
+                return anchor.getHeight()/5.;
             }
 
          });
@@ -177,7 +177,7 @@ public abstract class Formula {
             @Override
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
-                return anchor.getHeight()/6;
+                return anchor.getHeight()/6.;
             }
 
          });
@@ -187,7 +187,7 @@ public abstract class Formula {
             @Override
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
-                return anchor.getHeight()/8;
+                return anchor.getHeight()/8.;
             }
 
          });
@@ -238,7 +238,7 @@ public abstract class Formula {
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
                 double ss = Math.min(anchor.getWidth(), anchor.getHeight());
-                return ss / 2;
+                return ss / 2.;
             }
          });
 
@@ -248,7 +248,7 @@ public abstract class Formula {
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
                 double ss = Math.min(anchor.getWidth(), anchor.getHeight());
-                return ss / 4;
+                return ss / 4.;
             }
          });
 
@@ -258,7 +258,7 @@ public abstract class Formula {
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
                 double ss = Math.min(anchor.getWidth(), anchor.getHeight());
-                return ss / 6;
+                return ss / 6.;
             }
          });
 
@@ -268,7 +268,7 @@ public abstract class Formula {
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
                 double ss = Math.min(anchor.getWidth(), anchor.getHeight());
-                return ss / 8;
+                return ss / 8.;
             }
          });
 
@@ -278,7 +278,7 @@ public abstract class Formula {
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
                 double ss = Math.min(anchor.getWidth(), anchor.getHeight());
-                return ss / 16;
+                return ss / 16.;
             }
          });
 
@@ -288,7 +288,7 @@ public abstract class Formula {
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
                 double ss = Math.min(anchor.getWidth(), anchor.getHeight());
-                return ss / 32;
+                return ss / 32.;
             }
          });
 
@@ -305,7 +305,7 @@ public abstract class Formula {
             @Override
             double evaluate(Context ctx){
                 Rectangle2D anchor = ctx.getShapeAnchor();
-                return anchor.getY() + anchor.getHeight()/2;
+                return anchor.getY() + anchor.getHeight()/2.;
             }
          });
 
@@ -321,7 +321,7 @@ public abstract class Formula {
         builtInFormulas.put("wd2",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return ctx.getShapeAnchor().getWidth()/2;
+                return ctx.getShapeAnchor().getWidth()/2.;
             }
          });
 
@@ -329,7 +329,7 @@ public abstract class Formula {
         builtInFormulas.put("wd3",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return ctx.getShapeAnchor().getWidth()/3;
+                return ctx.getShapeAnchor().getWidth()/3.;
             }
          });
 
@@ -337,7 +337,7 @@ public abstract class Formula {
         builtInFormulas.put("wd4",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return ctx.getShapeAnchor().getWidth()/4;
+                return ctx.getShapeAnchor().getWidth()/4.;
             }
          });
 
@@ -345,7 +345,7 @@ public abstract class Formula {
         builtInFormulas.put("wd5",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return ctx.getShapeAnchor().getWidth()/5;
+                return ctx.getShapeAnchor().getWidth()/5.;
             }
          });
 
@@ -353,7 +353,7 @@ public abstract class Formula {
         builtInFormulas.put("wd6",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return ctx.getShapeAnchor().getWidth()/6;
+                return ctx.getShapeAnchor().getWidth()/6.;
             }
          });
 
@@ -361,7 +361,7 @@ public abstract class Formula {
         builtInFormulas.put("wd8",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return ctx.getShapeAnchor().getWidth()/8;
+                return ctx.getShapeAnchor().getWidth()/8.;
             }
          });
 
@@ -369,7 +369,7 @@ public abstract class Formula {
         builtInFormulas.put("wd10",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return ctx.getShapeAnchor().getWidth()/10;
+                return ctx.getShapeAnchor().getWidth()/10.;
             }
          });
 
@@ -377,7 +377,7 @@ public abstract class Formula {
         builtInFormulas.put("wd32",  new Formula(){
             @Override
             double evaluate(Context ctx){
-                return ctx.getShapeAnchor().getWidth()/32;
+                return ctx.getShapeAnchor().getWidth()/32.;
             }
          });
     }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/util/ZipSecureFile.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/util/ZipSecureFile.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/util/ZipSecureFile.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/util/ZipSecureFile.java Sun Jan  1 22:59:35
2017
@@ -51,10 +51,10 @@ public class ZipSecureFile extends ZipFi
     private static long MAX_ENTRY_SIZE = 0xFFFFFFFFL;
     
     // don't alert for expanded sizes smaller than 100k
-    private final static long GRACE_ENTRY_SIZE = 100*1024;
+    private final static long GRACE_ENTRY_SIZE = 100*1024L;
 
     // The default maximum size of extracted text 
-    private static long MAX_TEXT_SIZE = 10*1024*1024;
+    private static long MAX_TEXT_SIZE = 10*1024*1024L;
     
     /**
      * Sets the ratio between de- and inflated bytes to detect zipbomb.

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java Sun Jan  1 22:59:35
2017
@@ -419,8 +419,8 @@ public final class XSSFDrawing extends P
         for (int row=anchor.getRow1(); row<anchor.getRow2(); row++) {
             heightPx += ImageUtils.getRowHeightInPixels(sheet, row);
         }
-        int width = Units.pixelToEMU((int)widthPx);
-        int height = Units.pixelToEMU((int)heightPx);
+        long width = Units.pixelToEMU((int)widthPx);
+        long height = Units.pixelToEMU((int)heightPx);
         CTPositiveSize2D ext = xfrm.addNewExt();
         ext.setCx(width - anchor.getDx1() + anchor.getDx2());
         ext.setCy(height - anchor.getDy1() + anchor.getDy2());

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java Sun Jan  1 22:59:35 2017
@@ -42,7 +42,7 @@ public final class EMF extends Metafile
             InputStream is = new ByteArrayInputStream( rawdata );
             Header header = new Header();
             header.read(rawdata, CHECKSUM_SIZE);
-            long len = is.skip(header.getSize() + CHECKSUM_SIZE);
+            long len = is.skip(header.getSize() + (long)CHECKSUM_SIZE);
             assert(len == header.getSize() + CHECKSUM_SIZE);
 
             InflaterInputStream inflater = new InflaterInputStream( is );

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java Sun Jan  1 22:59:35 2017
@@ -57,7 +57,7 @@ public final class PICT extends Metafile
         ByteArrayInputStream bis = new ByteArrayInputStream(data);
         Header header = new Header();
         header.read(data, pos);
-        long bs_exp = pos + header.getSize();
+        long bs_exp = (long)pos + header.getSize();
         long bs_act = bis.skip(bs_exp);
         if (bs_exp != bs_act) {
             throw new EOFException();

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java Sun Jan  1 22:59:35 2017
@@ -42,7 +42,7 @@ public final class WMF extends Metafile
             InputStream is = new ByteArrayInputStream( rawdata );
             Header header = new Header();
             header.read(rawdata, CHECKSUM_SIZE*getUIDInstanceCount());
-            long len = is.skip(header.getSize() + CHECKSUM_SIZE*getUIDInstanceCount());
+            long len = is.skip(header.getSize() + (long)CHECKSUM_SIZE*getUIDInstanceCount());
             assert(len == header.getSize() + CHECKSUM_SIZE*getUIDInstanceCount());
 
             ImageHeaderWMF aldus = new ImageHeaderWMF(header.getBounds());

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java?rev=1776894&r1=1776893&r2=1776894&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java Sun
Jan  1 22:59:35 2017
@@ -541,9 +541,9 @@ public class WordToHtmlConverter extends
                      * least simplest case shall be handled
                      */
                     final float defaultTab = TWIPS_PER_INCH / 2;
+                    // char have some space
                     float firstLinePosition = paragraph.getIndentFromLeft()
-                            + paragraph.getFirstLineIndent() + 20; // char have
-                                                                   // some space
+                            + paragraph.getFirstLineIndent() + 20f;
 
                     float nextStop = (float) ( Math.ceil( firstLinePosition
                             / defaultTab ) * defaultTab );



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


Mime
View raw message