forked from unidoc/unioffice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CT_TextListStyle.go
230 lines (221 loc) · 7.13 KB
/
CT_TextListStyle.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
// 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 dml
import (
"encoding/xml"
"baliance.com/gooxml"
)
type CT_TextListStyle struct {
DefPPr *CT_TextParagraphProperties
Lvl1pPr *CT_TextParagraphProperties
Lvl2pPr *CT_TextParagraphProperties
Lvl3pPr *CT_TextParagraphProperties
Lvl4pPr *CT_TextParagraphProperties
Lvl5pPr *CT_TextParagraphProperties
Lvl6pPr *CT_TextParagraphProperties
Lvl7pPr *CT_TextParagraphProperties
Lvl8pPr *CT_TextParagraphProperties
Lvl9pPr *CT_TextParagraphProperties
ExtLst *CT_OfficeArtExtensionList
}
func NewCT_TextListStyle() *CT_TextListStyle {
ret := &CT_TextListStyle{}
return ret
}
func (m *CT_TextListStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
e.EncodeToken(start)
if m.DefPPr != nil {
sedefPPr := xml.StartElement{Name: xml.Name{Local: "a:defPPr"}}
e.EncodeElement(m.DefPPr, sedefPPr)
}
if m.Lvl1pPr != nil {
selvl1pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl1pPr"}}
e.EncodeElement(m.Lvl1pPr, selvl1pPr)
}
if m.Lvl2pPr != nil {
selvl2pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl2pPr"}}
e.EncodeElement(m.Lvl2pPr, selvl2pPr)
}
if m.Lvl3pPr != nil {
selvl3pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl3pPr"}}
e.EncodeElement(m.Lvl3pPr, selvl3pPr)
}
if m.Lvl4pPr != nil {
selvl4pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl4pPr"}}
e.EncodeElement(m.Lvl4pPr, selvl4pPr)
}
if m.Lvl5pPr != nil {
selvl5pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl5pPr"}}
e.EncodeElement(m.Lvl5pPr, selvl5pPr)
}
if m.Lvl6pPr != nil {
selvl6pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl6pPr"}}
e.EncodeElement(m.Lvl6pPr, selvl6pPr)
}
if m.Lvl7pPr != nil {
selvl7pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl7pPr"}}
e.EncodeElement(m.Lvl7pPr, selvl7pPr)
}
if m.Lvl8pPr != nil {
selvl8pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl8pPr"}}
e.EncodeElement(m.Lvl8pPr, selvl8pPr)
}
if m.Lvl9pPr != nil {
selvl9pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl9pPr"}}
e.EncodeElement(m.Lvl9pPr, selvl9pPr)
}
if m.ExtLst != nil {
seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}}
e.EncodeElement(m.ExtLst, seextLst)
}
e.EncodeToken(xml.EndElement{Name: start.Name})
return nil
}
func (m *CT_TextListStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
// initialize to default
lCT_TextListStyle:
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/drawingml/2006/main", Local: "defPPr"}:
m.DefPPr = NewCT_TextParagraphProperties()
if err := d.DecodeElement(m.DefPPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl1pPr"}:
m.Lvl1pPr = NewCT_TextParagraphProperties()
if err := d.DecodeElement(m.Lvl1pPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl2pPr"}:
m.Lvl2pPr = NewCT_TextParagraphProperties()
if err := d.DecodeElement(m.Lvl2pPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl3pPr"}:
m.Lvl3pPr = NewCT_TextParagraphProperties()
if err := d.DecodeElement(m.Lvl3pPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl4pPr"}:
m.Lvl4pPr = NewCT_TextParagraphProperties()
if err := d.DecodeElement(m.Lvl4pPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl5pPr"}:
m.Lvl5pPr = NewCT_TextParagraphProperties()
if err := d.DecodeElement(m.Lvl5pPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl6pPr"}:
m.Lvl6pPr = NewCT_TextParagraphProperties()
if err := d.DecodeElement(m.Lvl6pPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl7pPr"}:
m.Lvl7pPr = NewCT_TextParagraphProperties()
if err := d.DecodeElement(m.Lvl7pPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl8pPr"}:
m.Lvl8pPr = NewCT_TextParagraphProperties()
if err := d.DecodeElement(m.Lvl8pPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl9pPr"}:
m.Lvl9pPr = NewCT_TextParagraphProperties()
if err := d.DecodeElement(m.Lvl9pPr, &el); err != nil {
return err
}
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}:
m.ExtLst = NewCT_OfficeArtExtensionList()
if err := d.DecodeElement(m.ExtLst, &el); err != nil {
return err
}
default:
gooxml.Log("skipping unsupported element on CT_TextListStyle %v", el.Name)
if err := d.Skip(); err != nil {
return err
}
}
case xml.EndElement:
break lCT_TextListStyle
case xml.CharData:
}
}
return nil
}
// Validate validates the CT_TextListStyle and its children
func (m *CT_TextListStyle) Validate() error {
return m.ValidateWithPath("CT_TextListStyle")
}
// ValidateWithPath validates the CT_TextListStyle and its children, prefixing error messages with path
func (m *CT_TextListStyle) ValidateWithPath(path string) error {
if m.DefPPr != nil {
if err := m.DefPPr.ValidateWithPath(path + "/DefPPr"); err != nil {
return err
}
}
if m.Lvl1pPr != nil {
if err := m.Lvl1pPr.ValidateWithPath(path + "/Lvl1pPr"); err != nil {
return err
}
}
if m.Lvl2pPr != nil {
if err := m.Lvl2pPr.ValidateWithPath(path + "/Lvl2pPr"); err != nil {
return err
}
}
if m.Lvl3pPr != nil {
if err := m.Lvl3pPr.ValidateWithPath(path + "/Lvl3pPr"); err != nil {
return err
}
}
if m.Lvl4pPr != nil {
if err := m.Lvl4pPr.ValidateWithPath(path + "/Lvl4pPr"); err != nil {
return err
}
}
if m.Lvl5pPr != nil {
if err := m.Lvl5pPr.ValidateWithPath(path + "/Lvl5pPr"); err != nil {
return err
}
}
if m.Lvl6pPr != nil {
if err := m.Lvl6pPr.ValidateWithPath(path + "/Lvl6pPr"); err != nil {
return err
}
}
if m.Lvl7pPr != nil {
if err := m.Lvl7pPr.ValidateWithPath(path + "/Lvl7pPr"); err != nil {
return err
}
}
if m.Lvl8pPr != nil {
if err := m.Lvl8pPr.ValidateWithPath(path + "/Lvl8pPr"); err != nil {
return err
}
}
if m.Lvl9pPr != nil {
if err := m.Lvl9pPr.ValidateWithPath(path + "/Lvl9pPr"); err != nil {
return err
}
}
if m.ExtLst != nil {
if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil {
return err
}
}
return nil
}