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
|
@@ -19,6 +19,7 @@ module Uniword
|
|
|
19
19
|
attribute :w_after, WidthAfter
|
|
20
20
|
attribute :cnf_style, CnfStyle
|
|
21
21
|
attribute :div_id, ValInt
|
|
22
|
+
attribute :jc, Properties::Alignment
|
|
22
23
|
|
|
23
24
|
xml do
|
|
24
25
|
element "trPr"
|
|
@@ -34,6 +35,7 @@ module Uniword
|
|
|
34
35
|
map_element "wAfter", to: :w_after, render_nil: false
|
|
35
36
|
map_element "cnfStyle", to: :cnf_style, render_nil: false
|
|
36
37
|
map_element "divId", to: :div_id, render_nil: false
|
|
38
|
+
map_element "jc", to: :jc, render_nil: false
|
|
37
39
|
end
|
|
38
40
|
|
|
39
41
|
def initialize(attrs = {})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Uniword
|
|
6
|
+
module Wordprocessingml
|
|
7
|
+
class ThemeFontLang < Lutaml::Model::Serializable
|
|
8
|
+
attribute :val, :string
|
|
9
|
+
attribute :east_asia, :string
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
element "themeFontLang"
|
|
13
|
+
namespace Uniword::Ooxml::Namespaces::WordProcessingML
|
|
14
|
+
map_attribute "val", to: :val
|
|
15
|
+
map_attribute "eastAsia", to: :east_asia
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Uniword
|
|
6
|
+
module Wordprocessingml
|
|
7
|
+
class W14DocId < Lutaml::Model::Serializable
|
|
8
|
+
attribute :val, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
element "docId"
|
|
12
|
+
namespace Uniword::Ooxml::Namespaces::Word2010
|
|
13
|
+
map_attribute "val", to: :val
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Uniword
|
|
6
|
+
module Wordprocessingml
|
|
7
|
+
class W15ChartTrackingRefBased < Lutaml::Model::Serializable
|
|
8
|
+
xml do
|
|
9
|
+
element "chartTrackingRefBased"
|
|
10
|
+
namespace Uniword::Ooxml::Namespaces::Word2012
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Uniword
|
|
6
|
+
module Wordprocessingml
|
|
7
|
+
class W15DocId < Lutaml::Model::Serializable
|
|
8
|
+
attribute :val, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
element "docId"
|
|
12
|
+
namespace Uniword::Ooxml::Namespaces::Word2012
|
|
13
|
+
map_attribute "val", to: :val
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Uniword
|
|
6
|
+
module Wordprocessingml
|
|
7
|
+
class WrapIndent < Lutaml::Model::Serializable
|
|
8
|
+
attribute :val, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
element "wrapIndent"
|
|
12
|
+
namespace Uniword::Ooxml::Namespaces::MathML
|
|
13
|
+
map_attribute "val", to: :val
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -77,62 +77,48 @@ module Uniword
|
|
|
77
77
|
|
|
78
78
|
# Document settings and defaults
|
|
79
79
|
autoload :Settings, "uniword/wordprocessingml/settings"
|
|
80
|
-
autoload :ProofState, "uniword/wordprocessingml/
|
|
81
|
-
autoload :StylePaneFormatFilter, "uniword/wordprocessingml/
|
|
82
|
-
autoload :DefaultTabStop, "uniword/wordprocessingml/
|
|
83
|
-
autoload :CharacterSpacingControl, "uniword/wordprocessingml/
|
|
84
|
-
autoload :
|
|
85
|
-
autoload :
|
|
86
|
-
autoload :
|
|
87
|
-
autoload :
|
|
88
|
-
autoload :
|
|
89
|
-
autoload :
|
|
90
|
-
autoload :
|
|
91
|
-
autoload :
|
|
92
|
-
autoload :
|
|
93
|
-
autoload :
|
|
94
|
-
autoload :
|
|
95
|
-
autoload :
|
|
96
|
-
autoload :
|
|
97
|
-
autoload :
|
|
98
|
-
autoload :
|
|
99
|
-
autoload :
|
|
100
|
-
autoload :
|
|
101
|
-
autoload :
|
|
102
|
-
autoload :
|
|
103
|
-
autoload :
|
|
104
|
-
autoload :
|
|
105
|
-
autoload :
|
|
106
|
-
autoload :
|
|
107
|
-
autoload :
|
|
108
|
-
autoload :
|
|
109
|
-
autoload :
|
|
110
|
-
autoload :
|
|
111
|
-
autoload :
|
|
112
|
-
autoload :
|
|
113
|
-
|
|
114
|
-
autoload :
|
|
115
|
-
autoload :
|
|
116
|
-
|
|
117
|
-
autoload :
|
|
118
|
-
autoload :
|
|
119
|
-
autoload :
|
|
120
|
-
autoload :
|
|
121
|
-
autoload :
|
|
122
|
-
autoload :DefJc, "uniword/wordprocessingml/settings"
|
|
123
|
-
autoload :WrapIndent, "uniword/wordprocessingml/settings"
|
|
124
|
-
autoload :IntLim, "uniword/wordprocessingml/settings"
|
|
125
|
-
autoload :NaryLim, "uniword/wordprocessingml/settings"
|
|
126
|
-
autoload :ThemeFontLang, "uniword/wordprocessingml/settings"
|
|
127
|
-
autoload :ClrSchemeMapping, "uniword/wordprocessingml/settings"
|
|
128
|
-
autoload :ShapeDefaults, "uniword/wordprocessingml/settings"
|
|
129
|
-
autoload :DecimalSymbol, "uniword/wordprocessingml/settings"
|
|
130
|
-
autoload :ListSeparator, "uniword/wordprocessingml/settings"
|
|
131
|
-
autoload :AttachedTemplate, "uniword/wordprocessingml/settings"
|
|
132
|
-
autoload :HdrShapeDefaults, "uniword/wordprocessingml/settings"
|
|
133
|
-
autoload :FootnotePos, "uniword/wordprocessingml/settings"
|
|
134
|
-
autoload :FootnotePr, "uniword/wordprocessingml/settings"
|
|
135
|
-
autoload :EndnotePr, "uniword/wordprocessingml/settings"
|
|
80
|
+
autoload :ProofState, "uniword/wordprocessingml/proof_state"
|
|
81
|
+
autoload :StylePaneFormatFilter, "uniword/wordprocessingml/style_pane_format_filter"
|
|
82
|
+
autoload :DefaultTabStop, "uniword/wordprocessingml/default_tab_stop"
|
|
83
|
+
autoload :CharacterSpacingControl, "uniword/wordprocessingml/character_spacing_control"
|
|
84
|
+
autoload :DoNotDisplayPageBoundaries, "uniword/wordprocessingml/do_not_display_page_boundaries"
|
|
85
|
+
autoload :Rsids, "uniword/wordprocessingml/rsids"
|
|
86
|
+
autoload :RsidRoot, "uniword/wordprocessingml/rsid_root"
|
|
87
|
+
autoload :Rsid, "uniword/wordprocessingml/rsid"
|
|
88
|
+
autoload :MathPr, "uniword/wordprocessingml/math_pr"
|
|
89
|
+
autoload :MathFont, "uniword/wordprocessingml/math_font"
|
|
90
|
+
autoload :BrkBin, "uniword/wordprocessingml/brk_bin"
|
|
91
|
+
autoload :BrkBinSub, "uniword/wordprocessingml/brk_bin_sub"
|
|
92
|
+
autoload :SmallFrac, "uniword/wordprocessingml/small_frac"
|
|
93
|
+
autoload :DispDef, "uniword/wordprocessingml/disp_def"
|
|
94
|
+
autoload :LMargin, "uniword/wordprocessingml/l_margin"
|
|
95
|
+
autoload :RMargin, "uniword/wordprocessingml/r_margin"
|
|
96
|
+
autoload :DefJc, "uniword/wordprocessingml/def_jc"
|
|
97
|
+
autoload :WrapIndent, "uniword/wordprocessingml/wrap_indent"
|
|
98
|
+
autoload :IntLim, "uniword/wordprocessingml/int_lim"
|
|
99
|
+
autoload :NaryLim, "uniword/wordprocessingml/nary_lim"
|
|
100
|
+
autoload :ThemeFontLang, "uniword/wordprocessingml/theme_font_lang"
|
|
101
|
+
autoload :ClrSchemeMapping, "uniword/wordprocessingml/clr_scheme_mapping"
|
|
102
|
+
autoload :ShapeDefaults, "uniword/wordprocessingml/shape_defaults"
|
|
103
|
+
autoload :DecimalSymbol, "uniword/wordprocessingml/decimal_symbol"
|
|
104
|
+
autoload :ListSeparator, "uniword/wordprocessingml/list_separator"
|
|
105
|
+
autoload :W14DocId, "uniword/wordprocessingml/w14_doc_id"
|
|
106
|
+
autoload :W15ChartTrackingRefBased, "uniword/wordprocessingml/w15_chart_tracking_ref_based"
|
|
107
|
+
autoload :W15DocId, "uniword/wordprocessingml/w15_doc_id"
|
|
108
|
+
autoload :AttachedTemplate, "uniword/wordprocessingml/attached_template"
|
|
109
|
+
autoload :HdrShapeDefaults, "uniword/wordprocessingml/hdr_shape_defaults"
|
|
110
|
+
autoload :EvenAndOddHeaders, "uniword/wordprocessingml/even_and_odd_headers"
|
|
111
|
+
autoload :MirrorMargins, "uniword/wordprocessingml/mirror_margins"
|
|
112
|
+
autoload :DoNotIncludeSubdocsInStats,
|
|
113
|
+
"uniword/wordprocessingml/do_not_include_subdocs_in_stats"
|
|
114
|
+
autoload :HyphenationZone, "uniword/wordprocessingml/hyphenation_zone"
|
|
115
|
+
autoload :StylePaneSortMethod,
|
|
116
|
+
"uniword/wordprocessingml/style_pane_sort_method"
|
|
117
|
+
autoload :DocVar, "uniword/wordprocessingml/doc_vars"
|
|
118
|
+
autoload :DocVars, "uniword/wordprocessingml/doc_vars"
|
|
119
|
+
autoload :FootnotePos, "uniword/wordprocessingml/footnote_pos"
|
|
120
|
+
autoload :FootnotePr, "uniword/wordprocessingml/footnote_pr"
|
|
121
|
+
autoload :EndnotePr, "uniword/wordprocessingml/endnote_pr"
|
|
136
122
|
autoload :SemiHidden, "uniword/wordprocessingml/semi_hidden"
|
|
137
123
|
autoload :UnhideWhenUsed, "uniword/wordprocessingml/semi_hidden"
|
|
138
124
|
autoload :LatentStylesException, "uniword/wordprocessingml/latent_styles"
|
data/lib/uniword.rb
CHANGED
|
@@ -13,9 +13,16 @@ Lutaml::Model::Config.xml_adapter_type = :nokogiri
|
|
|
13
13
|
# Version 2.0 uses generated classes from YAML schemas covering 760 elements
|
|
14
14
|
# across 22 OOXML namespaces with perfect round-trip fidelity.
|
|
15
15
|
#
|
|
16
|
-
# @example Create a simple document
|
|
16
|
+
# @example Create a simple document (Builder API)
|
|
17
|
+
# doc = Uniword::Builder::DocumentBuilder.new
|
|
18
|
+
# doc.paragraph { |p| p << "Hello World" }
|
|
19
|
+
# doc.save('output.docx')
|
|
20
|
+
#
|
|
21
|
+
# @example Create a simple document (model API)
|
|
17
22
|
# doc = Uniword::Wordprocessingml::DocumentRoot.new
|
|
18
|
-
# doc.
|
|
23
|
+
# doc.body.paragraphs << Uniword::Wordprocessingml::Paragraph.new(
|
|
24
|
+
# runs: [Uniword::Wordprocessingml::Run.new(text: "Hello World")]
|
|
25
|
+
# )
|
|
19
26
|
# doc.save('output.docx')
|
|
20
27
|
#
|
|
21
28
|
# @example Read an existing document
|
|
@@ -24,10 +31,10 @@ Lutaml::Model::Config.xml_adapter_type = :nokogiri
|
|
|
24
31
|
# doc.paragraphs.each { |p| puts p.text }
|
|
25
32
|
#
|
|
26
33
|
# @example Apply theme and StyleSet
|
|
27
|
-
# doc = Uniword::
|
|
28
|
-
# doc.
|
|
34
|
+
# doc = Uniword::Builder::DocumentBuilder.new
|
|
35
|
+
# doc.paragraph { |p| p << "Hello World" }
|
|
29
36
|
# doc.apply_theme('celestial')
|
|
30
|
-
# doc.apply_styleset('
|
|
37
|
+
# doc.apply_styleset('signature')
|
|
31
38
|
# doc.save('output.docx')
|
|
32
39
|
#
|
|
33
40
|
# @see DocumentFactory Factory for reading documents
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: uniword
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: logger
|
|
@@ -31,6 +31,9 @@ dependencies:
|
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: 0.8.0
|
|
34
|
+
- - ">="
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: 0.8.6
|
|
34
37
|
type: :runtime
|
|
35
38
|
prerelease: false
|
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -38,6 +41,9 @@ dependencies:
|
|
|
38
41
|
- - "~>"
|
|
39
42
|
- !ruby/object:Gem::Version
|
|
40
43
|
version: 0.8.0
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 0.8.6
|
|
41
47
|
- !ruby/object:Gem::Dependency
|
|
42
48
|
name: nokogiri
|
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -526,6 +532,8 @@ files:
|
|
|
526
532
|
- data/themes/memoir.yml
|
|
527
533
|
- data/themes/meridian.yml
|
|
528
534
|
- data/themes/mosaic.yml
|
|
535
|
+
- data/themes/office_format_scheme.xml
|
|
536
|
+
- data/themes/office_theme.xml
|
|
529
537
|
- data/themes/parkway.yml
|
|
530
538
|
- data/themes/plasma.yml
|
|
531
539
|
- data/themes/plumage.yml
|
|
@@ -771,6 +779,7 @@ files:
|
|
|
771
779
|
- lib/uniword/diff/package_diff_result.rb
|
|
772
780
|
- lib/uniword/diff/package_differ.rb
|
|
773
781
|
- lib/uniword/document_factory.rb
|
|
782
|
+
- lib/uniword/document_input.rb
|
|
774
783
|
- lib/uniword/document_variables.rb
|
|
775
784
|
- lib/uniword/document_variables/data_type.rb
|
|
776
785
|
- lib/uniword/document_variables/default_value.rb
|
|
@@ -966,6 +975,7 @@ files:
|
|
|
966
975
|
- lib/uniword/glossary/glossary_document.rb
|
|
967
976
|
- lib/uniword/glossary/style_id.rb
|
|
968
977
|
- lib/uniword/glossary/text_box.rb
|
|
978
|
+
- lib/uniword/has_run_position.rb
|
|
969
979
|
- lib/uniword/header.rb
|
|
970
980
|
- lib/uniword/headers_footers.rb
|
|
971
981
|
- lib/uniword/headers_footers/manager.rb
|
|
@@ -1157,7 +1167,6 @@ files:
|
|
|
1157
1167
|
- lib/uniword/ooxml/types/dcterms_modified_type.rb
|
|
1158
1168
|
- lib/uniword/ooxml/types/dcterms_w3cdtf_type.rb
|
|
1159
1169
|
- lib/uniword/ooxml/types/mc_ignorable_type.rb
|
|
1160
|
-
- lib/uniword/ooxml/types/on_off_type.rb
|
|
1161
1170
|
- lib/uniword/ooxml/types/ooxml_boolean.rb
|
|
1162
1171
|
- lib/uniword/ooxml/types/ooxml_boolean_optional.rb
|
|
1163
1172
|
- lib/uniword/ooxml/types/relationship_id.rb
|
|
@@ -1232,6 +1241,7 @@ files:
|
|
|
1232
1241
|
- lib/uniword/properties/auto_space_de.rb
|
|
1233
1242
|
- lib/uniword/properties/auto_space_dn.rb
|
|
1234
1243
|
- lib/uniword/properties/bold.rb
|
|
1244
|
+
- lib/uniword/properties/boolean_element_factory.rb
|
|
1235
1245
|
- lib/uniword/properties/boolean_formatting.rb
|
|
1236
1246
|
- lib/uniword/properties/border.rb
|
|
1237
1247
|
- lib/uniword/properties/borders.rb
|
|
@@ -1645,15 +1655,20 @@ files:
|
|
|
1645
1655
|
- lib/uniword/wordprocessingml/abstract_num_id.rb
|
|
1646
1656
|
- lib/uniword/wordprocessingml/alternate_content.rb
|
|
1647
1657
|
- lib/uniword/wordprocessingml/anchor.rb
|
|
1658
|
+
- lib/uniword/wordprocessingml/attached_template.rb
|
|
1648
1659
|
- lib/uniword/wordprocessingml/based_on.rb
|
|
1649
1660
|
- lib/uniword/wordprocessingml/body.rb
|
|
1650
1661
|
- lib/uniword/wordprocessingml/bookmark_end.rb
|
|
1651
1662
|
- lib/uniword/wordprocessingml/bookmark_start.rb
|
|
1652
1663
|
- lib/uniword/wordprocessingml/border.rb
|
|
1653
1664
|
- lib/uniword/wordprocessingml/break.rb
|
|
1665
|
+
- lib/uniword/wordprocessingml/brk_bin.rb
|
|
1666
|
+
- lib/uniword/wordprocessingml/brk_bin_sub.rb
|
|
1654
1667
|
- lib/uniword/wordprocessingml/carriage_return.rb
|
|
1668
|
+
- lib/uniword/wordprocessingml/character_spacing_control.rb
|
|
1655
1669
|
- lib/uniword/wordprocessingml/character_style.rb
|
|
1656
1670
|
- lib/uniword/wordprocessingml/choice.rb
|
|
1671
|
+
- lib/uniword/wordprocessingml/clr_scheme_mapping.rb
|
|
1657
1672
|
- lib/uniword/wordprocessingml/cnf_style.rb
|
|
1658
1673
|
- lib/uniword/wordprocessingml/columns.rb
|
|
1659
1674
|
- lib/uniword/wordprocessingml/comment_range_end.rb
|
|
@@ -1661,18 +1676,27 @@ files:
|
|
|
1661
1676
|
- lib/uniword/wordprocessingml/comment_reference.rb
|
|
1662
1677
|
- lib/uniword/wordprocessingml/compat.rb
|
|
1663
1678
|
- lib/uniword/wordprocessingml/compat_setting.rb
|
|
1679
|
+
- lib/uniword/wordprocessingml/decimal_symbol.rb
|
|
1680
|
+
- lib/uniword/wordprocessingml/def_jc.rb
|
|
1681
|
+
- lib/uniword/wordprocessingml/default_tab_stop.rb
|
|
1664
1682
|
- lib/uniword/wordprocessingml/deleted_text.rb
|
|
1683
|
+
- lib/uniword/wordprocessingml/disp_def.rb
|
|
1684
|
+
- lib/uniword/wordprocessingml/do_not_display_page_boundaries.rb
|
|
1685
|
+
- lib/uniword/wordprocessingml/do_not_include_subdocs_in_stats.rb
|
|
1665
1686
|
- lib/uniword/wordprocessingml/doc_defaults.rb
|
|
1666
1687
|
- lib/uniword/wordprocessingml/doc_grid.rb
|
|
1667
1688
|
- lib/uniword/wordprocessingml/doc_pr.rb
|
|
1689
|
+
- lib/uniword/wordprocessingml/doc_vars.rb
|
|
1668
1690
|
- lib/uniword/wordprocessingml/document_root.rb
|
|
1669
1691
|
- lib/uniword/wordprocessingml/document_root/feature_facade.rb
|
|
1670
1692
|
- lib/uniword/wordprocessingml/drawing.rb
|
|
1671
1693
|
- lib/uniword/wordprocessingml/emboss.rb
|
|
1672
1694
|
- lib/uniword/wordprocessingml/endnote.rb
|
|
1695
|
+
- lib/uniword/wordprocessingml/endnote_pr.rb
|
|
1673
1696
|
- lib/uniword/wordprocessingml/endnote_ref.rb
|
|
1674
1697
|
- lib/uniword/wordprocessingml/endnote_reference.rb
|
|
1675
1698
|
- lib/uniword/wordprocessingml/endnotes.rb
|
|
1699
|
+
- lib/uniword/wordprocessingml/even_and_odd_headers.rb
|
|
1676
1700
|
- lib/uniword/wordprocessingml/extent.rb
|
|
1677
1701
|
- lib/uniword/wordprocessingml/fallback.rb
|
|
1678
1702
|
- lib/uniword/wordprocessingml/field_char.rb
|
|
@@ -1682,6 +1706,8 @@ files:
|
|
|
1682
1706
|
- lib/uniword/wordprocessingml/footer.rb
|
|
1683
1707
|
- lib/uniword/wordprocessingml/footer_reference.rb
|
|
1684
1708
|
- lib/uniword/wordprocessingml/footnote.rb
|
|
1709
|
+
- lib/uniword/wordprocessingml/footnote_pos.rb
|
|
1710
|
+
- lib/uniword/wordprocessingml/footnote_pr.rb
|
|
1685
1711
|
- lib/uniword/wordprocessingml/footnote_ref.rb
|
|
1686
1712
|
- lib/uniword/wordprocessingml/footnote_reference.rb
|
|
1687
1713
|
- lib/uniword/wordprocessingml/footnotes.rb
|
|
@@ -1690,21 +1716,30 @@ files:
|
|
|
1690
1716
|
- lib/uniword/wordprocessingml/grid_after.rb
|
|
1691
1717
|
- lib/uniword/wordprocessingml/grid_before.rb
|
|
1692
1718
|
- lib/uniword/wordprocessingml/grid_col.rb
|
|
1719
|
+
- lib/uniword/wordprocessingml/hdr_shape_defaults.rb
|
|
1693
1720
|
- lib/uniword/wordprocessingml/header.rb
|
|
1694
1721
|
- lib/uniword/wordprocessingml/header_reference.rb
|
|
1695
1722
|
- lib/uniword/wordprocessingml/hide_mark.rb
|
|
1696
1723
|
- lib/uniword/wordprocessingml/hyperlink.rb
|
|
1724
|
+
- lib/uniword/wordprocessingml/hyphenation_zone.rb
|
|
1697
1725
|
- lib/uniword/wordprocessingml/imprint.rb
|
|
1698
1726
|
- lib/uniword/wordprocessingml/inline.rb
|
|
1699
1727
|
- lib/uniword/wordprocessingml/instr_text.rb
|
|
1728
|
+
- lib/uniword/wordprocessingml/int_lim.rb
|
|
1729
|
+
- lib/uniword/wordprocessingml/l_margin.rb
|
|
1700
1730
|
- lib/uniword/wordprocessingml/last_rendered_page_break.rb
|
|
1701
1731
|
- lib/uniword/wordprocessingml/latent_styles.rb
|
|
1702
1732
|
- lib/uniword/wordprocessingml/level.rb
|
|
1703
1733
|
- lib/uniword/wordprocessingml/link.rb
|
|
1734
|
+
- lib/uniword/wordprocessingml/list_separator.rb
|
|
1704
1735
|
- lib/uniword/wordprocessingml/lvl_jc.rb
|
|
1705
1736
|
- lib/uniword/wordprocessingml/lvl_text.rb
|
|
1737
|
+
- lib/uniword/wordprocessingml/math_font.rb
|
|
1738
|
+
- lib/uniword/wordprocessingml/math_pr.rb
|
|
1706
1739
|
- lib/uniword/wordprocessingml/mc_requires.rb
|
|
1740
|
+
- lib/uniword/wordprocessingml/mirror_margins.rb
|
|
1707
1741
|
- lib/uniword/wordprocessingml/multi_level_type.rb
|
|
1742
|
+
- lib/uniword/wordprocessingml/nary_lim.rb
|
|
1708
1743
|
- lib/uniword/wordprocessingml/next.rb
|
|
1709
1744
|
- lib/uniword/wordprocessingml/no_break_hyphen.rb
|
|
1710
1745
|
- lib/uniword/wordprocessingml/no_wrap.rb
|
|
@@ -1730,9 +1765,14 @@ files:
|
|
|
1730
1765
|
- lib/uniword/wordprocessingml/picture.rb
|
|
1731
1766
|
- lib/uniword/wordprocessingml/position_tab.rb
|
|
1732
1767
|
- lib/uniword/wordprocessingml/proof_err.rb
|
|
1768
|
+
- lib/uniword/wordprocessingml/proof_state.rb
|
|
1769
|
+
- lib/uniword/wordprocessingml/r_margin.rb
|
|
1733
1770
|
- lib/uniword/wordprocessingml/r_pr_default.rb
|
|
1734
1771
|
- lib/uniword/wordprocessingml/recipient_data.rb
|
|
1735
1772
|
- lib/uniword/wordprocessingml/recipients.rb
|
|
1773
|
+
- lib/uniword/wordprocessingml/rsid.rb
|
|
1774
|
+
- lib/uniword/wordprocessingml/rsid_root.rb
|
|
1775
|
+
- lib/uniword/wordprocessingml/rsids.rb
|
|
1736
1776
|
- lib/uniword/wordprocessingml/run.rb
|
|
1737
1777
|
- lib/uniword/wordprocessingml/run_properties.rb
|
|
1738
1778
|
- lib/uniword/wordprocessingml/run_properties/accessors.rb
|
|
@@ -1745,8 +1785,10 @@ files:
|
|
|
1745
1785
|
- lib/uniword/wordprocessingml/shading.rb
|
|
1746
1786
|
- lib/uniword/wordprocessingml/shadow.rb
|
|
1747
1787
|
- lib/uniword/wordprocessingml/shape.rb
|
|
1788
|
+
- lib/uniword/wordprocessingml/shape_defaults.rb
|
|
1748
1789
|
- lib/uniword/wordprocessingml/simple_field.rb
|
|
1749
1790
|
- lib/uniword/wordprocessingml/simple_pos.rb
|
|
1791
|
+
- lib/uniword/wordprocessingml/small_frac.rb
|
|
1750
1792
|
- lib/uniword/wordprocessingml/soft_hyphen.rb
|
|
1751
1793
|
- lib/uniword/wordprocessingml/start.rb
|
|
1752
1794
|
- lib/uniword/wordprocessingml/structured_document_tag.rb
|
|
@@ -1768,6 +1810,8 @@ files:
|
|
|
1768
1810
|
- lib/uniword/wordprocessingml/structured_document_tag_properties.rb
|
|
1769
1811
|
- lib/uniword/wordprocessingml/style.rb
|
|
1770
1812
|
- lib/uniword/wordprocessingml/style_name.rb
|
|
1813
|
+
- lib/uniword/wordprocessingml/style_pane_format_filter.rb
|
|
1814
|
+
- lib/uniword/wordprocessingml/style_pane_sort_method.rb
|
|
1771
1815
|
- lib/uniword/wordprocessingml/styles.rb
|
|
1772
1816
|
- lib/uniword/wordprocessingml/styles/character_style_definition.rb
|
|
1773
1817
|
- lib/uniword/wordprocessingml/styles/list_style_definition.rb
|
|
@@ -1794,14 +1838,19 @@ files:
|
|
|
1794
1838
|
- lib/uniword/wordprocessingml/text.rb
|
|
1795
1839
|
- lib/uniword/wordprocessingml/text_box_content.rb
|
|
1796
1840
|
- lib/uniword/wordprocessingml/text_direction.rb
|
|
1841
|
+
- lib/uniword/wordprocessingml/theme_font_lang.rb
|
|
1797
1842
|
- lib/uniword/wordprocessingml/title_pg.rb
|
|
1798
1843
|
- lib/uniword/wordprocessingml/tr_height.rb
|
|
1799
1844
|
- lib/uniword/wordprocessingml/ui_priority.rb
|
|
1800
1845
|
- lib/uniword/wordprocessingml/val_int.rb
|
|
1801
1846
|
- lib/uniword/wordprocessingml/w14_attributes.rb
|
|
1847
|
+
- lib/uniword/wordprocessingml/w14_doc_id.rb
|
|
1848
|
+
- lib/uniword/wordprocessingml/w15_chart_tracking_ref_based.rb
|
|
1849
|
+
- lib/uniword/wordprocessingml/w15_doc_id.rb
|
|
1802
1850
|
- lib/uniword/wordprocessingml/web_settings.rb
|
|
1803
1851
|
- lib/uniword/wordprocessingml/width_after.rb
|
|
1804
1852
|
- lib/uniword/wordprocessingml/width_before.rb
|
|
1853
|
+
- lib/uniword/wordprocessingml/wrap_indent.rb
|
|
1805
1854
|
- lib/uniword/wordprocessingml/zoom.rb
|
|
1806
1855
|
- lib/uniword/wordprocessingml_2010.rb
|
|
1807
1856
|
- lib/uniword/wordprocessingml_2010/checkbox.rb
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "lutaml/model"
|
|
4
|
-
|
|
5
|
-
module Uniword
|
|
6
|
-
module Ooxml
|
|
7
|
-
module Types
|
|
8
|
-
# OOXML On/Off (boolean) type for attributes.
|
|
9
|
-
#
|
|
10
|
-
# OOXML uses "0" and "1" for boolean attribute values, not "false"/"true".
|
|
11
|
-
# When an attribute is not present (nil), it should remain nil, not be
|
|
12
|
-
# serialized as "0". This preserves the original document structure.
|
|
13
|
-
#
|
|
14
|
-
# @example Serialize a boolean attribute
|
|
15
|
-
# # Ruby true → XML "1"
|
|
16
|
-
# # Ruby false → XML "0"
|
|
17
|
-
# # Ruby nil → attribute not rendered
|
|
18
|
-
class OnOffType < Lutaml::Model::Type::String
|
|
19
|
-
# Bypass parent's initialize to avoid infinite recursion.
|
|
20
|
-
# Parent calls self.class.cast(value) which calls self.new(value).
|
|
21
|
-
def initialize(value)
|
|
22
|
-
@value = value
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# Cast value to OnOffType instance (for attribute serialization).
|
|
26
|
-
# nil remains nil (not present in source), preserving original structure.
|
|
27
|
-
# Already-wrapped OnOffType instances are returned as-is.
|
|
28
|
-
def self.cast(value, _options = {})
|
|
29
|
-
return nil if value.nil?
|
|
30
|
-
return value if value.is_a?(OnOffType)
|
|
31
|
-
|
|
32
|
-
raw = case value
|
|
33
|
-
when true, "true", "1", 1
|
|
34
|
-
true
|
|
35
|
-
when false, "false", "0", 0
|
|
36
|
-
false
|
|
37
|
-
else
|
|
38
|
-
false
|
|
39
|
-
end
|
|
40
|
-
new(raw)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# Convert stored boolean to OOXML "1" or "0"
|
|
44
|
-
def to_xml
|
|
45
|
-
return nil if @value.nil?
|
|
46
|
-
|
|
47
|
-
@value == true ? "1" : "0"
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# Fallback to_s also returns "1"/"0" for compatibility
|
|
51
|
-
def to_s
|
|
52
|
-
return "" if @value.nil?
|
|
53
|
-
|
|
54
|
-
to_xml
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
# Return the raw boolean value for Ruby comparisons
|
|
58
|
-
def to_bool
|
|
59
|
-
@value == true
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|