You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2015/12/06 22:11:38 UTC
svn commit: r1718221 -
/poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java
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