https://issues.apache.org/bugzilla/show_bug.cgi?id=47904
Summary: Changing a RichTextRun attribute of a MasterSlide
results in a NullReferenceException
Product: POI
Version: 3.2-FINAL
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: HSLF
AssignedTo: [email protected]
ReportedBy: [email protected]
I have tried to change the MasterSlide's RichTextRun attribute, i.e. setting
FontName or anything else and it pops up with a NullReferenceException.
I have traced it in the source to these lines:
TextRun.java: 519 RecordContainer runAtomsParent =
_headerAtom.getParentRecord();
TextHeaderAtom.java: 55 public RecordContainer getParentRecord() { return
parentRecord; }
The 'parentRecord' is null.
It is then tried to be called here:
TextRun.java: 524 runAtomsParent.addChildAfter(_styleAtom, addAfter);
Since 'runAtomsParent' is null, we get the exception.
Here is some example code of what I did:
SlideMaster master = mSlideshow.getSlidesMasters()[0];
TextShape title = (TextShape) master.getShapes()[0];
RichTextRun titleFormat = title.getTextRun().getRichTextRuns()[0];
titleFormat.setFontName("Franklin Gothic Book");
titleFormat.setShadowed(true);
titleFormat.setFontSize(44);
titleFormat.setFontColor(Color.white);
titleFormat.setAlignment(TextBox.AlignCenter);
master.addShape(title);
mSlideShow is as you have guessed, my SlideShow object.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]