aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2018-01-31 05:31:31 +0000
committerPJ Fanning <fanningpj@apache.org>2018-01-31 05:31:31 +0000
commit15e1aa8b8b34afdfb883ff8ee4b4e327851b2843 (patch)
tree0332b17234b3a7fbae519aacf46ab72b677306fb /src/java/org
parentaae614424ea93156658e5ae081e51ddef79b44ed (diff)
downloadpoi-15e1aa8b8b34afdfb883ff8ee4b4e327851b2843.tar.gz
poi-15e1aa8b8b34afdfb883ff8ee4b4e327851b2843.zip
fix use of forbidden apis in row shift code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822743 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFRow.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
index 3a33a75cdd..845b58a009 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
@@ -24,13 +24,12 @@ import org.apache.poi.hssf.record.CellValueRecordInterface;
import org.apache.poi.hssf.record.ExtendedFormatRecord;
import org.apache.poi.hssf.record.RowRecord;
import org.apache.poi.ss.SpreadsheetVersion;
-import org.apache.poi.ss.formula.eval.NotImplementedException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.util.Configurator;
-import org.apache.poi.util.NotImplemented;
+import org.apache.poi.util.LocaleUtil;
/**
* High level representation of a row of a spreadsheet.
@@ -720,16 +719,17 @@ public final class HSSFRow implements Row, Comparable<HSSFRow> {
/**
* Shifts column range [firstShiftColumnIndex-lastShiftColumnIndex] step places to the right.
- * @param startColumn the column to start shifting
- * @param endColumn the column to end shifting
+ * @param firstShiftColumnIndex the column to start shifting
+ * @param lastShiftColumnIndex the column to end shifting
* @param step length of the shifting step
*/
@Override
- public void shiftCellsRight(int firstShiftColumnIndex, int lastShiftColumnIndex, int step){
+ public void shiftCellsRight(int firstShiftColumnIndex, int lastShiftColumnIndex, int step) {
if(step < 0)
throw new IllegalArgumentException("Shifting step may not be negative ");
if(firstShiftColumnIndex > lastShiftColumnIndex)
- throw new IllegalArgumentException(String.format("Incorrect shifting range : %d-%d", firstShiftColumnIndex, lastShiftColumnIndex));
+ throw new IllegalArgumentException(String.format(LocaleUtil.getUserLocale(),
+ "Incorrect shifting range : %d-%d", firstShiftColumnIndex, lastShiftColumnIndex));
if(lastShiftColumnIndex + step + 1> cells.length)
extend(lastShiftColumnIndex + step + 1);
for (int columnIndex = lastShiftColumnIndex; columnIndex >= firstShiftColumnIndex; columnIndex--){ // process cells backwards, because of shifting
@@ -748,16 +748,17 @@ public final class HSSFRow implements Row, Comparable<HSSFRow> {
}
/**
* Shifts column range [firstShiftColumnIndex-lastShiftColumnIndex] step places to the left.
- * @param startColumn the column to start shifting
- * @param endColumn the column to end shifting
+ * @param firstShiftColumnIndex the column to start shifting
+ * @param lastShiftColumnIndex the column to end shifting
* @param step length of the shifting step
*/
@Override
- public void shiftCellsLeft(int firstShiftColumnIndex, int lastShiftColumnIndex, int step){
+ public void shiftCellsLeft(int firstShiftColumnIndex, int lastShiftColumnIndex, int step) {
if(step < 0)
throw new IllegalArgumentException("Shifting step may not be negative ");
if(firstShiftColumnIndex > lastShiftColumnIndex)
- throw new IllegalArgumentException(String.format("Incorrect shifting range : %d-%d", firstShiftColumnIndex, lastShiftColumnIndex));
+ throw new IllegalArgumentException(String.format(LocaleUtil.getUserLocale(),
+ "Incorrect shifting range : %d-%d", firstShiftColumnIndex, lastShiftColumnIndex));
if(firstShiftColumnIndex - step < 0)
throw new IllegalStateException("Column index less than zero : " + (Integer.valueOf(firstShiftColumnIndex + step)).toString());
for (int columnIndex = firstShiftColumnIndex; columnIndex <= lastShiftColumnIndex; columnIndex++){