mirror of https://github.com/apache/poi.git
write for loop for performance and readability
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1721924 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ec73bc3e21
commit
356637f283
|
@ -1020,11 +1020,9 @@ public class TestXSSFCellStyle {
|
||||||
|
|
||||||
public static void copyStyles(Workbook reference, Workbook target) {
|
public static void copyStyles(Workbook reference, Workbook target) {
|
||||||
final short numberOfStyles = reference.getNumCellStyles();
|
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);
|
final CellStyle referenceStyle = reference.getCellStyleAt(i);
|
||||||
if (i == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
final CellStyle targetStyle = target.createCellStyle();
|
final CellStyle targetStyle = target.createCellStyle();
|
||||||
targetStyle.cloneStyleFrom(referenceStyle);
|
targetStyle.cloneStyleFrom(referenceStyle);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue