From ed3cae95f85cca7623a8a2e8593436fe5c3a5385 Mon Sep 17 00:00:00 2001 From: Maxim Valyanskiy Date: Wed, 20 Jan 2010 14:33:58 +0000 Subject: [PATCH] PowerPoint OLEShape: extract last version of embedded ole object git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@901215 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hslf/model/OLEShape.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java b/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java index 161a332b3..b6b4db673 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java @@ -84,12 +84,20 @@ public final class OLEShape extends Picture { //persist reference int ref = getExEmbed().getExOleObjAtom().getObjStgDataRef(); - for (int i = 0; i < ole.length; i++) { - if(ole[i].getExOleObjStg().getPersistId() == ref) return ole[i]; + ObjectData data = null; + + for (int i = 0; i < ole.length; i++) { + if(ole[i].getExOleObjStg().getPersistId() == ref) { + data=ole[i]; + } } - logger.log(POILogger.WARN, "OLE data not found"); - return null; + + if (data==null) { + logger.log(POILogger.WARN, "OLE data not found"); + } + + return data; } /**