mirror of https://github.com/apache/poi.git
Fix for DataFormatter on some JVMs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@680394 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
eaf60c3114
commit
cfb357a62c
|
@ -202,10 +202,12 @@ public class HSSFDataFormatter {
|
||||||
// remove color formatting if present
|
// remove color formatting if present
|
||||||
String formatStr = sFormat.replaceAll("\\[[a-zA-Z]*\\]", "");
|
String formatStr = sFormat.replaceAll("\\[[a-zA-Z]*\\]", "");
|
||||||
|
|
||||||
// try to extract special characters like currency
|
// Try to extract special characters like currency
|
||||||
Matcher m = specialPatternGroup.matcher(formatStr);
|
// Need to re-create the matcher each time, as the string
|
||||||
|
// will potentially change on each pass
|
||||||
|
Matcher m;
|
||||||
try {
|
try {
|
||||||
while(m.find()) {
|
while((m = specialPatternGroup.matcher(formatStr)).find()) {
|
||||||
String match = m.group();
|
String match = m.group();
|
||||||
String symbol = match.substring(match.indexOf('$') + 1, match.indexOf('-'));
|
String symbol = match.substring(match.indexOf('$') + 1, match.indexOf('-'));
|
||||||
if (symbol.indexOf('$') > -1) {
|
if (symbol.indexOf('$') > -1) {
|
||||||
|
|
Loading…
Reference in New Issue