mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
bug 59443: use Comment.setAddress when changing both row and column of cell comment address
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1742880 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
38e137f9a0
commit
cb23ca952b
@ -17,6 +17,7 @@
|
||||
package org.apache.poi.xssf.usermodel.examples;
|
||||
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellAddress;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -68,8 +69,7 @@ public class CellComments {
|
||||
|
||||
comment2.setString(str2);
|
||||
comment2.setAuthor("Apache POI");
|
||||
comment2.setColumn(2);
|
||||
comment2.setRow(2);
|
||||
comment2.setAddress(new CellAddress("C3"));
|
||||
|
||||
String fname = "comments.xlsx";
|
||||
FileOutputStream out = new FileOutputStream(fname);
|
||||
|
||||
@ -113,6 +113,10 @@ public interface Comment {
|
||||
|
||||
/**
|
||||
* Return defines position of this anchor in the sheet.
|
||||
* The anchor is the yellow box/balloon that is rendered on top of the sheets
|
||||
* when the comment is visible.
|
||||
*
|
||||
* To associate a comment with a different cell, use {@link #setAddress}.
|
||||
*
|
||||
* @return defines position of this anchor in the sheet
|
||||
*/
|
||||
|
||||
@ -1039,8 +1039,7 @@ public final class XSSFCell implements Cell {
|
||||
return;
|
||||
}
|
||||
|
||||
comment.setRow(getRowIndex());
|
||||
comment.setColumn(getColumnIndex());
|
||||
comment.setAddress(getRowIndex(), getColumnIndex());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user