Bug 43090: autoSizeColumn can calculate negative sizes for the column width due to a cast from integer to short
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@564689 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
09bcbf7f97
commit
4f98781194
@ -1505,6 +1505,9 @@ public class HSSFSheet
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (width != -1) {
|
if (width != -1) {
|
||||||
|
if (width > Short.MAX_VALUE) { //width can be bigger that Short.MAX_VALUE!
|
||||||
|
width = Short.MAX_VALUE;
|
||||||
|
}
|
||||||
sheet.setColumnWidth(column, (short) (width * 256));
|
sheet.setColumnWidth(column, (short) (width * 256));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user