Bug 44070 - Comments will not shift
Summary: Comments will not shift
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-13 02:27 UTC by Sven Nissel
Modified: 2008-01-07 06:52 UTC (History)
0 users



Attachments
Example source (14.00 KB, application/vnd.ms-excel)
2007-12-13 02:28 UTC, Sven Nissel
Details
Example output (7.50 KB, application/vnd.ms-excel)
2007-12-13 02:29 UTC, Sven Nissel
Details
Patch for the shifting comment problem (5.39 KB, patch)
2008-01-07 06:43 UTC, Gian Carlo Pace
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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