You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2015/11/24 12:03:50 UTC
[Bug 58636] Upgrade ClientAnchor.get/setAnchorType to use enums
https://bz.apache.org/bugzilla/show_bug.cgi?id=58636
--- Comment #1 from Javen O'Neal <on...@apache.org> ---
Created attachment 33291
--> https://bz.apache.org/bugzilla/attachment.cgi?id=33291&action=edit
Add AnchorType enum inside ClientAnchor
I'd like to minimize the code impact on existing projects, but I wasn't able to
figure out a way to make enums work while allowing the following contrived
example code to not break:
if (anchor.getAnchorType() != ClientAnchor.MOVE_AND_RESIZE) {
anchor.setAnchorType(ClientAnchor.MOVE_AND_RESIZE);
}
Because the enum is a class inside the ClientAnchor, the above code would need
to be rewritten as
if (anchor.getAnchorType() != AnchorType.MOVE_AND_RESIZE) {
anchor.setAnchorType(AnchorType.MOVE_AND_RESIZE);
}
Existing code using int literals rather than the named constant will break, and
I don't have a problem with that.
Please look over ClientAnchor.java, XSSFClientAnchor.java, and
HSSFClientAnchor.java, the first 3 files in the attached patch, to let me know
how this could be better implemented.
Otherwise, I'll assume this is good and deploy it.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org