mirror of https://github.com/apache/poi.git
Ensure consistent ordering when writing out formats following changes in r1677368
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1677370 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f0fe91614b
commit
6a0cc1587b
|
@ -378,10 +378,12 @@ public class StylesTable extends POIXMLDocumentPart {
|
|||
// Formats
|
||||
CTNumFmts formats = CTNumFmts.Factory.newInstance();
|
||||
formats.setCount(numberFormats.size());
|
||||
for (Entry<Integer, String> fmt : numberFormats.entrySet()) {
|
||||
CTNumFmt ctFmt = formats.addNewNumFmt();
|
||||
ctFmt.setNumFmtId(fmt.getKey());
|
||||
ctFmt.setFormatCode(fmt.getValue());
|
||||
for (int fmtId=0; fmtId<usedNumberFormats.length; fmtId++) {
|
||||
if (usedNumberFormats[fmtId]) {
|
||||
CTNumFmt ctFmt = formats.addNewNumFmt();
|
||||
ctFmt.setNumFmtId(fmtId);
|
||||
ctFmt.setFormatCode(numberFormats.get(fmtId));
|
||||
}
|
||||
}
|
||||
styleSheet.setNumFmts(formats);
|
||||
|
||||
|
|
Loading…
Reference in New Issue