DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-24 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2007-05-24 01:09 ---
I applied the patches.
Unit tests are in
src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java

1. Incorrect matching of notes to slides
My fix is a bit different from the suggested patch. To find Notes for a Slide we
need to look at Slide.SlideAtom.notesId. It references the corresponding notes
slide ( 0 if slide has no notes). This logic works OK to me.   

2. NPE in RichTextRun.isBold() when the RichTextRun comes from a Notes model 
object

Applied. It's possible to have null master sheet for Notes. No NPE in this case.

P.S. You will notice that with or without the patch there are some superflous
Notes being returned for Slides which have no actual Notes in PowerPoint, but
atleast with the patch Notes don't seem to get lost.

I confirmed that. For the ppt from
http://www.cse.lehigh.edu/~caar/marnold/presentations/vail3.ppt slides 2 and 3
don't have notes in PowerPoint but have them in HSLF. This is quite unexpected
to me. Slide.SlideAtom.notesId indicates that the slide has notes. It looks like
there is something else to check when linking Slides and Notes. But what? I'm
leaving this riddle undiscovered.  

Yegor

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-24 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474





--- Additional Comments From [EMAIL PROTECTED]  2007-05-24 01:17 ---
Hi Yegor, looks like the second patch was not applied properly. The SVN commit 
message contains this chunk:


// Record the match between slide id and these 
notes
-   SlidePersistAtom spa = 
notesSets[i].getSlidePersistAtom();
-   Integer slideId = new 
Integer(spa.getSlideIdentifier());
-   slideIdToNotes.put(slideId, new Integer(i));
+SlidePersistAtom spa = notesSets[i].getSlidePersistAtom();
+Integer slideId = new Integer(spa.getSlideIdentifier());
+slideIdToNotes.put(slideId, new Integer(i));


but the newly added code in this chunk should be:


NotesAtom na = notesRecord.getNotesAtom();
Integer slideId = new Integer(na.getSlideID());
slideIdToNotes.put(slideId, new Integer(i));


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-24 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474





--- Additional Comments From [EMAIL PROTECTED]  2007-05-24 01:22 ---
(In reply to comment #7)
 Hi Yegor, looks like the second patch was not applied properly. The SVN 
commit 
 message contains this chunk:

Ah, nevermind, I missed your comment that you solved it differently... I will 
test your fix with other PPT files I have around, and report any issues.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-24 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474





--- Additional Comments From [EMAIL PROTECTED]  2007-05-24 01:28 ---
Hi Ivan,

this is intentionally.
See how I link Slides and Notes:
// Do we have a notes for this?
Notes notes = null;
//Slide.SlideAtom.notesId references the corresponding notes slide. 0 if
slide has no notes.
int noteId = slidesRecords[i].getSlideAtom().getNotesID();
if (noteId != 0){
Integer notesPos = (Integer)slideIdToNotes.get(new Integer(noteId));
if (notesPos != null) notes = _notes[notesPos.intValue()];
else logger.log(POILogger.ERROR, Notes not found for noteId= +
noteId);
}

Slide.SlideAtom.notesId points to the Note sheet and id of this sheet is takes
from the corresponding SlidePersistAtom.slideId. (Don't be misleaded.
SlidePersistAtom.slideId is actually sheet identifier, it can point to Slide,
Notes, Master and other objects).

Yegor

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-24 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474





--- Additional Comments From [EMAIL PROTECTED]  2007-05-24 01:31 ---
I will test your fix with other PPT files I have around, and report any issues.
OK. Shout if there are still problems with Slide--Notes linkage.

P.S. You posted more bugs. It's time to look at them :)

Yegor

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-24 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474





--- Additional Comments From [EMAIL PROTECTED]  2007-05-24 03:57 ---
Your fix works great with all my reference PPTs, thank you.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-21 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474





--- Additional Comments From [EMAIL PROTECTED]  2007-05-21 10:24 ---
Created an attachment (id=20225)
 -- (http://issues.apache.org/bugzilla/attachment.cgi?id=20225action=view)
orrect-matching-notes-to-slides.patch


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-21 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474





--- Additional Comments From [EMAIL PROTECTED]  2007-05-21 10:24 ---
Created an attachment (id=20226)
 -- (http://issues.apache.org/bugzilla/attachment.cgi?id=20226action=view)
fix-NPE-with-textruns-from-notes.patch


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-21 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474





--- Additional Comments From [EMAIL PROTECTED]  2007-05-21 15:04 ---
Created an attachment (id=20229)
 -- (http://issues.apache.org/bugzilla/attachment.cgi?id=20229action=view)
PPT file demonstrating the second bug

To reproduce the NPE:

new SlideShow(new
HSLFSlideShow(NPE-in-textrun-from-notes.ppt)).getNotes()[0].getTextRuns()[0].getRichTextRuns()[0].isBold();


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-21 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474





--- Additional Comments From [EMAIL PROTECTED]  2007-05-21 22:05 ---
Created an attachment (id=20235)
 -- (http://issues.apache.org/bugzilla/attachment.cgi?id=20235action=view)
PPT file demonstrating the first bug (Notes-Slides linkage)

From http://www.cse.lehigh.edu/~caar/marnold/presentations/vail3.ppt

Found a good example PPT file for the first bug. To reproduce:

Notes notes = new SlideShow(new
HSLFSlideShow(vail3.ppt)).getSlides()[7].getNotesSheet();

Without the patch, this returns null. With the patch it returns the correct
Notes object with the correct text.


P.S. You will notice that with or without the patch there are some superflous
Notes being returned for Slides which have no actual Notes in PowerPoint, but
atleast with the patch Notes don't seem to get lost.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-21 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474


[EMAIL PROTECTED] changed:

   What|Removed |Added

  Attachment #20225|orrect-matching-notes-to-   |correct-matching-notes-to-
description|slides.patch|slides.patch




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



DO NOT REPLY [Bug 42474] - Patches for a couple of bugs in HSLF

2007-05-21 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=42474.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42474


[EMAIL PROTECTED] changed:

   What|Removed |Added

  Attachment #20225|0   |1
is obsolete||




--- Additional Comments From [EMAIL PROTECTED]  2007-05-21 22:16 ---
Created an attachment (id=20236)
 -- (http://issues.apache.org/bugzilla/attachment.cgi?id=20236action=view)
correct-matching-notes-to-slides.patch

Revised the patch for the first bug to not remove the TODO comment about 
notes-slides linkage as there is obviously more work to be done.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/