poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1721924 - /poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java
Date Mon, 28 Dec 2015 14:20:31 GMT
Author: onealj
Date: Mon Dec 28 14:20:30 2015
New Revision: 1721924

URL: http://svn.apache.org/viewvc?rev=1721924&view=rev
Log:
write for loop for performance and readability

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java?rev=1721924&r1=1721923&r2=1721924&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java Mon
Dec 28 14:20:30 2015
@@ -1020,11 +1020,9 @@ public class TestXSSFCellStyle {
 
     public static void copyStyles(Workbook reference, Workbook target) {
         final short numberOfStyles = reference.getNumCellStyles();
-        for (short i = 0; i < numberOfStyles; i++) {
+        // don't copy default style (style index 0)
+        for (short i = 1; i < numberOfStyles; i++) {
             final CellStyle referenceStyle = reference.getCellStyleAt(i);
-            if (i == 0) {
-                continue;
-            }
             final CellStyle targetStyle = target.createCellStyle();
             targetStyle.cloneStyleFrom(referenceStyle);
         }



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


Mime
View raw message