diff options
author | Yegor Kozlov <yegor@apache.org> | 2008-01-10 18:04:38 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2008-01-10 18:04:38 +0000 |
commit | f13f164e72fe6a3c53302d1f015d098426848829 (patch) | |
tree | 5dc7ade188aceea9fa130fa93beb268642c0df43 /src/java/org | |
parent | 7ad30758812963137fe648cb07eacabcddbaec56 (diff) | |
download | poi-f13f164e72fe6a3c53302d1f015d098426848829.tar.gz poi-f13f164e72fe6a3c53302d1f015d098426848829.zip |
fixed bug 44200: Sheet not cloneable when Note added to excel cell
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@610855 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
3 files changed, 37 insertions, 0 deletions
diff --git a/src/java/org/apache/poi/hssf/record/NoteRecord.java b/src/java/org/apache/poi/hssf/record/NoteRecord.java index 63c0b1d7dc..a9e83806f8 100644 --- a/src/java/org/apache/poi/hssf/record/NoteRecord.java +++ b/src/java/org/apache/poi/hssf/record/NoteRecord.java @@ -243,4 +243,15 @@ public class NoteRecord extends Record { public void setAuthor(String author){ field_5_author = author; } + + public Object clone() { + NoteRecord rec = new NoteRecord(); + rec.field_1_row = field_1_row; + rec.field_2_col = field_2_col; + rec.field_3_flags = field_3_flags; + rec.field_4_shapeid = field_4_shapeid; + rec.field_5_author = field_5_author; + return rec; + } + } diff --git a/src/java/org/apache/poi/hssf/record/NoteStructureSubRecord.java b/src/java/org/apache/poi/hssf/record/NoteStructureSubRecord.java index 6ad3f8eb63..c99f29be35 100644 --- a/src/java/org/apache/poi/hssf/record/NoteStructureSubRecord.java +++ b/src/java/org/apache/poi/hssf/record/NoteStructureSubRecord.java @@ -125,6 +125,15 @@ public class NoteStructureSubRecord { return sid; } + + public Object clone() { + NoteStructureSubRecord rec = new NoteStructureSubRecord(); + byte[] recdata = new byte[reserved.length]; + System.arraycopy(reserved, 0, recdata, 0, recdata.length); + rec.reserved = recdata; + return rec; + } + } diff --git a/src/java/org/apache/poi/hssf/record/TextObjectRecord.java b/src/java/org/apache/poi/hssf/record/TextObjectRecord.java index 97685c9ca2..c8f6669b0f 100644 --- a/src/java/org/apache/poi/hssf/record/TextObjectRecord.java +++ b/src/java/org/apache/poi/hssf/record/TextObjectRecord.java @@ -251,4 +251,21 @@ public class TextObjectRecord buffer.append( "[/TXO]\n" ); return buffer.toString(); } + + public Object clone() { + + TextObjectRecord rec = new TextObjectRecord(); + rec.str = str; + + rec.setOptions(getOptions()); + rec.setTextOrientation(getTextOrientation()); + rec.setReserved4(getReserved4()); + rec.setReserved5(getReserved5()); + rec.setReserved6(getReserved6()); + rec.setTextLength(getTextLength()); + rec.setFormattingRunLength(getFormattingRunLength()); + rec.setReserved7(getReserved7()); + return rec; + } + } |