2017-08-28 20:56:18 -05:00
|
|
|
// Copyright 2017 Baliance. All rights reserved.
|
|
|
|
//
|
2017-09-09 10:21:47 -05:00
|
|
|
// DO NOT EDIT: generated by gooxml ECMA-376 generator
|
|
|
|
//
|
2017-08-28 20:56:18 -05:00
|
|
|
// 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 chart
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/xml"
|
|
|
|
|
2017-09-29 20:52:19 -05:00
|
|
|
"baliance.com/gooxml"
|
2017-09-23 08:39:08 -05:00
|
|
|
"baliance.com/gooxml/schema/soo/dml"
|
2017-08-28 20:56:18 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type CT_DTable struct {
|
|
|
|
ShowHorzBorder *CT_Boolean
|
|
|
|
ShowVertBorder *CT_Boolean
|
|
|
|
ShowOutline *CT_Boolean
|
|
|
|
ShowKeys *CT_Boolean
|
2017-09-23 08:39:08 -05:00
|
|
|
SpPr *dml.CT_ShapeProperties
|
|
|
|
TxPr *dml.CT_TextBody
|
2017-08-28 20:56:18 -05:00
|
|
|
ExtLst *CT_ExtensionList
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewCT_DTable() *CT_DTable {
|
|
|
|
ret := &CT_DTable{}
|
|
|
|
return ret
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_DTable) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
|
|
|
e.EncodeToken(start)
|
|
|
|
if m.ShowHorzBorder != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
seshowHorzBorder := xml.StartElement{Name: xml.Name{Local: "c:showHorzBorder"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.ShowHorzBorder, seshowHorzBorder)
|
|
|
|
}
|
|
|
|
if m.ShowVertBorder != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
seshowVertBorder := xml.StartElement{Name: xml.Name{Local: "c:showVertBorder"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.ShowVertBorder, seshowVertBorder)
|
|
|
|
}
|
|
|
|
if m.ShowOutline != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
seshowOutline := xml.StartElement{Name: xml.Name{Local: "c:showOutline"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.ShowOutline, seshowOutline)
|
|
|
|
}
|
|
|
|
if m.ShowKeys != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
seshowKeys := xml.StartElement{Name: xml.Name{Local: "c:showKeys"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.ShowKeys, seshowKeys)
|
|
|
|
}
|
|
|
|
if m.SpPr != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
sespPr := xml.StartElement{Name: xml.Name{Local: "c:spPr"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.SpPr, sespPr)
|
|
|
|
}
|
|
|
|
if m.TxPr != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
setxPr := xml.StartElement{Name: xml.Name{Local: "c:txPr"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.TxPr, setxPr)
|
|
|
|
}
|
|
|
|
if m.ExtLst != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
seextLst := xml.StartElement{Name: xml.Name{Local: "c:extLst"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.ExtLst, seextLst)
|
|
|
|
}
|
|
|
|
e.EncodeToken(xml.EndElement{Name: start.Name})
|
|
|
|
return nil
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_DTable) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
|
|
|
// initialize to default
|
|
|
|
lCT_DTable:
|
|
|
|
for {
|
|
|
|
tok, err := d.Token()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
switch el := tok.(type) {
|
|
|
|
case xml.StartElement:
|
2017-09-10 10:02:39 -05:00
|
|
|
switch el.Name {
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "showHorzBorder"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "showHorzBorder"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.ShowHorzBorder = NewCT_Boolean()
|
|
|
|
if err := d.DecodeElement(m.ShowHorzBorder, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "showVertBorder"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "showVertBorder"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.ShowVertBorder = NewCT_Boolean()
|
|
|
|
if err := d.DecodeElement(m.ShowVertBorder, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "showOutline"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "showOutline"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.ShowOutline = NewCT_Boolean()
|
|
|
|
if err := d.DecodeElement(m.ShowOutline, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "showKeys"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "showKeys"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.ShowKeys = NewCT_Boolean()
|
|
|
|
if err := d.DecodeElement(m.ShowKeys, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "spPr"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "spPr"}:
|
2017-09-23 08:39:08 -05:00
|
|
|
m.SpPr = dml.NewCT_ShapeProperties()
|
2017-08-28 20:56:18 -05:00
|
|
|
if err := d.DecodeElement(m.SpPr, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "txPr"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "txPr"}:
|
2017-09-23 08:39:08 -05:00
|
|
|
m.TxPr = dml.NewCT_TextBody()
|
2017-08-28 20:56:18 -05:00
|
|
|
if err := d.DecodeElement(m.TxPr, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "extLst"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "extLst"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.ExtLst = NewCT_ExtensionList()
|
|
|
|
if err := d.DecodeElement(m.ExtLst, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
default:
|
2017-09-29 20:52:19 -05:00
|
|
|
gooxml.Log("skipping unsupported element on CT_DTable %v", el.Name)
|
2017-08-28 20:56:18 -05:00
|
|
|
if err := d.Skip(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case xml.EndElement:
|
|
|
|
break lCT_DTable
|
|
|
|
case xml.CharData:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
|
|
|
// Validate validates the CT_DTable and its children
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_DTable) Validate() error {
|
|
|
|
return m.ValidateWithPath("CT_DTable")
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
|
|
|
// ValidateWithPath validates the CT_DTable and its children, prefixing error messages with path
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_DTable) ValidateWithPath(path string) error {
|
|
|
|
if m.ShowHorzBorder != nil {
|
|
|
|
if err := m.ShowHorzBorder.ValidateWithPath(path + "/ShowHorzBorder"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.ShowVertBorder != nil {
|
|
|
|
if err := m.ShowVertBorder.ValidateWithPath(path + "/ShowVertBorder"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.ShowOutline != nil {
|
|
|
|
if err := m.ShowOutline.ValidateWithPath(path + "/ShowOutline"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.ShowKeys != nil {
|
|
|
|
if err := m.ShowKeys.ValidateWithPath(path + "/ShowKeys"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.SpPr != nil {
|
|
|
|
if err := m.SpPr.ValidateWithPath(path + "/SpPr"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.TxPr != nil {
|
|
|
|
if err := m.TxPr.ValidateWithPath(path + "/TxPr"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.ExtLst != nil {
|
|
|
|
if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|