ASF Bugzilla – Attachment 33825 Details for
Bug 59393
IllegalArgumentException when set comment for Multiple cell included cell A1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Code to reappear the bug.
TestCases.java (text/plain), 3.89 KB, created by
stone
on 2016-05-05 04:33:08 UTC
(
hide
)
Description:
Code to reappear the bug.
Filename:
MIME Type:
Creator:
stone
Created:
2016-05-05 04:33:08 UTC
Size:
3.89 KB
patch
obsolete
>package com.stone.poi; > >import java.io.IOException; >import org.apache.poi.ss.usermodel.Cell; >import org.apache.poi.ss.usermodel.ClientAnchor; >import org.apache.poi.ss.usermodel.Comment; >import org.apache.poi.ss.usermodel.CreationHelper; >import org.apache.poi.ss.usermodel.Drawing; >import org.apache.poi.ss.usermodel.RichTextString; >import org.apache.poi.ss.usermodel.Row; >import org.apache.poi.ss.usermodel.Sheet; >import org.apache.poi.ss.usermodel.Workbook; >import org.apache.poi.xssf.usermodel.XSSFWorkbook; > >/** > * @author stone > */ >public class TestCases >{ > //Can not pass > @org.junit.Test > public void testA1AndOthers() throws IOException > { > Workbook wb = new XSSFWorkbook(); > > 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); > > Comment comment2 = drawing.createCellComment(anchor); > RichTextString richTextString2 = helper.createRichTextString("comment2"); > comment2.setString(richTextString2); > cell2.setCellComment(comment2); > > Comment comment3 = drawing.createCellComment(anchor); > RichTextString richTextString3 = helper.createRichTextString("comment3"); > comment3.setString(richTextString3); > cell3.setCellComment(comment3); > > wb.close(); > } > > //pass > @org.junit.Test > public void testA1() throws IOException > { > Workbook wb = new XSSFWorkbook(); > > 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); > >// Comment comment2 = drawing.createCellComment(anchor); >// RichTextString richTextString2 = helper.createRichTextString("comment2"); >// comment2.setString(richTextString2); >// cell2.setCellComment(comment2); > >// Comment comment3 = drawing.createCellComment(anchor); >// RichTextString richTextString3 = helper.createRichTextString("comment3"); >// comment3.setString(richTextString3); >// cell3.setCellComment(comment3); > > wb.close(); > } > > //pass > @org.junit.Test > public void testOthers() throws IOException > { > Workbook wb = new XSSFWorkbook(); > > 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); > > Comment comment2 = drawing.createCellComment(anchor); > RichTextString richTextString2 = helper.createRichTextString("comment2"); > comment2.setString(richTextString2); > cell2.setCellComment(comment2); > > Comment comment3 = drawing.createCellComment(anchor); > RichTextString richTextString3 = helper.createRichTextString("comment3"); > comment3.setString(richTextString3); > cell3.setCellComment(comment3); > > wb.close(); > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 59393
: 33825