Commit 387ed72
committed
Fix BIFF8 DIMENSIONS record to use 0-based column indices
The XLS writer incorrectly used 1-based column indices in the BIFF8
DIMENSIONS record, violating the Microsoft Excel Binary File Format
specification which requires 0-based indices.
This bug caused an extra empty column to appear when converting XLS
files to other formats (e.g., CSV).
Changes:
- Modified column index initialization to subtract 1 from the result
of Coordinate::columnIndexFromString() to convert from 1-based to
0-based indexing
- Updated COLINFO loop to use the corrected 0-based lastColumnIndex
Per BIFF8 specification:
- colMic (first column) must be 0-based
- colMac (column after last column) must be 0-based
Example: For columns A-G (7 columns):
- Before: colMic=1, colMac=8 (incorrect)
- After: colMic=0, colMac=7 (correct)
Fixes #46821 parent eecfb67 commit 387ed72
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| |||
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
261 | | - | |
| 262 | + | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| |||
0 commit comments