poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1700646 - in /poi/trunk/src/java/org/apache/poi: hssf/record/DConRefRecord.java ss/format/CellElapsedFormatter.java util/StringUtil.java
Date Tue, 01 Sep 2015 19:16:21 GMT
Author: nick
Date: Tue Sep  1 19:16:21 2015
New Revision: 1700646

URL: http://svn.apache.org/r1700646
Log:
Fix some Forbidden APIs errors

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/DConRefRecord.java
    poi/trunk/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java
    poi/trunk/src/java/org/apache/poi/util/StringUtil.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DConRefRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DConRefRecord.java?rev=1700646&r1=1700645&r2=1700646&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DConRefRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DConRefRecord.java Tue Sep  1 19:16:21 2015
@@ -18,10 +18,11 @@
  */
 package org.apache.poi.hssf.record;
 
+import java.util.Arrays;
+
 import org.apache.poi.util.LittleEndian;
 import org.apache.poi.util.LittleEndianOutput;
-
-import java.util.Arrays;
+import org.apache.poi.util.StringUtil;
 
 /**
  * DConRef records specify a range in a workbook (internal or external) that serves as a
data source
@@ -292,7 +293,7 @@ public class DConRefRecord extends Stand
             {
                 offset++;
             }
-            String out = new String(Arrays.copyOfRange(path, offset, path.length));
+            String out = new String(Arrays.copyOfRange(path, offset, path.length), StringUtil.UTF8);
             //UNC paths have \u0003 chars as path separators.
             out = out.replaceAll("\u0003", "/");
             return out;

Modified: poi/trunk/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java?rev=1700646&r1=1700645&r2=1700646&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java Tue Sep  1 19:16:21
2015
@@ -201,7 +201,7 @@ public class CellElapsedFormatter extend
             parts[i] = specs.get(i).valueFor(elapsed);
         }
 
-        Formatter formatter = new Formatter(toAppendTo);
+        Formatter formatter = new Formatter(toAppendTo, Locale.ROOT);
         try {
             formatter.format(printfFmt, parts);
         } finally {

Modified: poi/trunk/src/java/org/apache/poi/util/StringUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/StringUtil.java?rev=1700646&r1=1700645&r2=1700646&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/util/StringUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/util/StringUtil.java Tue Sep  1 19:16:21 2015
@@ -31,15 +31,12 @@ import org.apache.poi.hssf.record.Record
  *
  * Note - none of the methods in this class deals with {@link org.apache.poi.hssf.record.ContinueRecord}s.
  * For such functionality, consider using {@link RecordInputStream}
- * 
- *
- *@author     Andrew C. Oliver
- *@author     Sergei Kozello (sergeikozello at mail.ru)
- *@author     Toshiaki Kamoshida (kamoshida.toshiaki at future dot co dot jp)
  */
 public class StringUtil {
-	private static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
-	private static final Charset UTF16LE = Charset.forName("UTF-16LE");
+	protected static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
+	protected static final Charset UTF16LE = Charset.forName("UTF-16LE");
+	public static final Charset UTF8 = Charset.forName("UTF-8");
+	
     private static Map<Integer,Integer> msCodepointToUnicode;
 
 	private StringUtil() {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message