diff options
author | xuri <xuri.me@gmail.com> | 2022-08-13 11:21:59 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-08-13 11:21:59 +0800 |
commit | 551fb8a9e4b03fe718a339e75aeacc8b5581378a (patch) | |
tree | 17e38203f802da690e709072305476b450a620ac /docProps.go | |
parent | 8152bbb2cec76f074dc18c43f3c66bf8abdf9de0 (diff) |
This closes #1244 and closes #1314, improving the compatibility with Google Sheet
- Format code with `gofmt`
Diffstat (limited to 'docProps.go')
-rw-r--r-- | docProps.go | 170 |
1 files changed, 84 insertions, 86 deletions
diff --git a/docProps.go b/docProps.go index fe6f214..df15b57 100644 --- a/docProps.go +++ b/docProps.go @@ -22,50 +22,49 @@ import ( // SetAppProps provides a function to set document application properties. The // properties that can be set are: // -// Property | Description -// -------------------+-------------------------------------------------------------------------- -// Application | The name of the application that created this document. -// | -// ScaleCrop | Indicates the display mode of the document thumbnail. Set this element -// | to 'true' to enable scaling of the document thumbnail to the display. Set -// | this element to 'false' to enable cropping of the document thumbnail to -// | show only sections that will fit the display. -// | -// DocSecurity | Security level of a document as a numeric value. Document security is -// | defined as: -// | 1 - Document is password protected. -// | 2 - Document is recommended to be opened as read-only. -// | 3 - Document is enforced to be opened as read-only. -// | 4 - Document is locked for annotation. -// | -// Company | The name of a company associated with the document. -// | -// LinksUpToDate | Indicates whether hyperlinks in a document are up-to-date. Set this -// | element to 'true' to indicate that hyperlinks are updated. Set this -// | element to 'false' to indicate that hyperlinks are outdated. -// | -// HyperlinksChanged | Specifies that one or more hyperlinks in this part were updated -// | exclusively in this part by a producer. The next producer to open this -// | document shall update the hyperlink relationships with the new -// | hyperlinks specified in this part. -// | -// AppVersion | Specifies the version of the application which produced this document. -// | The content of this element shall be of the form XX.YYYY where X and Y -// | represent numerical values, or the document shall be considered -// | non-conformant. +// Property | Description +// -------------------+-------------------------------------------------------------------------- +// Application | The name of the application that created this document. +// | +// ScaleCrop | Indicates the display mode of the document thumbnail. Set this element +// | to 'true' to enable scaling of the document thumbnail to the display. Set +// | this element to 'false' to enable cropping of the document thumbnail to +// | show only sections that will fit the display. +// | +// DocSecurity | Security level of a document as a numeric value. Document security is +// | defined as: +// | 1 - Document is password protected. +// | 2 - Document is recommended to be opened as read-only. +// | 3 - Document is enforced to be opened as read-only. +// | 4 - Document is locked for annotation. +// | +// Company | The name of a company associated with the document. +// | +// LinksUpToDate | Indicates whether hyperlinks in a document are up-to-date. Set this +// | element to 'true' to indicate that hyperlinks are updated. Set this +// | element to 'false' to indicate that hyperlinks are outdated. +// | +// HyperlinksChanged | Specifies that one or more hyperlinks in this part were updated +// | exclusively in this part by a producer. The next producer to open this +// | document shall update the hyperlink relationships with the new +// | hyperlinks specified in this part. +// | +// AppVersion | Specifies the version of the application which produced this document. +// | The content of this element shall be of the form XX.YYYY where X and Y +// | represent numerical values, or the document shall be considered +// | non-conformant. // // For example: // -// err := f.SetAppProps(&excelize.AppProperties{ -// Application: "Microsoft Excel", -// ScaleCrop: true, -// DocSecurity: 3, -// Company: "Company Name", -// LinksUpToDate: true, -// HyperlinksChanged: true, -// AppVersion: "16.0000", -// }) -// +// err := f.SetAppProps(&excelize.AppProperties{ +// Application: "Microsoft Excel", +// ScaleCrop: true, +// DocSecurity: 3, +// Company: "Company Name", +// LinksUpToDate: true, +// HyperlinksChanged: true, +// AppVersion: "16.0000", +// }) func (f *File) SetAppProps(appProperties *AppProperties) (err error) { var ( app *xlsxProperties @@ -122,54 +121,53 @@ func (f *File) GetAppProps() (ret *AppProperties, err error) { // SetDocProps provides a function to set document core properties. The // properties that can be set are: // -// Property | Description -// ----------------+----------------------------------------------------------------------------- -// Title | The name given to the resource. -// | -// Subject | The topic of the content of the resource. -// | -// Creator | An entity primarily responsible for making the content of the resource. -// | -// Keywords | A delimited set of keywords to support searching and indexing. This is -// | typically a list of terms that are not available elsewhere in the properties. -// | -// Description | An explanation of the content of the resource. -// | -// LastModifiedBy | The user who performed the last modification. The identification is -// | environment-specific. -// | -// Language | The language of the intellectual content of the resource. -// | -// Identifier | An unambiguous reference to the resource within a given context. -// | -// Revision | The topic of the content of the resource. -// | -// ContentStatus | The status of the content. For example: Values might include "Draft", -// | "Reviewed" and "Final" -// | -// Category | A categorization of the content of this package. -// | -// Version | The version number. This value is set by the user or by the application. +// Property | Description +// ----------------+----------------------------------------------------------------------------- +// Title | The name given to the resource. +// | +// Subject | The topic of the content of the resource. +// | +// Creator | An entity primarily responsible for making the content of the resource. +// | +// Keywords | A delimited set of keywords to support searching and indexing. This is +// | typically a list of terms that are not available elsewhere in the properties. +// | +// Description | An explanation of the content of the resource. +// | +// LastModifiedBy | The user who performed the last modification. The identification is +// | environment-specific. +// | +// Language | The language of the intellectual content of the resource. +// | +// Identifier | An unambiguous reference to the resource within a given context. +// | +// Revision | The topic of the content of the resource. +// | +// ContentStatus | The status of the content. For example: Values might include "Draft", +// | "Reviewed" and "Final" +// | +// Category | A categorization of the content of this package. +// | +// Version | The version number. This value is set by the user or by the application. // // For example: // -// err := f.SetDocProps(&excelize.DocProperties{ -// Category: "category", -// ContentStatus: "Draft", -// Created: "2019-06-04T22:00:10Z", -// Creator: "Go Excelize", -// Description: "This file created by Go Excelize", -// Identifier: "xlsx", -// Keywords: "Spreadsheet", -// LastModifiedBy: "Go Author", -// Modified: "2019-06-04T22:00:10Z", -// Revision: "0", -// Subject: "Test Subject", -// Title: "Test Title", -// Language: "en-US", -// Version: "1.0.0", -// }) -// +// err := f.SetDocProps(&excelize.DocProperties{ +// Category: "category", +// ContentStatus: "Draft", +// Created: "2019-06-04T22:00:10Z", +// Creator: "Go Excelize", +// Description: "This file created by Go Excelize", +// Identifier: "xlsx", +// Keywords: "Spreadsheet", +// LastModifiedBy: "Go Author", +// Modified: "2019-06-04T22:00:10Z", +// Revision: "0", +// Subject: "Test Subject", +// Title: "Test Title", +// Language: "en-US", +// Version: "1.0.0", +// }) func (f *File) SetDocProps(docProperties *DocProperties) (err error) { var ( core *decodeCoreProperties |