poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1742868 - /poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java
Date Mon, 09 May 2016 03:49:16 GMT
Author: onealj
Date: Mon May  9 03:49:16 2016
New Revision: 1742868

URL: http://svn.apache.org/viewvc?rev=1742868&view=rev
Log:
add disabled unit test for bug 59393 from stone

Modified:
    poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java?rev=1742868&r1=1742867&r2=1742868&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java Mon May
 9 03:49:16 2016
@@ -1496,4 +1496,48 @@ public abstract class BaseTestBugzillaIs
     protected double delta(long startTimeMillis) {
         return time() - startTimeMillis;
     }
+    
+    @Ignore("bug 59393")
+    @Test
+    public void bug59393_commentsCanHaveSameAnchor() throws IOException
+    {
+        Workbook wb = _testDataProvider.createWorkbook();
+        
+        Sheet sheet = wb.createSheet();
+        
+        CreationHelper helper = wb.getCreationHelper();
+        ClientAnchor anchor = helper.createClientAnchor();
+        Drawing drawing = sheet.createDrawingPatriarch();
+        
+        Row row = sheet.createRow(0);
+        
+        Cell cell1 = row.createCell(0);
+        Cell cell2 = row.createCell(1);
+        Cell cell3 = row.createCell(2);
+
+        Comment comment1 = drawing.createCellComment(anchor);
+        RichTextString richTextString1 = helper.createRichTextString("comment1");
+        comment1.setString(richTextString1);
+        cell1.setCellComment(comment1);
+         
+        // fails with IllegalArgumentException("Multiple cell comments in one cell are not
allowed, cell: A1")
+        // because createCellComment tries to create a cell at A1
+        // (from CellAddress(anchor.getRow1(), anchor.getCell1())),
+        // but cell A1 already has a comment (comment1).
+        // Need to atomically create a comment and attach it to a cell.
+        // Current workaround: change anchor between each usage
+        // anchor.setCol1(1);
+        Comment comment2 = drawing.createCellComment(anchor);
+        RichTextString richTextString2 = helper.createRichTextString("comment2");
+        comment2.setString(richTextString2);
+        cell2.setCellComment(comment2);
+
+        // anchor.setCol1(2);
+        Comment comment3 = drawing.createCellComment(anchor);
+        RichTextString richTextString3 = helper.createRichTextString("comment3");
+        comment3.setString(richTextString3);
+        cell3.setCellComment(comment3);
+        
+        wb.close();
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message