From ebe0c65b9a9dc20cc2abb93b4185798f80e6ef48 Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Tue, 23 Aug 2011 15:34:42 +0000 Subject: [PATCH] add getOfficeArtSpContainer() method to OfficeDrawing git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1160744 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hwpf/usermodel/OfficeDrawing.java | 11 +++++++++++ .../apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawing.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawing.java index 5b983f3bf5..5165c9eb58 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawing.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawing.java @@ -16,6 +16,8 @@ ==================================================================== */ package org.apache.poi.hwpf.usermodel; +import org.apache.poi.ddf.EscherContainerRecord; + /** * User-friendly interface to office drawing objects. *

@@ -130,6 +132,15 @@ public interface OfficeDrawing */ public HorizontalRelativeElement getHorizontalRelative(); + /** + * Returns escher record that represent shape container (record type is + * 0xF004). Returned record has a child with record type + * 0xF00A and value of shape id equals to {@link #getShapeId()}. + * + * @return Returns office art shape container or null if not found + */ + public EscherContainerRecord getOfficeArtSpContainer(); + /** * Returns picture data if this shape has (single?) associated picture data */ diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java index 2d4c2a1a30..732879add0 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java @@ -167,6 +167,11 @@ public class OfficeDrawingsImpl implements OfficeDrawings return HorizontalRelativeElement.TEXT; } + public EscherContainerRecord getOfficeArtSpContainer() + { + return getEscherShapeRecordContainer( getShapeId() ); + } + public byte[] getPictureData() { EscherContainerRecord shapeDescription = getEscherShapeRecordContainer( getShapeId() ); -- 2.39.5