poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1718221 - /poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java
Date Sun, 06 Dec 2015 21:11:38 GMT
Author: onealj
Date: Sun Dec  6 21:11:38 2015
New Revision: 1718221

URL: http://svn.apache.org/viewvc?rev=1718221&view=rev
Log:
supporting change for bug 56454: SheetUtil.containsCell and CellRangeAddress.isInRange are
equivalent

Modified:
    poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java

Modified: poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java?rev=1718221&r1=1718220&r2=1718221&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java Sun Dec  6 21:11:38 2015
@@ -318,14 +318,16 @@ public class SheetUtil {
         if (font.getUnderline() == Font.U_SINGLE ) str.addAttribute(TextAttribute.UNDERLINE,
TextAttribute.UNDERLINE_ON, startIdx, endIdx);
     }
 
+    /**
+     * Check if the cell is in the specified cell range
+     *
+     * @param cr    the cell range to check in
+     * @param rowIx the row to check
+     * @param colIx the column to check
+     * @return true if the range contains the cell [rowIx, colIx]
+     */
     public static boolean containsCell(CellRangeAddress cr, int rowIx, int colIx) {
-        //FIXME: isn't this the same as cr.isInRange(rowInd, colInd) ?
-        if (cr.getFirstRow() <= rowIx && cr.getLastRow() >= rowIx
-                && cr.getFirstColumn() <= colIx && cr.getLastColumn()
>= colIx)
-        {
-            return true;
-        }
-        return false;
+        return cr.isInRange(rowIx,  colIx);
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message