Finish Comment2000Atom support

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@381167 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2006-02-26 20:52:42 +00:00
parent e27f1f5e98
commit cf9efc65f2
3 changed files with 11 additions and 6 deletions

View File

@ -16,12 +16,12 @@ public class Comment2000 extends RecordContainer {
private CString authorRecord; private CString authorRecord;
private CString authorInitialsRecord; private CString authorInitialsRecord;
private CString commentRecord; private CString commentRecord;
//private Comment2000Atom commentAtom; private Comment2000Atom commentAtom;
/** /**
* Returns the Comment2000Atom of this Comment * Returns the Comment2000Atom of this Comment
*/ */
//public Comment2000Atom getComment2000Atom() { return commentAtom; } public Comment2000Atom getComment2000Atom() { return commentAtom; }
/** /**
* Get the Author of this comment * Get the Author of this comment
@ -92,6 +92,11 @@ public class Comment2000 extends RecordContainer {
throw new IllegalStateException("Third child record wasn't a CString, was of type " + _children[2].getRecordType()); throw new IllegalStateException("Third child record wasn't a CString, was of type " + _children[2].getRecordType());
} }
// Fourth child should be the comment atom // Fourth child should be the comment atom
if(_children[3] instanceof Comment2000Atom) {
commentAtom = (Comment2000Atom)_children[3];
} else {
throw new IllegalStateException("Fourth child record wasn't a Comment2000Atom, was of type " + _children[3].getRecordType());
}
} }
/** /**

View File

@ -46,8 +46,8 @@ public class Comment2000Atom extends RecordAtom
* Constructs a brand new comment atom record. * Constructs a brand new comment atom record.
*/ */
protected Comment2000Atom() { protected Comment2000Atom() {
_header = new byte[28]; _header = new byte[8];
_data = new byte[8]; _data = new byte[28];
LittleEndian.putShort(_header, 2, (short)getRecordType()); LittleEndian.putShort(_header, 2, (short)getRecordType());
LittleEndian.putInt(_header, 4, _data.length); LittleEndian.putInt(_header, 4, _data.length);

View File

@ -152,8 +152,8 @@ public class RecordTypes {
// Records ~12000 seem to be related to the Comments used in PPT 2000/XP // Records ~12000 seem to be related to the Comments used in PPT 2000/XP
// (Comments in PPT97 are normal Escher text boxes) // (Comments in PPT97 are normal Escher text boxes)
public static final Type Comment2000 = new Type(12000,org.apache.poi.hslf.record.Comment2000.class); public static final Type Comment2000 = new Type(12000,Comment2000.class);
public static final Type Comment2000Atom = new Type(12002,null); public static final Type Comment2000Atom = new Type(12001,Comment2000Atom.class);
public static final Type Comment2000Summary = new Type(12004,null); public static final Type Comment2000Summary = new Type(12004,null);
public static final Type Comment2000SummaryAtom = new Type(12005,null); public static final Type Comment2000SummaryAtom = new Type(12005,null);