Return-Path: X-Original-To: apmail-poi-commits-archive@minotaur.apache.org Delivered-To: apmail-poi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5FE2E187C7 for ; Sun, 6 Dec 2015 21:11:41 +0000 (UTC) Received: (qmail 85954 invoked by uid 500); 6 Dec 2015 21:11:41 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 85916 invoked by uid 500); 6 Dec 2015 21:11:41 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 85907 invoked by uid 99); 6 Dec 2015 21:11:41 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Dec 2015 21:11:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id DA63B1A0B76 for ; Sun, 6 Dec 2015 21:11:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.446 X-Spam-Level: X-Spam-Status: No, score=0.446 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.554] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id su1pKQQ0OT-a for ; Sun, 6 Dec 2015 21:11:39 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 75DBF215F4 for ; Sun, 6 Dec 2015 21:11:39 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id DC9D6E0057 for ; Sun, 6 Dec 2015 21:11:38 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id DBB2E3A044E for ; Sun, 6 Dec 2015 21:11:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1718221 - /poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java Date: Sun, 06 Dec 2015 21:11:38 -0000 To: commits@poi.apache.org From: onealj@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151206211138.DBB2E3A044E@svn01-us-west.apache.org> 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