-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add-FilterPrivacy-to-workbookPr #1154
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,11 @@ func (o CodeName) setWorkbookPrOption(pr *xlsxWorkbookPr) { | |
pr.CodeName = string(o) | ||
} | ||
|
||
// setWorkbookPrOption implements the WorkbookPrOption interface. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest the get and set implement functions following the order in OOXML Spec, move this function before |
||
func (o FilterPrivacy) setWorkbookPrOption(pr *xlsxWorkbookPr) { | ||
pr.FilterPrivacy = bool(o) | ||
} | ||
|
||
// GetWorkbookPrOptions provides a function to gets workbook properties. | ||
// | ||
// Available options: | ||
|
@@ -145,3 +150,13 @@ func (o *CodeName) getWorkbookPrOption(pr *xlsxWorkbookPr) { | |
} | ||
*o = CodeName(pr.CodeName) | ||
} | ||
|
||
// getWorkbookPrOption implements the WorkbookPrOption interface and get the | ||
// filter privacy of thw workbook. | ||
func (o *FilterPrivacy) getWorkbookPrOption(pr *xlsxWorkbookPr) { | ||
if pr == nil { | ||
*o = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This case was not been tested, please add a test case for this. |
||
return | ||
} | ||
*o = FilterPrivacy(pr.FilterPrivacy) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
filterPrivacy
attribute didn't belong to worksheets properties, so I suggest defining it in theworkbook.go
, and correct doc comment for it.