Search in sources :

Example 41 with CellAddress

use of org.apache.poi.ss.util.CellAddress in project poi by apache.

the class XSSFSheet method getCellComment.

/**
     * Return cell comment at row, column, if one exists. Otherwise returns null.
     *
     * @param address the location of the cell comment
     * @return the cell comment, if one exists. Otherwise return null.
     */
@Override
public XSSFComment getCellComment(CellAddress address) {
    if (sheetComments == null) {
        return null;
    }
    final int row = address.getRow();
    final int column = address.getColumn();
    CellAddress ref = new CellAddress(row, column);
    CTComment ctComment = sheetComments.getCTComment(ref);
    if (ctComment == null) {
        return null;
    }
    XSSFVMLDrawing vml = getVMLDrawing(false);
    return new XSSFComment(sheetComments, ctComment, vml == null ? null : vml.findCommentShape(row, column));
}
Also used : CellAddress(org.apache.poi.ss.util.CellAddress)

Aggregations

CellAddress (org.apache.poi.ss.util.CellAddress)41 Test (org.junit.Test)25 HSSFSheet (org.apache.poi.hssf.usermodel.HSSFSheet)5 Sheet (org.apache.poi.ss.usermodel.Sheet)5 Workbook (org.apache.poi.ss.usermodel.Workbook)5 POITestCase.skipTest (org.apache.poi.POITestCase.skipTest)4 Cell (org.apache.poi.ss.usermodel.Cell)4 Comment (org.apache.poi.ss.usermodel.Comment)4 Row (org.apache.poi.ss.usermodel.Row)4 SXSSFWorkbook (org.apache.poi.xssf.streaming.SXSSFWorkbook)4 CTComment (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment)4 ArrayList (java.util.ArrayList)3 TreeMap (java.util.TreeMap)3 HSSFWorkbook (org.apache.poi.hssf.usermodel.HSSFWorkbook)2 ClientAnchor (org.apache.poi.ss.usermodel.ClientAnchor)2 CreationHelper (org.apache.poi.ss.usermodel.CreationHelper)2 RichTextString (org.apache.poi.ss.usermodel.RichTextString)2 CommentsTable (org.apache.poi.xssf.model.CommentsTable)2 XSSFComment (org.apache.poi.xssf.usermodel.XSSFComment)2 CTClientData (com.microsoft.schemas.office.excel.CTClientData)1