|
|
@ -14,7 +14,6 @@ package excelize
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"bytes"
|
|
|
|
"encoding/xml"
|
|
|
|
"encoding/xml"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"reflect"
|
|
|
|
"reflect"
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -76,7 +75,7 @@ func (f *File) SetAppProps(appProperties *AppProperties) (err error) {
|
|
|
|
app = new(xlsxProperties)
|
|
|
|
app = new(xlsxProperties)
|
|
|
|
if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathDocPropsApp)))).
|
|
|
|
if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathDocPropsApp)))).
|
|
|
|
Decode(app); err != nil && err != io.EOF {
|
|
|
|
Decode(app); err != nil && err != io.EOF {
|
|
|
|
err = fmt.Errorf("xml decode error: %s", err)
|
|
|
|
err = newDecodeXMLError(err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fields = []string{"Application", "ScaleCrop", "DocSecurity", "Company", "LinksUpToDate", "HyperlinksChanged", "AppVersion"}
|
|
|
|
fields = []string{"Application", "ScaleCrop", "DocSecurity", "Company", "LinksUpToDate", "HyperlinksChanged", "AppVersion"}
|
|
|
@ -103,7 +102,7 @@ func (f *File) GetAppProps() (ret *AppProperties, err error) {
|
|
|
|
app := new(xlsxProperties)
|
|
|
|
app := new(xlsxProperties)
|
|
|
|
if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathDocPropsApp)))).
|
|
|
|
if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathDocPropsApp)))).
|
|
|
|
Decode(app); err != nil && err != io.EOF {
|
|
|
|
Decode(app); err != nil && err != io.EOF {
|
|
|
|
err = fmt.Errorf("xml decode error: %s", err)
|
|
|
|
err = newDecodeXMLError(err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ret, err = &AppProperties{
|
|
|
|
ret, err = &AppProperties{
|
|
|
@ -181,7 +180,7 @@ func (f *File) SetDocProps(docProperties *DocProperties) (err error) {
|
|
|
|
core = new(decodeCoreProperties)
|
|
|
|
core = new(decodeCoreProperties)
|
|
|
|
if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathDocPropsCore)))).
|
|
|
|
if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathDocPropsCore)))).
|
|
|
|
Decode(core); err != nil && err != io.EOF {
|
|
|
|
Decode(core); err != nil && err != io.EOF {
|
|
|
|
err = fmt.Errorf("xml decode error: %s", err)
|
|
|
|
err = newDecodeXMLError(err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
newProps, err = &xlsxCoreProperties{
|
|
|
|
newProps, err = &xlsxCoreProperties{
|
|
|
@ -236,7 +235,7 @@ func (f *File) GetDocProps() (ret *DocProperties, err error) {
|
|
|
|
|
|
|
|
|
|
|
|
if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathDocPropsCore)))).
|
|
|
|
if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathDocPropsCore)))).
|
|
|
|
Decode(core); err != nil && err != io.EOF {
|
|
|
|
Decode(core); err != nil && err != io.EOF {
|
|
|
|
err = fmt.Errorf("xml decode error: %s", err)
|
|
|
|
err = newDecodeXMLError(err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ret, err = &DocProperties{
|
|
|
|
ret, err = &DocProperties{
|
|
|
|