ASF Bugzilla – Attachment 18602 Details for
Bug 39991
HSLF: pictures in the stream identified by offset, not by UID
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch with the fix
pictures.patch (text/plain), 2.42 KB, created by
Yegor Kozlov
on 2006-07-14 06:14:09 UTC
(
hide
)
Description:
patch with the fix
Filename:
MIME Type:
Creator:
Yegor Kozlov
Created:
2006-07-14 06:14:09 UTC
Size:
2.42 KB
patch
obsolete
>Index: src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java >=================================================================== >--- src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java (revision 421811) >+++ src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java (working copy) >@@ -671,6 +671,7 @@ > pict.setUID(uid); > pict.setData(data); > pict.setType(format); >+ pict.setOffset(offset); > > _hslfSlideShow.addPicture(pict); > >Index: src/scratchpad/src/org/apache/poi/hslf/usermodel/PictureData.java >=================================================================== >--- src/scratchpad/src/org/apache/poi/hslf/usermodel/PictureData.java (revision 421811) >+++ src/scratchpad/src/org/apache/poi/hslf/usermodel/PictureData.java (working copy) >@@ -49,6 +49,8 @@ > */ > protected byte[] header; > >+ protected int offset; >+ > public PictureData(){ > header = new byte[PictureData.HEADER_SIZE]; > } >@@ -76,6 +78,7 @@ > > // Save the picture data > pictdata = new byte[size]; >+ this.offset = offset; > System.arraycopy(pictstream, startPos, pictdata, 0, pictdata.length); > } > >@@ -164,6 +167,25 @@ > } > > /** >+ * File offset in the 'Pictures' stream >+ * >+ * @return offset in the 'Pictures' stream >+ */ >+ public int getOffset(){ >+ return offset; >+ } >+ >+ /** >+ * Set offset of this picture in the 'Pictures' stream. >+ * We need to set it when a new picture is created. >+ * >+ * @param offset in the 'Pictures' stream >+ */ >+ public void setOffset(int offset){ >+ this.offset = offset; >+ } >+ >+ /** > * Compute 16-byte checksum of this picture > */ > public static byte[] getChecksum(byte[] data) { >Index: src/scratchpad/src/org/apache/poi/hslf/model/Picture.java >=================================================================== >--- src/scratchpad/src/org/apache/poi/hslf/model/Picture.java (revision 421811) >+++ src/scratchpad/src/org/apache/poi/hslf/model/Picture.java (working copy) >@@ -153,7 +153,7 @@ > int idx = getPictureIndex()-1; > EscherBSERecord bse = (EscherBSERecord)lst.get(idx); > for ( int i = 0; i < pict.length; i++ ) { >- if (Arrays.equals(bse.getUid(), pict[i].getUID())){ >+ if (pict[i].getOffset() == bse.getOffset()){ > return pict[i]; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 39991
:
18571
|
18572
|
18573
|
18600
|
18601
| 18602 |
18603