uniword 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/themes/office_format_scheme.xml +137 -0
- data/data/themes/office_theme.xml +2 -0
- data/lib/uniword/builder/comment_builder.rb +2 -1
- data/lib/uniword/builder/footnote_builder.rb +4 -2
- data/lib/uniword/builder/run_builder.rb +5 -0
- data/lib/uniword/document_input.rb +7 -0
- data/lib/uniword/document_writer.rb +1 -5
- data/lib/uniword/docx/package.rb +18 -0
- data/lib/uniword/docx/package_serialization.rb +38 -0
- data/lib/uniword/docx/reconciler.rb +159 -4
- data/lib/uniword/format_converter.rb +4 -19
- data/lib/uniword/has_run_position.rb +9 -0
- data/lib/uniword/lazy_loader.rb +1 -1
- data/lib/uniword/math/o_math.rb +3 -0
- data/lib/uniword/mhtml/document.rb +18 -0
- data/lib/uniword/properties/bold.rb +3 -33
- data/lib/uniword/properties/boolean_element_factory.rb +66 -0
- data/lib/uniword/properties/boolean_formatting.rb +15 -215
- data/lib/uniword/properties/italic.rb +3 -33
- data/lib/uniword/properties.rb +8 -3
- data/lib/uniword/schema/schema_loader.rb +1 -1
- data/lib/uniword/transformation/mhtml_element_renderer.rb +1 -1
- data/lib/uniword/version.rb +1 -1
- data/lib/uniword/wordprocessingml/attached_template.rb +18 -0
- data/lib/uniword/wordprocessingml/body.rb +18 -36
- data/lib/uniword/wordprocessingml/brk_bin.rb +17 -0
- data/lib/uniword/wordprocessingml/brk_bin_sub.rb +17 -0
- data/lib/uniword/wordprocessingml/character_spacing_control.rb +17 -0
- data/lib/uniword/wordprocessingml/clr_scheme_mapping.rb +39 -0
- data/lib/uniword/wordprocessingml/compat.rb +16 -0
- data/lib/uniword/wordprocessingml/decimal_symbol.rb +17 -0
- data/lib/uniword/wordprocessingml/def_jc.rb +17 -0
- data/lib/uniword/wordprocessingml/default_tab_stop.rb +17 -0
- data/lib/uniword/wordprocessingml/disp_def.rb +14 -0
- data/lib/uniword/wordprocessingml/do_not_display_page_boundaries.rb +14 -0
- data/lib/uniword/wordprocessingml/do_not_include_subdocs_in_stats.rb +17 -0
- data/lib/uniword/wordprocessingml/doc_vars.rb +36 -0
- data/lib/uniword/wordprocessingml/document_root.rb +17 -5
- data/lib/uniword/wordprocessingml/endnote_pr.rb +18 -0
- data/lib/uniword/wordprocessingml/endnotes.rb +18 -0
- data/lib/uniword/wordprocessingml/even_and_odd_headers.rb +17 -0
- data/lib/uniword/wordprocessingml/footnote_pos.rb +17 -0
- data/lib/uniword/wordprocessingml/footnote_pr.rb +20 -0
- data/lib/uniword/wordprocessingml/footnotes.rb +18 -0
- data/lib/uniword/wordprocessingml/hdr_shape_defaults.rb +19 -0
- data/lib/uniword/wordprocessingml/hyperlink.rb +3 -0
- data/lib/uniword/wordprocessingml/hyphenation_zone.rb +20 -0
- data/lib/uniword/wordprocessingml/int_lim.rb +17 -0
- data/lib/uniword/wordprocessingml/l_margin.rb +17 -0
- data/lib/uniword/wordprocessingml/list_separator.rb +17 -0
- data/lib/uniword/wordprocessingml/math_font.rb +17 -0
- data/lib/uniword/wordprocessingml/math_pr.rb +49 -0
- data/lib/uniword/wordprocessingml/mirror_margins.rb +17 -0
- data/lib/uniword/wordprocessingml/nary_lim.rb +17 -0
- data/lib/uniword/wordprocessingml/proof_state.rb +19 -0
- data/lib/uniword/wordprocessingml/r_margin.rb +17 -0
- data/lib/uniword/wordprocessingml/rsid.rb +17 -0
- data/lib/uniword/wordprocessingml/rsid_root.rb +17 -0
- data/lib/uniword/wordprocessingml/rsids.rb +22 -0
- data/lib/uniword/wordprocessingml/settings.rb +45 -511
- data/lib/uniword/wordprocessingml/shape_defaults.rb +21 -0
- data/lib/uniword/wordprocessingml/small_frac.rb +17 -0
- data/lib/uniword/wordprocessingml/style_pane_format_filter.rb +50 -0
- data/lib/uniword/wordprocessingml/style_pane_sort_method.rb +20 -0
- data/lib/uniword/wordprocessingml/table_cell.rb +6 -0
- data/lib/uniword/wordprocessingml/table_row_properties.rb +2 -0
- data/lib/uniword/wordprocessingml/theme_font_lang.rb +19 -0
- data/lib/uniword/wordprocessingml/w14_doc_id.rb +17 -0
- data/lib/uniword/wordprocessingml/w15_chart_tracking_ref_based.rb +14 -0
- data/lib/uniword/wordprocessingml/w15_doc_id.rb +17 -0
- data/lib/uniword/wordprocessingml/wrap_indent.rb +17 -0
- data/lib/uniword/wordprocessingml.rb +42 -56
- data/lib/uniword.rb +12 -5
- metadata +52 -3
- data/lib/uniword/ooxml/types/on_off_type.rb +0 -64
|
@@ -1,521 +1,38 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
|
+
require "nokogiri"
|
|
4
5
|
require_relative "../properties/relationship_id"
|
|
6
|
+
require_relative "zoom"
|
|
7
|
+
require_relative "compat"
|
|
8
|
+
require_relative "proof_state"
|
|
9
|
+
require_relative "style_pane_format_filter"
|
|
10
|
+
require_relative "default_tab_stop"
|
|
11
|
+
require_relative "character_spacing_control"
|
|
12
|
+
require_relative "do_not_display_page_boundaries"
|
|
13
|
+
require_relative "rsids"
|
|
14
|
+
require_relative "math_pr"
|
|
15
|
+
require_relative "theme_font_lang"
|
|
16
|
+
require_relative "clr_scheme_mapping"
|
|
17
|
+
require_relative "shape_defaults"
|
|
18
|
+
require_relative "decimal_symbol"
|
|
19
|
+
require_relative "list_separator"
|
|
20
|
+
require_relative "attached_template"
|
|
21
|
+
require_relative "footnote_pr"
|
|
22
|
+
require_relative "endnote_pr"
|
|
23
|
+
require_relative "hdr_shape_defaults"
|
|
24
|
+
require_relative "even_and_odd_headers"
|
|
25
|
+
require_relative "mirror_margins"
|
|
26
|
+
require_relative "do_not_include_subdocs_in_stats"
|
|
27
|
+
require_relative "hyphenation_zone"
|
|
28
|
+
require_relative "style_pane_sort_method"
|
|
29
|
+
require_relative "doc_vars"
|
|
30
|
+
require_relative "w14_doc_id"
|
|
31
|
+
require_relative "w15_chart_tracking_ref_based"
|
|
32
|
+
require_relative "w15_doc_id"
|
|
5
33
|
|
|
6
34
|
module Uniword
|
|
7
35
|
module Wordprocessingml
|
|
8
|
-
# Proof state for spelling/grammar checking
|
|
9
|
-
#
|
|
10
|
-
# Element: <w:proofState>
|
|
11
|
-
class ProofState < Lutaml::Model::Serializable
|
|
12
|
-
attribute :spelling, :string
|
|
13
|
-
attribute :grammar, :string
|
|
14
|
-
|
|
15
|
-
xml do
|
|
16
|
-
element "proofState"
|
|
17
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
18
|
-
map_attribute "spelling", to: :spelling
|
|
19
|
-
map_attribute "grammar", to: :grammar
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
# Style pane format filter
|
|
24
|
-
#
|
|
25
|
-
# Element: <w:stylePaneFormatFilter>
|
|
26
|
-
class StylePaneFormatFilter < Lutaml::Model::Serializable
|
|
27
|
-
attribute :val, :string
|
|
28
|
-
attribute :all_styles, :string
|
|
29
|
-
attribute :custom_styles, :string
|
|
30
|
-
attribute :latent_styles, :string
|
|
31
|
-
attribute :styles_in_use, :string
|
|
32
|
-
attribute :heading_styles, :string
|
|
33
|
-
attribute :numbering_styles, :string
|
|
34
|
-
attribute :table_styles, :string
|
|
35
|
-
attribute :direct_formatting_on_runs, :string
|
|
36
|
-
attribute :direct_formatting_on_paragraphs, :string
|
|
37
|
-
attribute :direct_formatting_on_numbering, :string
|
|
38
|
-
attribute :direct_formatting_on_tables, :string
|
|
39
|
-
attribute :clear_formatting, :string
|
|
40
|
-
attribute :top3_heading_styles, :string
|
|
41
|
-
attribute :visible_styles, :string
|
|
42
|
-
attribute :alternate_style_names, :string
|
|
43
|
-
|
|
44
|
-
xml do
|
|
45
|
-
element "stylePaneFormatFilter"
|
|
46
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
47
|
-
map_attribute "val", to: :val
|
|
48
|
-
map_attribute "allStyles", to: :all_styles
|
|
49
|
-
map_attribute "customStyles", to: :custom_styles
|
|
50
|
-
map_attribute "latentStyles", to: :latent_styles
|
|
51
|
-
map_attribute "stylesInUse", to: :styles_in_use
|
|
52
|
-
map_attribute "headingStyles", to: :heading_styles
|
|
53
|
-
map_attribute "numberingStyles", to: :numbering_styles
|
|
54
|
-
map_attribute "tableStyles", to: :table_styles
|
|
55
|
-
map_attribute "directFormattingOnRuns", to: :direct_formatting_on_runs
|
|
56
|
-
map_attribute "directFormattingOnParagraphs",
|
|
57
|
-
to: :direct_formatting_on_paragraphs
|
|
58
|
-
map_attribute "directFormattingOnNumbering",
|
|
59
|
-
to: :direct_formatting_on_numbering
|
|
60
|
-
map_attribute "directFormattingOnTables",
|
|
61
|
-
to: :direct_formatting_on_tables
|
|
62
|
-
map_attribute "clearFormatting", to: :clear_formatting
|
|
63
|
-
map_attribute "top3HeadingStyles", to: :top3_heading_styles
|
|
64
|
-
map_attribute "visibleStyles", to: :visible_styles
|
|
65
|
-
map_attribute "alternateStyleNames", to: :alternate_style_names
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
# Default tab stop
|
|
70
|
-
#
|
|
71
|
-
# Element: <w:defaultTabStop>
|
|
72
|
-
class DefaultTabStop < Lutaml::Model::Serializable
|
|
73
|
-
attribute :val, :string
|
|
74
|
-
|
|
75
|
-
xml do
|
|
76
|
-
element "defaultTabStop"
|
|
77
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
78
|
-
map_attribute "val", to: :val
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
# Character spacing control
|
|
83
|
-
#
|
|
84
|
-
# Element: <w:characterSpacingControl>
|
|
85
|
-
class CharacterSpacingControl < Lutaml::Model::Serializable
|
|
86
|
-
attribute :val, :string
|
|
87
|
-
|
|
88
|
-
xml do
|
|
89
|
-
element "characterSpacingControl"
|
|
90
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
91
|
-
map_attribute "val", to: :val
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
# Do not display page boundaries
|
|
96
|
-
#
|
|
97
|
-
# Element: <w:doNotDisplayPageBoundaries>
|
|
98
|
-
class DoNotDisplayPageBoundaries < Lutaml::Model::Serializable
|
|
99
|
-
xml do
|
|
100
|
-
element "doNotDisplayPageBoundaries"
|
|
101
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
# RSID root marker
|
|
106
|
-
#
|
|
107
|
-
# Element: <w:rsidRoot>
|
|
108
|
-
class RsidRoot < Lutaml::Model::Serializable
|
|
109
|
-
attribute :val, :string
|
|
110
|
-
|
|
111
|
-
xml do
|
|
112
|
-
element "rsidRoot"
|
|
113
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
114
|
-
map_attribute "val", to: :val
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
# RSID marker
|
|
119
|
-
#
|
|
120
|
-
# Element: <w:rsid>
|
|
121
|
-
class Rsid < Lutaml::Model::Serializable
|
|
122
|
-
attribute :val, :string
|
|
123
|
-
|
|
124
|
-
xml do
|
|
125
|
-
element "rsid"
|
|
126
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
127
|
-
map_attribute "val", to: :val
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
# RSID collection container
|
|
132
|
-
#
|
|
133
|
-
# Element: <w:rsids>
|
|
134
|
-
class Rsids < Lutaml::Model::Serializable
|
|
135
|
-
attribute :rsid_root, RsidRoot
|
|
136
|
-
attribute :rsid, Rsid, collection: true
|
|
137
|
-
|
|
138
|
-
xml do
|
|
139
|
-
element "rsids"
|
|
140
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
141
|
-
mixed_content
|
|
142
|
-
map_element "rsidRoot", to: :rsid_root, render_nil: false
|
|
143
|
-
map_element "rsid", to: :rsid, render_nil: false
|
|
144
|
-
end
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
# Math font reference
|
|
148
|
-
#
|
|
149
|
-
# Element: <m:mathFont>
|
|
150
|
-
class MathFont < Lutaml::Model::Serializable
|
|
151
|
-
attribute :val, :string
|
|
152
|
-
|
|
153
|
-
xml do
|
|
154
|
-
element "mathFont"
|
|
155
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
156
|
-
map_attribute "val", to: :val
|
|
157
|
-
end
|
|
158
|
-
end
|
|
159
|
-
|
|
160
|
-
# Break binary operator
|
|
161
|
-
#
|
|
162
|
-
# Element: <m:brkBin>
|
|
163
|
-
class BrkBin < Lutaml::Model::Serializable
|
|
164
|
-
attribute :val, :string
|
|
165
|
-
|
|
166
|
-
xml do
|
|
167
|
-
element "brkBin"
|
|
168
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
169
|
-
map_attribute "val", to: :val
|
|
170
|
-
end
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
# Break binary subtraction operator
|
|
174
|
-
#
|
|
175
|
-
# Element: <m:brkBinSub>
|
|
176
|
-
class BrkBinSub < Lutaml::Model::Serializable
|
|
177
|
-
attribute :val, :string
|
|
178
|
-
|
|
179
|
-
xml do
|
|
180
|
-
element "brkBinSub"
|
|
181
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
182
|
-
map_attribute "val", to: :val
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
# Small fraction
|
|
187
|
-
#
|
|
188
|
-
# Element: <m:smallFrac>
|
|
189
|
-
class SmallFrac < Lutaml::Model::Serializable
|
|
190
|
-
attribute :val, :string
|
|
191
|
-
|
|
192
|
-
xml do
|
|
193
|
-
element "smallFrac"
|
|
194
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
195
|
-
map_attribute "val", to: :val
|
|
196
|
-
end
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
# Display default (empty marker)
|
|
200
|
-
#
|
|
201
|
-
# Element: <m:dispDef>
|
|
202
|
-
class DispDef < Lutaml::Model::Serializable
|
|
203
|
-
xml do
|
|
204
|
-
element "dispDef"
|
|
205
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
206
|
-
end
|
|
207
|
-
end
|
|
208
|
-
|
|
209
|
-
# Left margin
|
|
210
|
-
#
|
|
211
|
-
# Element: <m:lMargin>
|
|
212
|
-
class LMargin < Lutaml::Model::Serializable
|
|
213
|
-
attribute :val, :string
|
|
214
|
-
|
|
215
|
-
xml do
|
|
216
|
-
element "lMargin"
|
|
217
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
218
|
-
map_attribute "val", to: :val
|
|
219
|
-
end
|
|
220
|
-
end
|
|
221
|
-
|
|
222
|
-
# Right margin
|
|
223
|
-
#
|
|
224
|
-
# Element: <m:rMargin>
|
|
225
|
-
class RMargin < Lutaml::Model::Serializable
|
|
226
|
-
attribute :val, :string
|
|
227
|
-
|
|
228
|
-
xml do
|
|
229
|
-
element "rMargin"
|
|
230
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
231
|
-
map_attribute "val", to: :val
|
|
232
|
-
end
|
|
233
|
-
end
|
|
234
|
-
|
|
235
|
-
# Default justification
|
|
236
|
-
#
|
|
237
|
-
# Element: <m:defJc>
|
|
238
|
-
class DefJc < Lutaml::Model::Serializable
|
|
239
|
-
attribute :val, :string
|
|
240
|
-
|
|
241
|
-
xml do
|
|
242
|
-
element "defJc"
|
|
243
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
244
|
-
map_attribute "val", to: :val
|
|
245
|
-
end
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
# Wrap indent
|
|
249
|
-
#
|
|
250
|
-
# Element: <m:wrapIndent>
|
|
251
|
-
class WrapIndent < Lutaml::Model::Serializable
|
|
252
|
-
attribute :val, :string
|
|
253
|
-
|
|
254
|
-
xml do
|
|
255
|
-
element "wrapIndent"
|
|
256
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
257
|
-
map_attribute "val", to: :val
|
|
258
|
-
end
|
|
259
|
-
end
|
|
260
|
-
|
|
261
|
-
# Integral limit
|
|
262
|
-
#
|
|
263
|
-
# Element: <m:intLim>
|
|
264
|
-
class IntLim < Lutaml::Model::Serializable
|
|
265
|
-
attribute :val, :string
|
|
266
|
-
|
|
267
|
-
xml do
|
|
268
|
-
element "intLim"
|
|
269
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
270
|
-
map_attribute "val", to: :val
|
|
271
|
-
end
|
|
272
|
-
end
|
|
273
|
-
|
|
274
|
-
# N-ary limit
|
|
275
|
-
#
|
|
276
|
-
# Element: <m:naryLim>
|
|
277
|
-
class NaryLim < Lutaml::Model::Serializable
|
|
278
|
-
attribute :val, :string
|
|
279
|
-
|
|
280
|
-
xml do
|
|
281
|
-
element "naryLim"
|
|
282
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
283
|
-
map_attribute "val", to: :val
|
|
284
|
-
end
|
|
285
|
-
end
|
|
286
|
-
|
|
287
|
-
# Math properties container
|
|
288
|
-
#
|
|
289
|
-
# Element: <m:mathPr>
|
|
290
|
-
class MathPr < Lutaml::Model::Serializable
|
|
291
|
-
attribute :math_font, MathFont
|
|
292
|
-
attribute :brk_bin, BrkBin
|
|
293
|
-
attribute :brk_bin_sub, BrkBinSub
|
|
294
|
-
attribute :small_frac, SmallFrac
|
|
295
|
-
attribute :disp_def, DispDef
|
|
296
|
-
attribute :l_margin, LMargin
|
|
297
|
-
attribute :r_margin, RMargin
|
|
298
|
-
attribute :def_jc, DefJc
|
|
299
|
-
attribute :wrap_indent, WrapIndent
|
|
300
|
-
attribute :int_lim, IntLim
|
|
301
|
-
attribute :nary_lim, NaryLim
|
|
302
|
-
|
|
303
|
-
xml do
|
|
304
|
-
element "mathPr"
|
|
305
|
-
namespace Uniword::Ooxml::Namespaces::MathML
|
|
306
|
-
mixed_content
|
|
307
|
-
map_element "mathFont", to: :math_font, render_nil: false
|
|
308
|
-
map_element "brkBin", to: :brk_bin, render_nil: false
|
|
309
|
-
map_element "brkBinSub", to: :brk_bin_sub, render_nil: false
|
|
310
|
-
map_element "smallFrac", to: :small_frac, render_nil: false
|
|
311
|
-
map_element "dispDef", to: :disp_def, render_nil: false
|
|
312
|
-
map_element "lMargin", to: :l_margin, render_nil: false
|
|
313
|
-
map_element "rMargin", to: :r_margin, render_nil: false
|
|
314
|
-
map_element "defJc", to: :def_jc, render_nil: false
|
|
315
|
-
map_element "wrapIndent", to: :wrap_indent, render_nil: false
|
|
316
|
-
map_element "intLim", to: :int_lim, render_nil: false
|
|
317
|
-
map_element "naryLim", to: :nary_lim, render_nil: false
|
|
318
|
-
end
|
|
319
|
-
end
|
|
320
|
-
|
|
321
|
-
# Theme font language
|
|
322
|
-
#
|
|
323
|
-
# Element: <w:themeFontLang>
|
|
324
|
-
class ThemeFontLang < Lutaml::Model::Serializable
|
|
325
|
-
attribute :val, :string
|
|
326
|
-
attribute :east_asia, :string
|
|
327
|
-
|
|
328
|
-
xml do
|
|
329
|
-
element "themeFontLang"
|
|
330
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
331
|
-
map_attribute "val", to: :val
|
|
332
|
-
map_attribute "eastAsia", to: :east_asia
|
|
333
|
-
end
|
|
334
|
-
end
|
|
335
|
-
|
|
336
|
-
# Color scheme mapping
|
|
337
|
-
#
|
|
338
|
-
# Element: <w:clrSchemeMapping>
|
|
339
|
-
class ClrSchemeMapping < Lutaml::Model::Serializable
|
|
340
|
-
attribute :bg1, :string
|
|
341
|
-
attribute :t1, :string
|
|
342
|
-
attribute :bg2, :string
|
|
343
|
-
attribute :t2, :string
|
|
344
|
-
attribute :accent1, :string
|
|
345
|
-
attribute :accent2, :string
|
|
346
|
-
attribute :accent3, :string
|
|
347
|
-
attribute :accent4, :string
|
|
348
|
-
attribute :accent5, :string
|
|
349
|
-
attribute :accent6, :string
|
|
350
|
-
attribute :hyperlink, :string
|
|
351
|
-
attribute :followed_hyperlink, :string
|
|
352
|
-
|
|
353
|
-
xml do
|
|
354
|
-
element "clrSchemeMapping"
|
|
355
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
356
|
-
map_attribute "bg1", to: :bg1
|
|
357
|
-
map_attribute "t1", to: :t1
|
|
358
|
-
map_attribute "bg2", to: :bg2
|
|
359
|
-
map_attribute "t2", to: :t2
|
|
360
|
-
map_attribute "accent1", to: :accent1
|
|
361
|
-
map_attribute "accent2", to: :accent2
|
|
362
|
-
map_attribute "accent3", to: :accent3
|
|
363
|
-
map_attribute "accent4", to: :accent4
|
|
364
|
-
map_attribute "accent5", to: :accent5
|
|
365
|
-
map_attribute "accent6", to: :accent6
|
|
366
|
-
map_attribute "hyperlink", to: :hyperlink
|
|
367
|
-
map_attribute "followedHyperlink", to: :followed_hyperlink
|
|
368
|
-
end
|
|
369
|
-
end
|
|
370
|
-
|
|
371
|
-
# Shape defaults container
|
|
372
|
-
#
|
|
373
|
-
# Element: <w:shapeDefaults>
|
|
374
|
-
class ShapeDefaults < Lutaml::Model::Serializable
|
|
375
|
-
attribute :shape_defaults, Uniword::VmlOffice::VmlShapeDefaults
|
|
376
|
-
attribute :shape_layout, Uniword::VmlOffice::VmlShapeLayout
|
|
377
|
-
|
|
378
|
-
xml do
|
|
379
|
-
element "shapeDefaults"
|
|
380
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
381
|
-
mixed_content
|
|
382
|
-
map_element "shapedefaults", to: :shape_defaults, render_nil: false
|
|
383
|
-
map_element "shapelayout", to: :shape_layout, render_nil: false
|
|
384
|
-
end
|
|
385
|
-
end
|
|
386
|
-
|
|
387
|
-
# Decimal symbol
|
|
388
|
-
#
|
|
389
|
-
# Element: <w:decimalSymbol>
|
|
390
|
-
class DecimalSymbol < Lutaml::Model::Serializable
|
|
391
|
-
attribute :val, :string
|
|
392
|
-
|
|
393
|
-
xml do
|
|
394
|
-
element "decimalSymbol"
|
|
395
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
396
|
-
map_attribute "val", to: :val
|
|
397
|
-
end
|
|
398
|
-
end
|
|
399
|
-
|
|
400
|
-
# List separator
|
|
401
|
-
#
|
|
402
|
-
# Element: <w:listSeparator>
|
|
403
|
-
class ListSeparator < Lutaml::Model::Serializable
|
|
404
|
-
attribute :val, :string
|
|
405
|
-
|
|
406
|
-
xml do
|
|
407
|
-
element "listSeparator"
|
|
408
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
409
|
-
map_attribute "val", to: :val
|
|
410
|
-
end
|
|
411
|
-
end
|
|
412
|
-
|
|
413
|
-
# Attached template reference
|
|
414
|
-
#
|
|
415
|
-
# Element: <w:attachedTemplate>
|
|
416
|
-
class AttachedTemplate < Lutaml::Model::Serializable
|
|
417
|
-
attribute :r_id, Properties::RelationshipIdValue
|
|
418
|
-
|
|
419
|
-
xml do
|
|
420
|
-
element "attachedTemplate"
|
|
421
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
422
|
-
map_attribute "id", to: :r_id
|
|
423
|
-
end
|
|
424
|
-
end
|
|
425
|
-
|
|
426
|
-
# Header/footer shape defaults container
|
|
427
|
-
#
|
|
428
|
-
# Element: <w:hdrShapeDefaults>
|
|
429
|
-
class HdrShapeDefaults < Lutaml::Model::Serializable
|
|
430
|
-
attribute :shape_defaults, Uniword::VmlOffice::VmlShapeDefaults
|
|
431
|
-
|
|
432
|
-
xml do
|
|
433
|
-
element "hdrShapeDefaults"
|
|
434
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
435
|
-
mixed_content
|
|
436
|
-
map_element "shapedefaults", to: :shape_defaults, render_nil: false
|
|
437
|
-
end
|
|
438
|
-
end
|
|
439
|
-
|
|
440
|
-
# Footnote position
|
|
441
|
-
#
|
|
442
|
-
# Element: <w:pos>
|
|
443
|
-
class FootnotePos < Lutaml::Model::Serializable
|
|
444
|
-
attribute :val, :string
|
|
445
|
-
|
|
446
|
-
xml do
|
|
447
|
-
element "pos"
|
|
448
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
449
|
-
map_attribute "val", to: :val
|
|
450
|
-
end
|
|
451
|
-
end
|
|
452
|
-
|
|
453
|
-
# Footnote properties
|
|
454
|
-
#
|
|
455
|
-
# Element: <w:footnotePr>
|
|
456
|
-
class FootnotePr < Lutaml::Model::Serializable
|
|
457
|
-
attribute :pos, FootnotePos
|
|
458
|
-
attribute :footnotes, Footnote, collection: true
|
|
459
|
-
|
|
460
|
-
xml do
|
|
461
|
-
element "footnotePr"
|
|
462
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
463
|
-
mixed_content
|
|
464
|
-
map_element "pos", to: :pos, render_nil: false
|
|
465
|
-
map_element "footnote", to: :footnotes, render_nil: false
|
|
466
|
-
end
|
|
467
|
-
end
|
|
468
|
-
|
|
469
|
-
# Endnote properties
|
|
470
|
-
#
|
|
471
|
-
# Element: <w:endnotePr>
|
|
472
|
-
class EndnotePr < Lutaml::Model::Serializable
|
|
473
|
-
attribute :endnotes, Endnote, collection: true
|
|
474
|
-
|
|
475
|
-
xml do
|
|
476
|
-
element "endnotePr"
|
|
477
|
-
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
478
|
-
mixed_content
|
|
479
|
-
map_element "endnote", to: :endnotes, render_nil: false
|
|
480
|
-
end
|
|
481
|
-
end
|
|
482
|
-
|
|
483
|
-
# Word 2010 document ID
|
|
484
|
-
#
|
|
485
|
-
# Element: <w14:docId>
|
|
486
|
-
class W14DocId < Lutaml::Model::Serializable
|
|
487
|
-
attribute :val, :string
|
|
488
|
-
|
|
489
|
-
xml do
|
|
490
|
-
element "docId"
|
|
491
|
-
namespace Uniword::Ooxml::Namespaces::Word2010
|
|
492
|
-
map_attribute "val", to: :val
|
|
493
|
-
end
|
|
494
|
-
end
|
|
495
|
-
|
|
496
|
-
# Word 2012 chart tracking ref based (empty marker)
|
|
497
|
-
#
|
|
498
|
-
# Element: <w15:chartTrackingRefBased>
|
|
499
|
-
class W15ChartTrackingRefBased < Lutaml::Model::Serializable
|
|
500
|
-
xml do
|
|
501
|
-
element "chartTrackingRefBased"
|
|
502
|
-
namespace Uniword::Ooxml::Namespaces::Word2012
|
|
503
|
-
end
|
|
504
|
-
end
|
|
505
|
-
|
|
506
|
-
# Word 2012 document ID
|
|
507
|
-
#
|
|
508
|
-
# Element: <w15:docId>
|
|
509
|
-
class W15DocId < Lutaml::Model::Serializable
|
|
510
|
-
attribute :val, :string
|
|
511
|
-
|
|
512
|
-
xml do
|
|
513
|
-
element "docId"
|
|
514
|
-
namespace Uniword::Ooxml::Namespaces::Word2012
|
|
515
|
-
map_attribute "val", to: :val
|
|
516
|
-
end
|
|
517
|
-
end
|
|
518
|
-
|
|
519
36
|
# Document settings
|
|
520
37
|
#
|
|
521
38
|
# Generated from OOXML schema: wordprocessingml.yml
|
|
@@ -540,6 +57,13 @@ module Uniword
|
|
|
540
57
|
attribute :footnote_pr, FootnotePr
|
|
541
58
|
attribute :endnote_pr, EndnotePr
|
|
542
59
|
attribute :hdr_shape_defaults, HdrShapeDefaults
|
|
60
|
+
attribute :even_and_odd_headers, EvenAndOddHeaders
|
|
61
|
+
attribute :mirror_margins, MirrorMargins
|
|
62
|
+
attribute :do_not_include_subdocs_in_stats,
|
|
63
|
+
DoNotIncludeSubdocsInStats
|
|
64
|
+
attribute :hyphenation_zone, HyphenationZone
|
|
65
|
+
attribute :style_pane_sort_method, StylePaneSortMethod
|
|
66
|
+
attribute :doc_vars, DocVars
|
|
543
67
|
attribute :w14_doc_id, W14DocId
|
|
544
68
|
attribute :w15_chart_tracking_ref_based, W15ChartTrackingRefBased
|
|
545
69
|
attribute :w15_doc_id, W15DocId
|
|
@@ -606,6 +130,16 @@ module Uniword
|
|
|
606
130
|
map_element "endnotePr", to: :endnote_pr, render_nil: false
|
|
607
131
|
map_element "hdrShapeDefaults", to: :hdr_shape_defaults,
|
|
608
132
|
render_nil: false
|
|
133
|
+
map_element "evenAndOddHeaders", to: :even_and_odd_headers,
|
|
134
|
+
render_nil: false
|
|
135
|
+
map_element "mirrorMargins", to: :mirror_margins, render_nil: false
|
|
136
|
+
map_element "doNotIncludeSubdocsInStats",
|
|
137
|
+
to: :do_not_include_subdocs_in_stats, render_nil: false
|
|
138
|
+
map_element "hyphenationZone", to: :hyphenation_zone,
|
|
139
|
+
render_nil: false
|
|
140
|
+
map_element "stylePaneSortMethod", to: :style_pane_sort_method,
|
|
141
|
+
render_nil: false
|
|
142
|
+
map_element "docVars", to: :doc_vars, render_nil: false
|
|
609
143
|
# Both w14:docId and w15:docId use the same element name 'docId'
|
|
610
144
|
# Separate map_element entries needed for namespace-aware matching
|
|
611
145
|
# The namespace_scope ensures w14 and w15 namespaces are declared on root
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
require_relative "../vml_office"
|
|
5
|
+
|
|
6
|
+
module Uniword
|
|
7
|
+
module Wordprocessingml
|
|
8
|
+
class ShapeDefaults < Lutaml::Model::Serializable
|
|
9
|
+
attribute :shape_defaults, Uniword::VmlOffice::VmlShapeDefaults
|
|
10
|
+
attribute :shape_layout, Uniword::VmlOffice::VmlShapeLayout
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
element "shapeDefaults"
|
|
14
|
+
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
15
|
+
mixed_content
|
|
16
|
+
map_element "shapedefaults", to: :shape_defaults, render_nil: false
|
|
17
|
+
map_element "shapelayout", to: :shape_layout, render_nil: false
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Uniword
|
|
6
|
+
module Wordprocessingml
|
|
7
|
+
class SmallFrac < Lutaml::Model::Serializable
|
|
8
|
+
attribute :val, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
element "smallFrac"
|
|
12
|
+
namespace Uniword::Ooxml::Namespaces::MathML
|
|
13
|
+
map_attribute "val", to: :val
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Uniword
|
|
6
|
+
module Wordprocessingml
|
|
7
|
+
class StylePaneFormatFilter < Lutaml::Model::Serializable
|
|
8
|
+
attribute :val, :string
|
|
9
|
+
attribute :all_styles, :string
|
|
10
|
+
attribute :custom_styles, :string
|
|
11
|
+
attribute :latent_styles, :string
|
|
12
|
+
attribute :styles_in_use, :string
|
|
13
|
+
attribute :heading_styles, :string
|
|
14
|
+
attribute :numbering_styles, :string
|
|
15
|
+
attribute :table_styles, :string
|
|
16
|
+
attribute :direct_formatting_on_runs, :string
|
|
17
|
+
attribute :direct_formatting_on_paragraphs, :string
|
|
18
|
+
attribute :direct_formatting_on_numbering, :string
|
|
19
|
+
attribute :direct_formatting_on_tables, :string
|
|
20
|
+
attribute :clear_formatting, :string
|
|
21
|
+
attribute :top3_heading_styles, :string
|
|
22
|
+
attribute :visible_styles, :string
|
|
23
|
+
attribute :alternate_style_names, :string
|
|
24
|
+
|
|
25
|
+
xml do
|
|
26
|
+
element "stylePaneFormatFilter"
|
|
27
|
+
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
28
|
+
map_attribute "val", to: :val
|
|
29
|
+
map_attribute "allStyles", to: :all_styles
|
|
30
|
+
map_attribute "customStyles", to: :custom_styles
|
|
31
|
+
map_attribute "latentStyles", to: :latent_styles
|
|
32
|
+
map_attribute "stylesInUse", to: :styles_in_use
|
|
33
|
+
map_attribute "headingStyles", to: :heading_styles
|
|
34
|
+
map_attribute "numberingStyles", to: :numbering_styles
|
|
35
|
+
map_attribute "tableStyles", to: :table_styles
|
|
36
|
+
map_attribute "directFormattingOnRuns", to: :direct_formatting_on_runs
|
|
37
|
+
map_attribute "directFormattingOnParagraphs",
|
|
38
|
+
to: :direct_formatting_on_paragraphs
|
|
39
|
+
map_attribute "directFormattingOnNumbering",
|
|
40
|
+
to: :direct_formatting_on_numbering
|
|
41
|
+
map_attribute "directFormattingOnTables",
|
|
42
|
+
to: :direct_formatting_on_tables
|
|
43
|
+
map_attribute "clearFormatting", to: :clear_formatting
|
|
44
|
+
map_attribute "top3HeadingStyles", to: :top3_heading_styles
|
|
45
|
+
map_attribute "visibleStyles", to: :visible_styles
|
|
46
|
+
map_attribute "alternateStyleNames", to: :alternate_style_names
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Uniword
|
|
6
|
+
module Wordprocessingml
|
|
7
|
+
# Style pane sort method
|
|
8
|
+
#
|
|
9
|
+
# Element: <w:stylePaneSortMethod>
|
|
10
|
+
class StylePaneSortMethod < Lutaml::Model::Serializable
|
|
11
|
+
attribute :val, :string
|
|
12
|
+
|
|
13
|
+
xml do
|
|
14
|
+
element "stylePaneSortMethod"
|
|
15
|
+
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
16
|
+
map_attribute "val", to: :val
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -45,6 +45,12 @@ module Uniword
|
|
|
45
45
|
def text
|
|
46
46
|
paragraphs.map(&:text).join("\n")
|
|
47
47
|
end
|
|
48
|
+
|
|
49
|
+
# Set cell text, replacing all paragraphs with a single paragraph.
|
|
50
|
+
def text=(value)
|
|
51
|
+
paragraphs.clear
|
|
52
|
+
paragraphs << Paragraph.new(runs: [Run.new(text: value.to_s)])
|
|
53
|
+
end
|
|
48
54
|
end
|
|
49
55
|
end
|
|
50
56
|
end
|