mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-29 13:49:10 +08:00
spreadsheet: recompute sheet dimensions prior to save
This commit is contained in:
parent
c5be4536a9
commit
551e748377
BIN
spreadsheet/testdata/simple-1.xlsx
vendored
BIN
spreadsheet/testdata/simple-1.xlsx
vendored
Binary file not shown.
BIN
spreadsheet/testdata/simple-2.xlsx
vendored
BIN
spreadsheet/testdata/simple-2.xlsx
vendored
Binary file not shown.
@ -155,6 +155,9 @@ func (wb *Workbook) Save(w io.Writer) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for i, sheet := range wb.xws {
|
for i, sheet := range wb.xws {
|
||||||
|
// recalculate sheet dimensions
|
||||||
|
sheet.Dimension.RefAttr = Sheet{wb, nil, sheet}.Extents()
|
||||||
|
|
||||||
fn := gooxml.AbsoluteFilename(dt, gooxml.WorksheetType, i+1)
|
fn := gooxml.AbsoluteFilename(dt, gooxml.WorksheetType, i+1)
|
||||||
zippkg.MarshalXML(z, fn, sheet)
|
zippkg.MarshalXML(z, fn, sheet)
|
||||||
zippkg.MarshalXML(z, zippkg.RelationsPathFor(fn), wb.xwsRels[i].X())
|
zippkg.MarshalXML(z, zippkg.RelationsPathFor(fn), wb.xwsRels[i].X())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user