bug 59907: restore ClientAnchor#setAnchorType(int) that was removed in POI 3.14 beta 1 and broke backwards compatibility without a 2 release deprecation notice

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1760617 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-09-14 02:41:01 +00:00
parent 3c97d9700a
commit 0977e51818
3 changed files with 30 additions and 0 deletions

View File

@ -250,6 +250,7 @@ public final class HSSFClientAnchor extends HSSFAnchor implements ClientAnchor {
/** /**
* Gets the anchor type * Gets the anchor type
* Changed from returning an int to an enum in POI 3.14 beta 1.
* @return the anchor type * @return the anchor type
*/ */
@Override @Override
@ -260,11 +261,20 @@ public final class HSSFClientAnchor extends HSSFAnchor implements ClientAnchor {
/** /**
* Sets the anchor type * Sets the anchor type
* @param anchorType the anchor type to set * @param anchorType the anchor type to set
* @since POI 3.14
*/ */
@Override @Override
public void setAnchorType(AnchorType anchorType) { public void setAnchorType(AnchorType anchorType) {
_escherClientAnchor.setFlag(anchorType.value); _escherClientAnchor.setFlag(anchorType.value);
} }
/**
* Sets the anchor type
* @param anchorType the anchor type to set
* @deprecated POI 3.15. Use {@link #setAnchorType(AnchorType)} instead.
*/
public void setAnchorType(int anchorType) {
_escherClientAnchor.setFlag((short) anchorType);
}
private void checkRange(int value, int minRange, int maxRange, String varName) { private void checkRange(int value, int minRange, int maxRange, String varName) {
if (value < minRange || value > maxRange) if (value < minRange || value > maxRange)

View File

@ -288,11 +288,19 @@ public interface ClientAnchor {
/** /**
* Sets the anchor type * Sets the anchor type
* @param anchorType the anchor type to set * @param anchorType the anchor type to set
* @since POI 3.14
*/ */
public void setAnchorType( AnchorType anchorType ); public void setAnchorType( AnchorType anchorType );
/**
* Sets the anchor type
* @param anchorType the anchor type to set
* @deprecated POI 3.15. Use {@link #setAnchorType(AnchorType)} instead.
*/
public void setAnchorType( int anchorType );
/** /**
* Gets the anchor type * Gets the anchor type
* Changed from returning an int to an enum in POI 3.14 beta 1.
* @return the anchor type * @return the anchor type
*/ */
public AnchorType getAnchorType(); public AnchorType getAnchorType();

View File

@ -218,15 +218,27 @@ public final class XSSFClientAnchor extends XSSFAnchor implements ClientAnchor {
/** /**
* Sets the anchor type * Sets the anchor type
* @param anchorType the anchor type to set * @param anchorType the anchor type to set
* @since POI 3.14
*/ */
@Override @Override
public void setAnchorType( AnchorType anchorType ) public void setAnchorType( AnchorType anchorType )
{ {
this.anchorType = anchorType; this.anchorType = anchorType;
} }
/**
* Sets the anchor type
* @param anchorType the anchor type to set
* @deprecated POI 3.15. Use {@link #setAnchorType(AnchorType)} instead
*/
@Override
public void setAnchorType( int anchorType )
{
this.anchorType = AnchorType.byId(anchorType);
}
/** /**
* Gets the anchor type * Gets the anchor type
* Changed from returning an int to an enum in POI 3.14 beta 1.
* @return the anchor type * @return the anchor type
*/ */
@Override @Override