diff options
| author | xuri <xuri.me@gmail.com> | 2022-10-24 00:02:22 +0800 | 
|---|---|---|
| committer | xuri <xuri.me@gmail.com> | 2022-10-24 00:52:09 +0800 | 
| commit | 14c6a198ce27b44fcce5447a2b757ce403ebb8fc (patch) | |
| tree | a59eea77f6e6d691a1015afa2b3629cbe7cc695b /sheetpr.go | |
| parent | f843a9ea56710deb4cdb77ea2cd3a08d8d82d3e6 (diff) | |
Support get cell value which contains a date in the ISO 8601 format
- Support set and get font color with indexed color
- New export variable `IndexedColorMapping`
- Fix getting incorrect page margin settings when the margin is 0
- Update unit tests and comments typo fixes
- ref #65, new formula functions: AGGREGATE and SUBTOTAL
Diffstat (limited to 'sheetpr.go')
| -rw-r--r-- | sheetpr.go | 26 | 
1 files changed, 7 insertions, 19 deletions
| @@ -80,24 +80,12 @@ func (f *File) GetPageMargins(sheet string) (PageLayoutMarginsOptions, error) {  		return opts, err  	}  	if ws.PageMargins != nil { -		if ws.PageMargins.Bottom != 0 { -			opts.Bottom = float64Ptr(ws.PageMargins.Bottom) -		} -		if ws.PageMargins.Footer != 0 { -			opts.Footer = float64Ptr(ws.PageMargins.Footer) -		} -		if ws.PageMargins.Header != 0 { -			opts.Header = float64Ptr(ws.PageMargins.Header) -		} -		if ws.PageMargins.Left != 0 { -			opts.Left = float64Ptr(ws.PageMargins.Left) -		} -		if ws.PageMargins.Right != 0 { -			opts.Right = float64Ptr(ws.PageMargins.Right) -		} -		if ws.PageMargins.Top != 0 { -			opts.Top = float64Ptr(ws.PageMargins.Top) -		} +		opts.Bottom = float64Ptr(ws.PageMargins.Bottom) +		opts.Footer = float64Ptr(ws.PageMargins.Footer) +		opts.Header = float64Ptr(ws.PageMargins.Header) +		opts.Left = float64Ptr(ws.PageMargins.Left) +		opts.Right = float64Ptr(ws.PageMargins.Right) +		opts.Top = float64Ptr(ws.PageMargins.Top)  	}  	if ws.PrintOptions != nil {  		opts.Horizontally = boolPtr(ws.PrintOptions.HorizontalCentered) @@ -106,7 +94,7 @@ func (f *File) GetPageMargins(sheet string) (PageLayoutMarginsOptions, error) {  	return opts, err  } -// prepareSheetPr sheetPr element if which not exist. +// prepareSheetPr create sheetPr element which not exist.  func (ws *xlsxWorksheet) prepareSheetPr() {  	if ws.SheetPr == nil {  		ws.SheetPr = new(xlsxSheetPr) | 
