]> source.dussan.org Git - poi.git/commitdiff
#55906 Extern Sheet References can have a last as well as a first sheet
authorNick Burch <nick@apache.org>
Thu, 24 Jul 2014 21:10:13 +0000 (21:10 +0000)
committerNick Burch <nick@apache.org>
Thu, 24 Jul 2014 21:10:13 +0000 (21:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1613302 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/record/ExternSheetRecord.java

index 5d59b36c9badaf0531b5725e7acc62ac67129151..846c9c2a6baeddf9b9516d4fc34bf7ecc78054b0 100644 (file)
@@ -230,6 +230,17 @@ public class ExternSheetRecord extends StandardRecord {
                return getRef(extRefIndex).getFirstSheetIndex();
        }
 
+    /**
+     * Returns the last sheet that the reference applies to, or
+     *  -1 if the referenced sheet can't be found, or -2 if the
+     *  reference is workbook scoped.
+     * For a single sheet reference, the first and last should be
+     *  the same.
+     */
+    public int getLastSheetIndexFromRefIndex(int extRefIndex) {
+        return getRef(extRefIndex).getLastSheetIndex();
+    }
+
        /**
      * Add a zero-based reference to a {@link org.apache.poi.hssf.record.SupBookRecord}.
      * <p>