You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2015/11/23 16:45:30 UTC
svn commit: r1715854 -
/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java
Author: onealj
Date: Mon Nov 23 15:45:30 2015
New Revision: 1715854
URL: http://svn.apache.org/viewvc?rev=1715854&view=rev
Log:
fixed bad test case in BaseTestSheet.getCellComments
Modified:
poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java
Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java?rev=1715854&r1=1715853&r2=1715854&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java Mon Nov 23 15:45:30 2015
@@ -1036,6 +1036,7 @@ public abstract class BaseTestSheet {
Workbook workbook = _testDataProvider.createWorkbook();
Sheet sheet = workbook.createSheet("TEST");
Drawing dg = sheet.createDrawingPatriarch();
+ ClientAnchor anchor = workbook.getCreationHelper().createClientAnchor();
int nRows = 5;
int nCols = 6;
@@ -1044,11 +1045,20 @@ public abstract class BaseTestSheet {
sheet.createRow(r);
// Create columns in reverse order
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);
comment.setAuthor("Author " + r);
RichTextString text = workbook.getCreationHelper().createRichTextString("Test comment at row=" + r + ", column=" + c);
comment.setString(text);
+
+ // Assign the comment to the cell
cell.setCellComment(comment);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org