From b96329cc88b87da25a4389f1d4d5ad08cd40605a Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 12 Jan 2022 00:18:15 +0800 Subject: Breaking change for data validation and fixed #1117 - Remove second useless parameter `isCurrentSheet` of the function `SetSqrefDropList` - Fix missing page setup of worksheet after re-saving the spreadsheet --- sheet.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sheet.go') diff --git a/sheet.go b/sheet.go index 3eea6dc..2426bf8 100644 --- a/sheet.go +++ b/sheet.go @@ -1335,49 +1335,49 @@ func (o *PageLayoutOrientation) getPageLayout(ps *xlsxPageSetUp) { // setPageLayout provides a method to set the paper size for the worksheet. func (p PageLayoutPaperSize) setPageLayout(ps *xlsxPageSetUp) { - ps.PaperSize = int(p) + ps.PaperSize = intPtr(int(p)) } // getPageLayout provides a method to get the paper size for the worksheet. func (p *PageLayoutPaperSize) getPageLayout(ps *xlsxPageSetUp) { // Excel default: 1 - if ps == nil || ps.PaperSize == 0 { + if ps == nil || ps.PaperSize == nil { *p = 1 return } - *p = PageLayoutPaperSize(ps.PaperSize) + *p = PageLayoutPaperSize(*ps.PaperSize) } // setPageLayout provides a method to set the fit to height for the worksheet. func (p FitToHeight) setPageLayout(ps *xlsxPageSetUp) { if int(p) > 0 { - ps.FitToHeight = int(p) + ps.FitToHeight = intPtr(int(p)) } } // getPageLayout provides a method to get the fit to height for the worksheet. func (p *FitToHeight) getPageLayout(ps *xlsxPageSetUp) { - if ps == nil || ps.FitToHeight == 0 { + if ps == nil || ps.FitToHeight == nil { *p = 1 return } - *p = FitToHeight(ps.FitToHeight) + *p = FitToHeight(*ps.FitToHeight) } // setPageLayout provides a method to set the fit to width for the worksheet. func (p FitToWidth) setPageLayout(ps *xlsxPageSetUp) { if int(p) > 0 { - ps.FitToWidth = int(p) + ps.FitToWidth = intPtr(int(p)) } } // getPageLayout provides a method to get the fit to width for the worksheet. func (p *FitToWidth) getPageLayout(ps *xlsxPageSetUp) { - if ps == nil || ps.FitToWidth == 0 { + if ps == nil || ps.FitToWidth == nil { *p = 1 return } - *p = FitToWidth(ps.FitToWidth) + *p = FitToWidth(*ps.FitToWidth) } // setPageLayout provides a method to set the scale for the worksheet. -- cgit v1.2.1