Bug 44070

Summary: Comments will not shift
Product: POI Reporter: Sven Nissel <sven>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Example source
Example output
Patch for the shifting comment problem

Description Sven Nissel 2007-12-13 02:27:48 UTC
If you have a Cells with comments and you want to shift them up or down, the
Cell Values will be shift, but not the Comments:

POIFSFileSystem fileSystem = new POIFSFileSystem(new
FileInputStream("comments.xls"));
HSSFWorkbook workbook = new HSSFWorkbook(fileSystem);
HSSFSheet sheet = workbook.getSheet("Sheet1");
sheet.shiftRows(1, sheet.getLastRowNum(), 1, true, true);
workbook.write(new FileOutputStream("comments-error.xls"));

In this Example the Comment in comments.xls is in the same row as in
comments-error.xls but it must be at row+1
Comment 1 Sven Nissel 2007-12-13 02:28:54 UTC
Created attachment 21267 [details]
Example source
Comment 2 Sven Nissel 2007-12-13 02:29:17 UTC
Created attachment 21268 [details]
Example output
Comment 3 Sven Nissel 2007-12-13 02:57:32 UTC
I use version: poi-3.0.2-beta1-20071204.jar
Comment 4 Gian Carlo Pace 2008-01-07 06:43:56 UTC
Created attachment 21352 [details]
Patch for the shifting comment problem 

After applying the enclosed fix comment are correctly shifted.
Comment 5 Nick Burch 2008-01-07 06:52:45 UTC
Thanks for that patch, applied