]> source.dussan.org Git - poi.git/commitdiff
bug 59907: restore ClientAnchor#setAnchorType(int) that was removed in POI 3.14 beta...
authorJaven O'Neal <onealj@apache.org>
Wed, 14 Sep 2016 02:41:01 +0000 (02:41 +0000)
committerJaven O'Neal <onealj@apache.org>
Wed, 14 Sep 2016 02:41:01 +0000 (02:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1760617 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/usermodel/HSSFClientAnchor.java
src/java/org/apache/poi/ss/usermodel/ClientAnchor.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java

index 4b8a25e302da4f60bfb9a2a9fc50525ce13dc311..e71e362b82ef12a821891565f1d499e0804bb12a 100644 (file)
@@ -250,6 +250,7 @@ public final class HSSFClientAnchor extends HSSFAnchor implements ClientAnchor {
 
     /**
      * Gets the anchor type
+     * Changed from returning an int to an enum in POI 3.14 beta 1.
      * @return the anchor type
      */
     @Override
@@ -260,11 +261,20 @@ public final class HSSFClientAnchor extends HSSFAnchor implements ClientAnchor {
     /**
      * Sets the anchor type
      * @param anchorType the anchor type to set
+     * @since POI 3.14
      */
     @Override
     public void setAnchorType(AnchorType anchorType) {
         _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) {
         if (value < minRange || value > maxRange)
index 672c1e23028ac62071072c7ffb5ce72ccfc83f19..65e69d87d93cec88faf5feebddc7cc5e5a5daa00 100644 (file)
@@ -288,11 +288,19 @@ public interface ClientAnchor {
     /**
      * Sets the anchor type
      * @param anchorType the anchor type to set
+     * @since POI 3.14
      */
     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
+     * Changed from returning an int to an enum in POI 3.14 beta 1.
      * @return the anchor type
      */
     public AnchorType getAnchorType();
index 8045912abf210864e09ea480b0da2d991122258d..19d7d81099b3c1aab48b5d7f6f679e871ccf43f1 100644 (file)
@@ -218,15 +218,27 @@ public final class XSSFClientAnchor extends XSSFAnchor implements ClientAnchor {
     /**
      * Sets the anchor type
      * @param anchorType the anchor type to set
+     * @since POI 3.14
      */
     @Override
     public void setAnchorType( 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
+     * Changed from returning an int to an enum in POI 3.14 beta 1.
      * @return the anchor type
      */
     @Override