1 Star 2 Fork 1

wx-fork / unioffice

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Properties.go 8.43 KB
一键复制 编辑 原始数据 按行查看 历史
Todd 提交于 2017-09-29 20:52 . gooxml: add and use a Log function
// Copyright 2017 Baliance. All rights reserved.
//
// DO NOT EDIT: generated by gooxml ECMA-376 generator
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundation and
// appearing in the file LICENSE included in the packaging of this file. A
// commercial license can be purchased by contacting sales@baliance.com.
package extended_properties
import (
"encoding/xml"
"baliance.com/gooxml"
)
type Properties struct {
CT_Properties
}
func NewProperties() *Properties {
ret := &Properties{}
ret.CT_Properties = *NewCT_Properties()
return ret
}
func (m *Properties) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"})
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:vt"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"})
start.Name.Local = "Properties"
return m.CT_Properties.MarshalXML(e, start)
}
func (m *Properties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
// initialize to default
m.CT_Properties = *NewCT_Properties()
lProperties:
for {
tok, err := d.Token()
if err != nil {
return err
}
switch el := tok.(type) {
case xml.StartElement:
switch el.Name {
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Template"}:
m.Template = new(string)
if err := d.DecodeElement(m.Template, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Manager"}:
m.Manager = new(string)
if err := d.DecodeElement(m.Manager, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Company"}:
m.Company = new(string)
if err := d.DecodeElement(m.Company, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Pages"}:
m.Pages = new(int32)
if err := d.DecodeElement(m.Pages, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Words"}:
m.Words = new(int32)
if err := d.DecodeElement(m.Words, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Characters"}:
m.Characters = new(int32)
if err := d.DecodeElement(m.Characters, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "PresentationFormat"}:
m.PresentationFormat = new(string)
if err := d.DecodeElement(m.PresentationFormat, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Lines"}:
m.Lines = new(int32)
if err := d.DecodeElement(m.Lines, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Paragraphs"}:
m.Paragraphs = new(int32)
if err := d.DecodeElement(m.Paragraphs, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Slides"}:
m.Slides = new(int32)
if err := d.DecodeElement(m.Slides, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Notes"}:
m.Notes = new(int32)
if err := d.DecodeElement(m.Notes, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "TotalTime"}:
m.TotalTime = new(int32)
if err := d.DecodeElement(m.TotalTime, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HiddenSlides"}:
m.HiddenSlides = new(int32)
if err := d.DecodeElement(m.HiddenSlides, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "MMClips"}:
m.MMClips = new(int32)
if err := d.DecodeElement(m.MMClips, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "ScaleCrop"}:
m.ScaleCrop = new(bool)
if err := d.DecodeElement(m.ScaleCrop, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HeadingPairs"}:
m.HeadingPairs = NewCT_VectorVariant()
if err := d.DecodeElement(m.HeadingPairs, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "TitlesOfParts"}:
m.TitlesOfParts = NewCT_VectorLpstr()
if err := d.DecodeElement(m.TitlesOfParts, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "LinksUpToDate"}:
m.LinksUpToDate = new(bool)
if err := d.DecodeElement(m.LinksUpToDate, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "CharactersWithSpaces"}:
m.CharactersWithSpaces = new(int32)
if err := d.DecodeElement(m.CharactersWithSpaces, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "SharedDoc"}:
m.SharedDoc = new(bool)
if err := d.DecodeElement(m.SharedDoc, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HyperlinkBase"}:
m.HyperlinkBase = new(string)
if err := d.DecodeElement(m.HyperlinkBase, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HLinks"}:
m.HLinks = NewCT_VectorVariant()
if err := d.DecodeElement(m.HLinks, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HyperlinksChanged"}:
m.HyperlinksChanged = new(bool)
if err := d.DecodeElement(m.HyperlinksChanged, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "DigSig"}:
m.DigSig = NewCT_DigSigBlob()
if err := d.DecodeElement(m.DigSig, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Application"}:
m.Application = new(string)
if err := d.DecodeElement(m.Application, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "AppVersion"}:
m.AppVersion = new(string)
if err := d.DecodeElement(m.AppVersion, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "DocSecurity"}:
m.DocSecurity = new(int32)
if err := d.DecodeElement(m.DocSecurity, &el); err != nil {
return err
}
default:
gooxml.Log("skipping unsupported element on Properties %v", el.Name)
if err := d.Skip(); err != nil {
return err
}
}
case xml.EndElement:
break lProperties
case xml.CharData:
}
}
return nil
}
// Validate validates the Properties and its children
func (m *Properties) Validate() error {
return m.ValidateWithPath("Properties")
}
// ValidateWithPath validates the Properties and its children, prefixing error messages with path
func (m *Properties) ValidateWithPath(path string) error {
if err := m.CT_Properties.ValidateWithPath(path); err != nil {
return err
}
return nil
}
1
https://gitee.com/wx-fork/unioffice.git
git@gitee.com:wx-fork/unioffice.git
wx-fork
unioffice
unioffice
v0.7.1

搜索帮助