poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1677370 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java
Date Sun, 03 May 2015 07:59:18 GMT
Author: nick
Date: Sun May  3 07:59:18 2015
New Revision: 1677370

URL: http://svn.apache.org/r1677370
Log:
Ensure consistent ordering when writing out formats following changes in r1677368

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java?rev=1677370&r1=1677369&r2=1677370&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java Sun May  3 07:59:18
2015
@@ -378,10 +378,12 @@ public class StylesTable extends POIXMLD
         // 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);
 



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


Mime
View raw message