diff options
author | Nick Burch <nick@apache.org> | 2013-08-21 09:41:15 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2013-08-21 09:41:15 +0000 |
commit | b7db2fceef95b2144049950951d89a3ad2b40ac9 (patch) | |
tree | c953370c66c66154f04f0260e30147c456f876cc /src | |
parent | 51a7f3e333a2c12a82363b249a3046507abc5072 (diff) | |
download | poi-b7db2fceef95b2144049950951d89a3ad2b40ac9.tar.gz poi-b7db2fceef95b2144049950951d89a3ad2b40ac9.zip |
Push the fix for bug #55248 up to the Sheet interface (was XSSF only before)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1516124 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java | 13 | ||||
-rw-r--r-- | src/java/org/apache/poi/ss/usermodel/Sheet.java | 10 | ||||
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java | 2 |
3 files changed, 24 insertions, 1 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java index 76008ddab3..c99a843e34 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java @@ -1249,6 +1249,19 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { * @param toprow the top row to show in desktop window pane * @param leftcol the left column to show in desktop window pane */ + public void showInPane(int toprow, int leftcol) { + int maxrow = SpreadsheetVersion.EXCEL97.getLastRowIndex(); + if (toprow > maxrow) throw new IllegalArgumentException("Maximum row number is " + maxrow); + + showInPane((short)toprow, (short)leftcol); + } + /** + * Sets desktop window pane display area, when the + * file is first opened in a viewer. + * + * @param toprow the top row to show in desktop window pane + * @param leftcol the left column to show in desktop window pane + */ public void showInPane(short toprow, short leftcol) { _sheet.setTopRow(toprow); _sheet.setLeftCol(leftcol); diff --git a/src/java/org/apache/poi/ss/usermodel/Sheet.java b/src/java/org/apache/poi/ss/usermodel/Sheet.java index 91caad02ff..62d2e04ef2 100644 --- a/src/java/org/apache/poi/ss/usermodel/Sheet.java +++ b/src/java/org/apache/poi/ss/usermodel/Sheet.java @@ -582,6 +582,16 @@ public interface Sheet extends Iterable<Row> { * @param toprow the top row to show in desktop window pane * @param leftcol the left column to show in desktop window pane */ + void showInPane(int toprow, int leftcol); + + /** + * Sets desktop window pane display area, when the + * file is first opened in a viewer. + * + * @param toprow the top row to show in desktop window pane + * @param leftcol the left column to show in desktop window pane + * @deprecated Use {@link #showInPane(int, int)} as there can be more than 32767 rows. + */ void showInPane(short toprow, short leftcol); /** diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 0af15ead35..37ce7fba2c 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -2411,7 +2411,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * @param toprow the top row to show in desktop window pane * @param leftcol the left column to show in desktop window pane * - * @deprecated Use the version of showInPane() with ints as there can be more than 32767 rows. + * @deprecated Use {@link #showInPane(int, int)} as there can be more than 32767 rows. */ @Deprecated public void showInPane(short toprow, short leftcol) { |