From 356637f28361572940e099aa959f11bbf8aec86a Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Mon, 28 Dec 2015 14:20:30 +0000 Subject: [PATCH] write for loop for performance and readability git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1721924 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java index eb439bc476..b02ac2713f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java @@ -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); } -- 2.39.5