fixed bad test case in BaseTestSheet.getCellComments
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1715854 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7af82a3de2
commit
788047ed08
@ -1036,6 +1036,7 @@ public abstract class BaseTestSheet {
|
|||||||
Workbook workbook = _testDataProvider.createWorkbook();
|
Workbook workbook = _testDataProvider.createWorkbook();
|
||||||
Sheet sheet = workbook.createSheet("TEST");
|
Sheet sheet = workbook.createSheet("TEST");
|
||||||
Drawing dg = sheet.createDrawingPatriarch();
|
Drawing dg = sheet.createDrawingPatriarch();
|
||||||
|
ClientAnchor anchor = workbook.getCreationHelper().createClientAnchor();
|
||||||
|
|
||||||
int nRows = 5;
|
int nRows = 5;
|
||||||
int nCols = 6;
|
int nCols = 6;
|
||||||
@ -1044,11 +1045,20 @@ public abstract class BaseTestSheet {
|
|||||||
sheet.createRow(r);
|
sheet.createRow(r);
|
||||||
// Create columns in reverse order
|
// Create columns in reverse order
|
||||||
for (int c=nCols-1; c>=0; c--) {
|
for (int c=nCols-1; c>=0; c--) {
|
||||||
Comment comment = dg.createCellComment(workbook.getCreationHelper().createClientAnchor());
|
// When the comment box is visible, have it show in a 1x3 space
|
||||||
|
anchor.setCol1(c);
|
||||||
|
anchor.setCol2(c);
|
||||||
|
anchor.setRow1(r);
|
||||||
|
anchor.setRow2(r);
|
||||||
|
|
||||||
|
// Create the comment and set the text-author
|
||||||
|
Comment comment = dg.createCellComment(anchor);
|
||||||
Cell cell = sheet.getRow(r).createCell(c);
|
Cell cell = sheet.getRow(r).createCell(c);
|
||||||
comment.setAuthor("Author " + r);
|
comment.setAuthor("Author " + r);
|
||||||
RichTextString text = workbook.getCreationHelper().createRichTextString("Test comment at row=" + r + ", column=" + c);
|
RichTextString text = workbook.getCreationHelper().createRichTextString("Test comment at row=" + r + ", column=" + c);
|
||||||
comment.setString(text);
|
comment.setString(text);
|
||||||
|
|
||||||
|
// Assign the comment to the cell
|
||||||
cell.setCellComment(comment);
|
cell.setCellComment(comment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user