ASF Bugzilla – Attachment 23193 Details for
Bug 46627
offset of new pictures is sometimes wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch that fixes the problem for me.
offset_bug.patch (text/plain), 1.91 KB, created by
David
on 2009-01-29 08:53:23 UTC
(
hide
)
Description:
patch that fixes the problem for me.
Filename:
MIME Type:
Creator:
David
Created:
2009-01-29 08:53:23 UTC
Size:
1.91 KB
patch
obsolete
>diff -ur ../../poi-3.2-FINAL.orig/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java ./scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java >--- ../../poi-3.2-FINAL.orig/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java 2008-10-11 11:59:18.000000000 +0200 >+++ ./scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java 2009-01-29 17:27:45.000000000 +0100 >@@ -517,6 +517,15 @@ > // Add in the new image > lst[lst.length - 1] = img; > _pictures = lst; >+ >+ if( lst.length > 1 ) { >+ PictureData prev = lst[lst.length - 2]; >+ int offset = prev.getOffset() + prev.getRawData().length + 8; >+ lst[lst.length - 1].setOffset( offset ); >+ } >+ else { >+ lst[lst.length - 1].setOffset( 0 ); >+ } > } > > /* ******************* fetching methods follow ********************* */ >diff -ur ../../poi-3.2-FINAL.orig/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java ./scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java >--- ../../poi-3.2-FINAL.orig/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java 2008-10-11 11:59:08.000000000 +0200 >+++ ./scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java 2009-01-29 17:30:58.000000000 +0100 >@@ -730,7 +730,7 @@ > > PictureData pict = PictureData.create(format); > pict.setData(data); >- pict.setOffset(offset); >+ _hslfSlideShow.addPicture(pict); > > EscherBSERecord bse = new EscherBSERecord(); > bse.setRecordId(EscherBSERecord.RECORD_ID); >@@ -746,14 +746,14 @@ > else if (format == Picture.PICT) bse.setBlipTypeWin32((byte)Picture.WMF); > > bse.setRef(0); >- bse.setOffset(offset); >+ bse.setOffset(pict.getOffset()); >+ bse.setRemainingData( new byte[0] ); > > bstore.addChildRecord(bse); >+ > int count = bstore.getChildRecords().size(); > bstore.setOptions((short)( (count << 4) | 0xF )); > >- _hslfSlideShow.addPicture(pict); >- > return count; > } >
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 46627
: 23193