Bug 29615 - [PATCH] in POI 2.5: class DrawingRecord needs to define a clone method
Summary: [PATCH] in POI 2.5: class DrawingRecord needs to define a clone method
Status: RESOLVED DUPLICATE of bug 31795
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: PC All
: P3 major (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2004-06-16 17:12 UTC by Stefan Moratz
Modified: 2008-01-09 03:05 UTC (History)
1 user (show)

Fix as patch (650 bytes, patch)
2006-09-20 14:26 UTC, Rich Renomeron
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Moratz 2004-06-16 17:12:34 UTC

with POI 2.5 final the following exception occurs:

java.lang.RuntimeException: The class org.apache.poi.hssf.record.DrawingRecord 
needs to define a clone method
	at org.apache.poi.hssf.record.Record.clone(Record.java:194)
	at org.apache.poi.hssf.model.Sheet.cloneSheet(Sheet.java:301)
	at org.apache.poi.hssf.usermodel.HSSFSheet.cloneSheet
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.cloneSheet
Comment 1 yu-ji 2004-08-05 05:42:52 UTC
I had same error,when the cell has comment.
Comment 2 Massimiliano Iori 2004-12-09 12:26:45 UTC
It seems that the problem arise only if the sheet has comments. See also

Comment 3 juergen 2005-11-24 12:47:20 UTC
i get the same when the selected cell isn't A1 but another one (doesn't happen
for all cells)

to reproduce use my uploaded file in
Comment 4 juergen 2005-11-24 12:47:44 UTC
ah, i'm using 2.5.1-final
Comment 5 juergen 2005-11-25 09:33:26 UTC
i checked out the cvs version and implemented clone in DrawingRecord:

  public Object clone()
    DrawingRecord drawingRecord = new DrawingRecord();
    drawingRecord.recordData = (byte[]) recordData.clone();
    return drawingRecord;

I don't really know, what a DrawingRecord is, my excel file doesn't contain
drawings (but i think it did once). but this works for me, and if i write it to
a new file, this doesn't make things worse.
Comment 6 Rich Renomeron 2006-09-20 14:26:22 UTC
Created attachment 18892 [details]
Fix as patch

Here's the fix suggested in comment 5, as a patch against 3.0 alpha2.
Comment 7 Phil 2006-10-16 14:16:16 UTC
Pivot Tables clone just fine until you add a cell to the Page area. Even after 
deleting the item from the Pivot Table, trying to clone the sheet fails with 
the same error.
Comment 8 Nick Burch 2008-01-09 03:05:57 UTC

*** This bug has been marked as a duplicate of 31795 ***