Skip to content

Commit 3c6fa4a

Browse files
committed
Fixed cell region span number calculation
1 parent 146cc13 commit 3c6fa4a

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
}
88

99
group = "com.apurebase"
10-
version = "1.1.1"
10+
version = "1.1.2"
1111

1212
repositories {
1313
jcenter()

src/main/kotlin/com/apurebase/excel/ExcelRowDSL.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public class ExcelRowDSL(public val currentRow: Int) {
102102
is ExcelRegionDSL -> {
103103
val innerRegions = cell.buildAndApply(workbook, sheet, row.rowNum, currentColIndex)
104104
ranges.addAll(innerRegions)
105-
currentColIndex += cell.colSpan + 1
105+
currentColIndex += cell.colSpan
106106
}
107107
else -> throw TODO("Implementation not supported")
108108
}

src/test/kotlin/com/apurebase/excel/Test1.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,24 @@ fun main() {
2020
}
2121
}
2222
}
23+
excel {
24+
sheet {
25+
row {
26+
cell("column 1")
27+
cellRegion(3) {
28+
row {
29+
cell("column 2-4")
30+
}
31+
}
32+
cell("Column 5")
33+
}
34+
row {
35+
cell("Value 1")
36+
cell("Value 2-4")
37+
cell("Value 2-4")
38+
cell("Value 2-4")
39+
cell("Value 5")
40+
}
41+
}
42+
}
2343
}

0 commit comments

Comments
 (0)