From 66e08f08d31442e0f6d4ff79c9a6c2f74b732e66 Mon Sep 17 00:00:00 2001 From: Marius Volkhart Date: Sat, 27 Feb 2021 18:33:56 +0000 Subject: [PATCH] Replace magic constant use of Escher Blip End type ID with reference Instead of referring to the magic constant 0xF117, reference the value in the EscherRecordTypes enum. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886988 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java | 3 ++- .../src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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 b489605827..4ebe43518f 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,8 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { // 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 >= EscherRecordTypes.BLIP_START.typeID && type <= 0xf117))) { + if (!((type == EscherRecordTypes.BSE.typeID) || + (type >= EscherRecordTypes.BLIP_START.typeID && type <= EscherRecordTypes.BLIP_END.typeID))) { break; } 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 99eda8228f..b778fea19f 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PICFAndOfficeArtData.java @@ -74,7 +74,7 @@ public class PICFAndOfficeArtData dataStream, offset ); if ( nextRecord.getRecordId() != EscherRecordTypes.BSE.typeID && ( nextRecord.getRecordId() < EscherRecordTypes.BLIP_START.typeID || nextRecord - .getRecordId() > (short) 0xF117 ) ) + .getRecordId() > EscherRecordTypes.BLIP_END.typeID ) ) break; int blipRecordSize = nextRecord.fillFields( dataStream, offset,