whitespace
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1742869 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a92163e9b6
commit
e9bfa9da87
@ -132,9 +132,9 @@ public class HSSFComment extends HSSFTextbox implements Comment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void setShapeId(int shapeId) {
|
void setShapeId(int shapeId) {
|
||||||
if(shapeId > 65535) {
|
if(shapeId > 65535) {
|
||||||
throw new IllegalArgumentException("Cannot add more than " + 65535 + " shapes");
|
throw new IllegalArgumentException("Cannot add more than " + 65535 + " shapes");
|
||||||
}
|
}
|
||||||
super.setShapeId(shapeId);
|
super.setShapeId(shapeId);
|
||||||
CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) getObjRecord().getSubRecords().get(0);
|
CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) getObjRecord().getSubRecords().get(0);
|
||||||
cod.setObjectId(shapeId);
|
cod.setObjectId(shapeId);
|
||||||
|
@ -33,8 +33,8 @@ import com.microsoft.schemas.vml.CTShape;
|
|||||||
|
|
||||||
public class XSSFComment implements Comment {
|
public class XSSFComment implements Comment {
|
||||||
|
|
||||||
private final CTComment _comment;
|
private final CTComment _comment;
|
||||||
private final CommentsTable _comments;
|
private final CommentsTable _comments;
|
||||||
private final CTShape _vmlShape;
|
private final CTShape _vmlShape;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,12 +43,12 @@ public class XSSFComment implements Comment {
|
|||||||
private XSSFRichTextString _str;
|
private XSSFRichTextString _str;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new XSSFComment, associated with a given
|
* Creates a new XSSFComment, associated with a given
|
||||||
* low level comment object.
|
* low level comment object.
|
||||||
*/
|
*/
|
||||||
public XSSFComment(CommentsTable comments, CTComment comment, CTShape vmlShape) {
|
public XSSFComment(CommentsTable comments, CTComment comment, CTShape vmlShape) {
|
||||||
_comment = comment;
|
_comment = comment;
|
||||||
_comments = comments;
|
_comments = comments;
|
||||||
_vmlShape = vmlShape;
|
_vmlShape = vmlShape;
|
||||||
|
|
||||||
// we potentially need to adjust the column/row information in the shape
|
// we potentially need to adjust the column/row information in the shape
|
||||||
@ -66,15 +66,15 @@ public class XSSFComment implements Comment {
|
|||||||
// This call seems to fix them again... See bug #50795
|
// This call seems to fix them again... See bug #50795
|
||||||
vmlShape.getClientDataList().toString();
|
vmlShape.getClientDataList().toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return Name of the original comment author. Default value is blank.
|
* @return Name of the original comment author. Default value is blank.
|
||||||
*/
|
*/
|
||||||
public String getAuthor() {
|
public String getAuthor() {
|
||||||
return _comments.getAuthor((int) _comment.getAuthorId());
|
return _comments.getAuthor((int) _comment.getAuthorId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the original comment author. Default value is blank.
|
* Name of the original comment author. Default value is blank.
|
||||||
@ -90,16 +90,16 @@ public class XSSFComment implements Comment {
|
|||||||
/**
|
/**
|
||||||
* @return the 0-based column of the cell that the comment is associated with.
|
* @return the 0-based column of the cell that the comment is associated with.
|
||||||
*/
|
*/
|
||||||
public int getColumn() {
|
public int getColumn() {
|
||||||
return new CellReference(_comment.getRef()).getCol();
|
return new CellReference(_comment.getRef()).getCol();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the 0-based row index of the cell that the comment is associated with.
|
* @return the 0-based row index of the cell that the comment is associated with.
|
||||||
*/
|
*/
|
||||||
public int getRow() {
|
public int getRow() {
|
||||||
return new CellReference(_comment.getRef()).getRow();
|
return new CellReference(_comment.getRef()).getRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return whether the comment is visible
|
* @return whether the comment is visible
|
||||||
@ -110,8 +110,8 @@ public class XSSFComment implements Comment {
|
|||||||
String style = _vmlShape.getStyle();
|
String style = _vmlShape.getStyle();
|
||||||
visible = style != null && style.indexOf("visibility:visible") != -1;
|
visible = style != null && style.indexOf("visibility:visible") != -1;
|
||||||
}
|
}
|
||||||
return visible;
|
return visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param visible whether the comment is visible
|
* @param visible whether the comment is visible
|
||||||
@ -147,23 +147,23 @@ public class XSSFComment implements Comment {
|
|||||||
// This call seems to fix them again... See bug #50795
|
// This call seems to fix them again... See bug #50795
|
||||||
_vmlShape.getClientDataList().toString();
|
_vmlShape.getClientDataList().toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the row of the cell that contains the comment
|
* Set the row of the cell that contains the comment
|
||||||
*
|
*
|
||||||
* @param row the 0-based row of the cell that contains the comment
|
* @param row the 0-based row of the cell that contains the comment
|
||||||
*/
|
*/
|
||||||
public void setRow(int row) {
|
public void setRow(int row) {
|
||||||
CellAddress oldRef = new CellAddress(_comment.getRef());
|
CellAddress oldRef = new CellAddress(_comment.getRef());
|
||||||
|
|
||||||
CellAddress ref = new CellAddress(row, getColumn());
|
CellAddress ref = new CellAddress(row, getColumn());
|
||||||
_comment.setRef(ref.formatAsString());
|
_comment.setRef(ref.formatAsString());
|
||||||
_comments.referenceUpdated(oldRef, _comment);
|
_comments.referenceUpdated(oldRef, _comment);
|
||||||
|
|
||||||
if(_vmlShape != null) {
|
if(_vmlShape != null) {
|
||||||
_vmlShape.getClientDataArray(0).setRowArray(0,
|
_vmlShape.getClientDataArray(0).setRowArray(0,
|
||||||
new BigInteger(String.valueOf(row)));
|
new BigInteger(String.valueOf(row)));
|
||||||
|
|
||||||
// There is a very odd xmlbeans bug when changing the row
|
// There is a very odd xmlbeans bug when changing the row
|
||||||
// arrays which can lead to corrupt pointer
|
// arrays which can lead to corrupt pointer
|
||||||
@ -175,30 +175,30 @@ public class XSSFComment implements Comment {
|
|||||||
/**
|
/**
|
||||||
* @return the rich text string of the comment
|
* @return the rich text string of the comment
|
||||||
*/
|
*/
|
||||||
public XSSFRichTextString getString() {
|
public XSSFRichTextString getString() {
|
||||||
if(_str == null) {
|
if(_str == null) {
|
||||||
CTRst rst = _comment.getText();
|
CTRst rst = _comment.getText();
|
||||||
if(rst != null) _str = new XSSFRichTextString(_comment.getText());
|
if(rst != null) _str = new XSSFRichTextString(_comment.getText());
|
||||||
}
|
}
|
||||||
return _str;
|
return _str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the rich text string used by this comment.
|
* Sets the rich text string used by this comment.
|
||||||
*
|
*
|
||||||
* @param string the XSSFRichTextString used by this object.
|
* @param string the XSSFRichTextString used by this object.
|
||||||
*/
|
*/
|
||||||
public void setString(RichTextString string) {
|
public void setString(RichTextString string) {
|
||||||
if(!(string instanceof XSSFRichTextString)){
|
if(!(string instanceof XSSFRichTextString)){
|
||||||
throw new IllegalArgumentException("Only XSSFRichTextString argument is supported");
|
throw new IllegalArgumentException("Only XSSFRichTextString argument is supported");
|
||||||
}
|
}
|
||||||
_str = (XSSFRichTextString)string;
|
_str = (XSSFRichTextString)string;
|
||||||
_comment.setText(_str.getCTRst());
|
_comment.setText(_str.getCTRst());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setString(String string) {
|
public void setString(String string) {
|
||||||
setString(new XSSFRichTextString(string));
|
setString(new XSSFRichTextString(string));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ClientAnchor getClientAnchor() {
|
public ClientAnchor getClientAnchor() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user