View | Details | Raw Unified | Return to bug 39991
Collapse All | Expand All

(-)src/scratchpad/src/org/apache/poi/hslf/usermodel/PictureData.java (+12 lines)
Lines 49-54 Link Here
49
	*/
49
	*/
50
	protected byte[] header;
50
	protected byte[] header;
51
    protected int offset;
52
51
    public PictureData(){
53
    public PictureData(){
52
        header = new byte[PictureData.HEADER_SIZE];
54
        header = new byte[PictureData.HEADER_SIZE];
53
    }
55
    }
Lines 76-81 Link Here
76
		// Save the picture data
78
		// Save the picture data
77
		pictdata = new byte[size];
79
		pictdata = new byte[size];
80
        this.offset = offset;
78
		System.arraycopy(pictstream, startPos, pictdata, 0, pictdata.length);
81
		System.arraycopy(pictstream, startPos, pictdata, 0, pictdata.length);
79
	}
82
	}
Lines 164-169 Link Here
164
    }
167
    }
165
    /**
168
    /**
169
     * File offset in the 'Pictures' stream
170
     *
171
     * @return offset in the 'Pictures' stream
172
     */
173
    public int getOffset(){
174
        return offset;
175
    }
176
177
    /**
166
     * Compute 16-byte checksum of this picture
178
     * Compute 16-byte checksum of this picture
167
     */
179
     */
168
    public static byte[] getChecksum(byte[] data) {
180
    public static byte[] getChecksum(byte[] data) {
(-)src/scratchpad/src/org/apache/poi/hslf/model/Picture.java (-1 / +1 lines)
Lines 153-159 Link Here
153
        int idx = getPictureIndex()-1;
153
        int idx = getPictureIndex()-1;
154
        EscherBSERecord bse = (EscherBSERecord)lst.get(idx);
154
        EscherBSERecord bse = (EscherBSERecord)lst.get(idx);
155
        for ( int i = 0; i < pict.length; i++ ) {
155
        for ( int i = 0; i < pict.length; i++ ) {
156
            if (Arrays.equals(bse.getUid(), pict[i].getUID())){
156
            if (pict[i].getOffset() ==  bse.getOffset()){
157
                return pict[i];
157
                return pict[i];
158
            }
158
            }
159
        }
159
        }

Return to bug 39991