diff options
author | xuri <xuri.me@gmail.com> | 2022-01-27 22:37:32 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-01-27 22:37:32 +0800 |
commit | 156bf6d16ecbd5257d81e781138eaaaf357ffbec (patch) | |
tree | 1f0e630121f6368e004734f176f6d1549988f176 /merge.go | |
parent | 3ee3c38f9c63de3782fad21aae9c05ee0530fc32 (diff) |
This closes #1129, make cell support inheritance columns/rows style
Correct cells style in merge range
Fix incorrect style ID returned on getting cell style in some cases
Unit test updated and simplified code
Diffstat (limited to 'merge.go')
-rw-r--r-- | merge.go | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -11,7 +11,9 @@ package excelize -import "strings" +import ( + "strings" +) // Rect gets merged cell rectangle coordinates sequence. func (mc *xlsxMergeCell) Rect() ([]int, error) { @@ -68,7 +70,8 @@ func (f *File) MergeCell(sheet, hCell, vCell string) error { ws.MergeCells = &xlsxMergeCells{Cells: []*xlsxMergeCell{{Ref: ref, rect: rect}}} } ws.MergeCells.Count = len(ws.MergeCells.Cells) - return err + styleID, _ := f.GetCellStyle(sheet, hCell) + return f.SetCellStyle(sheet, hCell, vCell, styleID) } // UnmergeCell provides a function to unmerge a given coordinate area. |