preserve entries order in dictionaries

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1178153 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-10-02 08:58:11 +00:00
parent 0b92810530
commit b170936050

View File

@ -18,7 +18,7 @@
package org.apache.poi.hpsf; package org.apache.poi.hpsf;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.HashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import org.apache.poi.util.HexDump; import org.apache.poi.util.HexDump;
@ -193,7 +193,7 @@ public class Property
* @throws UnsupportedEncodingException if the dictionary's codepage is not * @throws UnsupportedEncodingException if the dictionary's codepage is not
* (yet) supported. * (yet) supported.
*/ */
protected Map readDictionary(final byte[] src, final long offset, protected Map<?, ?> readDictionary(final byte[] src, final long offset,
final int length, final int codepage) final int length, final int codepage)
throws UnsupportedEncodingException throws UnsupportedEncodingException
{ {
@ -210,7 +210,8 @@ public class Property
final long nrEntries = LittleEndian.getUInt(src, o); final long nrEntries = LittleEndian.getUInt(src, o);
o += LittleEndian.INT_SIZE; o += LittleEndian.INT_SIZE;
final Map m = new HashMap((int) nrEntries, (float) 1.0); final Map<Object, Object> m = new LinkedHashMap<Object, Object>(
(int) nrEntries, (float) 1.0 );
try try
{ {