aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/sl/image
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2020-04-02 23:54:48 +0000
committerAndreas Beeker <kiwiwings@apache.org>2020-04-02 23:54:48 +0000
commit1dc771394bedaf456b85e9e15d90f7429908919b (patch)
treedfc772532f1a6f663c71fc1647acbd73e33fce9c /src/java/org/apache/poi/sl/image
parent3f7d718a67d7f2830b186557d200ecba00d8ac34 (diff)
downloadpoi-1dc771394bedaf456b85e9e15d90f7429908919b.tar.gz
poi-1dc771394bedaf456b85e9e15d90f7429908919b.zip
Sonar Fixes - "static" base class members should not be accessed via derived types
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1876067 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/sl/image')
-rw-r--r--src/java/org/apache/poi/sl/image/ImageHeaderWMF.java35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/java/org/apache/poi/sl/image/ImageHeaderWMF.java b/src/java/org/apache/poi/sl/image/ImageHeaderWMF.java
index c3274d97f6..d210bc5429 100644
--- a/src/java/org/apache/poi/sl/image/ImageHeaderWMF.java
+++ b/src/java/org/apache/poi/sl/image/ImageHeaderWMF.java
@@ -24,6 +24,7 @@ import java.io.OutputStream;
import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.LittleEndianConsts;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
import org.apache.poi.util.Units;
@@ -77,7 +78,7 @@ public class ImageHeaderWMF {
public ImageHeaderWMF(byte[] data, final int off) {
int offset = off;
- int key = LittleEndian.getInt(data, offset); offset += LittleEndian.INT_SIZE; //header key
+ int key = LittleEndian.getInt(data, offset); offset += LittleEndianConsts.INT_SIZE; //header key
if (key != APMHEADER_KEY) {
LOG.log(POILogger.WARN, "WMF file doesn't contain a placeable header - ignore parsing");
handle = 0;
@@ -90,16 +91,16 @@ public class ImageHeaderWMF {
return;
}
- handle = LittleEndian.getUShort(data, offset); offset += LittleEndian.SHORT_SIZE;
- left = LittleEndian.getShort(data, offset); offset += LittleEndian.SHORT_SIZE;
- top = LittleEndian.getShort(data, offset); offset += LittleEndian.SHORT_SIZE;
- right = LittleEndian.getShort(data, offset); offset += LittleEndian.SHORT_SIZE;
- bottom = LittleEndian.getShort(data, offset); offset += LittleEndian.SHORT_SIZE;
+ handle = LittleEndian.getUShort(data, offset); offset += LittleEndianConsts.SHORT_SIZE;
+ left = LittleEndian.getShort(data, offset); offset += LittleEndianConsts.SHORT_SIZE;
+ top = LittleEndian.getShort(data, offset); offset += LittleEndianConsts.SHORT_SIZE;
+ right = LittleEndian.getShort(data, offset); offset += LittleEndianConsts.SHORT_SIZE;
+ bottom = LittleEndian.getShort(data, offset); offset += LittleEndianConsts.SHORT_SIZE;
- inch = LittleEndian.getUShort(data, offset); offset += LittleEndian.SHORT_SIZE;
- reserved = LittleEndian.getInt(data, offset); offset += LittleEndian.INT_SIZE;
+ inch = LittleEndian.getUShort(data, offset); offset += LittleEndianConsts.SHORT_SIZE;
+ reserved = LittleEndian.getInt(data, offset); offset += LittleEndianConsts.INT_SIZE;
- checksum = LittleEndian.getShort(data, offset); offset += LittleEndian.SHORT_SIZE;
+ checksum = LittleEndian.getShort(data, offset); offset += LittleEndianConsts.SHORT_SIZE;
if (checksum != getChecksum()){
LOG.log(POILogger.WARN, "WMF checksum does not match the header data");
}
@@ -124,14 +125,14 @@ public class ImageHeaderWMF {
public void write(OutputStream out) throws IOException {
byte[] header = new byte[22];
int pos = 0;
- LittleEndian.putInt(header, pos, APMHEADER_KEY); pos += LittleEndian.INT_SIZE; //header key
- LittleEndian.putUShort(header, pos, 0); pos += LittleEndian.SHORT_SIZE; //hmf
- LittleEndian.putUShort(header, pos, left); pos += LittleEndian.SHORT_SIZE; //left
- LittleEndian.putUShort(header, pos, top); pos += LittleEndian.SHORT_SIZE; //top
- LittleEndian.putUShort(header, pos, right); pos += LittleEndian.SHORT_SIZE; //right
- LittleEndian.putUShort(header, pos, bottom); pos += LittleEndian.SHORT_SIZE; //bottom
- LittleEndian.putUShort(header, pos, inch); pos += LittleEndian.SHORT_SIZE; //inch
- LittleEndian.putInt(header, pos, 0); pos += LittleEndian.INT_SIZE; //reserved
+ LittleEndian.putInt(header, pos, APMHEADER_KEY); pos += LittleEndianConsts.INT_SIZE; //header key
+ LittleEndian.putUShort(header, pos, 0); pos += LittleEndianConsts.SHORT_SIZE; //hmf
+ LittleEndian.putUShort(header, pos, left); pos += LittleEndianConsts.SHORT_SIZE; //left
+ LittleEndian.putUShort(header, pos, top); pos += LittleEndianConsts.SHORT_SIZE; //top
+ LittleEndian.putUShort(header, pos, right); pos += LittleEndianConsts.SHORT_SIZE; //right
+ LittleEndian.putUShort(header, pos, bottom); pos += LittleEndianConsts.SHORT_SIZE; //bottom
+ LittleEndian.putUShort(header, pos, inch); pos += LittleEndianConsts.SHORT_SIZE; //inch
+ LittleEndian.putInt(header, pos, 0); pos += LittleEndianConsts.INT_SIZE; //reserved
checksum = getChecksum();
LittleEndian.putUShort(header, pos, checksum);