Replace magic constant use of Escher Blip Start type ID with reference

Instead of referring to the magic constant 0xF018, reference the value in the EscherRecordTypes enum.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886987 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java b/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java
index bf0ba31..9dd6079 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java
@@ -72,7 +72,7 @@
      * @see HSSFWorkbook#PICTURE_TYPE_PICT
      */
     public int getFormat(){
-        return blip.getRecordId() - (short)0xF018;
+        return blip.getRecordId() - EscherRecordTypes.BLIP_START.typeID;
     }
 
     /**
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java
index f5b2eaa..2f3371d 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java
@@ -28,6 +28,7 @@
 import java.util.function.Supplier;
 
 import org.apache.poi.common.usermodel.GenericRecord;
+import org.apache.poi.ddf.EscherRecordTypes;
 import org.apache.poi.hslf.blip.DIB;
 import org.apache.poi.hslf.blip.EMF;
 import org.apache.poi.hslf.blip.JPEG;
@@ -159,7 +160,7 @@
 
         data = new byte[LittleEndianConsts.SHORT_SIZE];
         PictureType pt = getType();
-        LittleEndian.putUShort(data, 0, pt.nativeId + 0xF018);
+        LittleEndian.putUShort(data, 0, pt.nativeId + EscherRecordTypes.BLIP_START.typeID);
         out.write(data);
 
         byte[] rd = getRawData();
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
index 98b62bf..b489605 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
@@ -381,7 +381,7 @@
 
                 // When parsing the BStoreDelay stream, [MS-ODRAW] says that we
                 //  should terminate if the type isn't 0xf007 or 0xf018->0xf117
-                if (!((type == EscherRecordTypes.BSE.typeID) || (type >= 0xf018 && type <= 0xf117))) {
+                if (!((type == EscherRecordTypes.BSE.typeID) || (type >= EscherRecordTypes.BLIP_START.typeID && type <= 0xf117))) {
                     break;
                 }
 
@@ -392,8 +392,8 @@
                     throw new CorruptPowerPointFileException("The file contains a picture, at position " + _pictures.size() + ", which has a negatively sized data length, so we can't trust any of the picture data");
                 }
 
-                // If they type (including the bonus 0xF018) is 0, skip it
-                PictureType pt = PictureType.forNativeID(type - 0xF018);
+                // If the type (including the bonus 0xF018) is 0, skip it
+                PictureType pt = PictureType.forNativeID(type - EscherRecordTypes.BLIP_START.typeID);
                 if (pt == null) {
                     LOG.atError().log("Problem reading picture: Invalid image type 0, on picture with length {}.\nYour document will probably become corrupted if you save it! Position: {}", box(imgsize),box(pos));
                 } else {
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java
index fdf0a12..99eda82 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java
@@ -73,7 +73,7 @@
             EscherRecord nextRecord = escherRecordFactory.createRecord(
                     dataStream, offset );
             if ( nextRecord.getRecordId() != EscherRecordTypes.BSE.typeID
-                    && ( nextRecord.getRecordId() < (short) 0xF018 || nextRecord
+                    && ( nextRecord.getRecordId() < EscherRecordTypes.BLIP_START.typeID || nextRecord
                             .getRecordId() > (short) 0xF117 ) )
                 break;