openxml-docx 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/examples/drawing-ml +134 -0
- data/examples/table +28 -0
- data/lib/openxml/docx.rb +9 -0
- data/lib/openxml/docx/attribute_builder.rb +17 -4
- data/lib/openxml/docx/elements/absolute_position_tab.rb +4 -19
- data/lib/openxml/docx/elements/bidi_embed.rb +1 -10
- data/lib/openxml/docx/elements/bidi_override.rb +1 -9
- data/lib/openxml/docx/elements/break.rb +3 -14
- data/lib/openxml/docx/elements/control.rb +5 -2
- data/lib/openxml/docx/elements/deleted_text.rb +1 -1
- data/lib/openxml/docx/elements/drawing.rb +9 -0
- data/lib/openxml/docx/elements/element.rb +2 -1
- data/lib/openxml/docx/elements/embed_bold.rb +25 -0
- data/lib/openxml/docx/elements/embed_bold_italic.rb +25 -0
- data/lib/openxml/docx/elements/embed_italic.rb +25 -0
- data/lib/openxml/docx/elements/embed_regular.rb +25 -0
- data/lib/openxml/docx/elements/family.rb +22 -0
- data/lib/openxml/docx/elements/font.rb +14 -0
- data/lib/openxml/docx/elements/grid_column.rb +2 -2
- data/lib/openxml/docx/elements/group_shape.rb +10 -0
- data/lib/openxml/docx/elements/markup_compatibility_alternate_content.rb +10 -0
- data/lib/openxml/docx/elements/markup_compatibility_choice.rb +13 -0
- data/lib/openxml/docx/elements/markup_compatibility_fallback.rb +10 -0
- data/lib/openxml/docx/elements/paper_source.rb +4 -2
- data/lib/openxml/docx/elements/section_properties.rb +9 -0
- data/lib/openxml/docx/elements/symbol.rb +4 -2
- data/lib/openxml/docx/elements/table.rb +1 -1
- data/lib/openxml/docx/elements/table_cell.rb +2 -1
- data/lib/openxml/docx/elements/table_row.rb +7 -5
- data/lib/openxml/docx/elements/text.rb +1 -10
- data/lib/openxml/docx/elements/vml_container.rb +10 -0
- data/lib/openxml/docx/elements/word_processing_drawing_anchor.rb +23 -0
- data/lib/openxml/docx/elements/word_processing_drawing_effect_extent.rb +16 -0
- data/lib/openxml/docx/elements/word_processing_drawing_extent.rb +14 -0
- data/lib/openxml/docx/elements/word_processing_drawing_nv_graphic_frame_properties.rb +11 -0
- data/lib/openxml/docx/elements/word_processing_drawing_object_nv_properties.rb +17 -0
- data/lib/openxml/docx/elements/word_processing_drawing_position_h.rb +23 -0
- data/lib/openxml/docx/elements/word_processing_drawing_position_offset.rb +10 -0
- data/lib/openxml/docx/elements/word_processing_drawing_position_v.rb +23 -0
- data/lib/openxml/docx/elements/word_processing_drawing_simple_position.rb +13 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_none.rb +10 -0
- data/lib/openxml/docx/elements/word_processing_shapes_body_properties.rb +58 -0
- data/lib/openxml/docx/elements/word_processing_shapes_shape.rb +12 -0
- data/lib/openxml/docx/elements/word_processing_shapes_shape_properties.rb +23 -0
- data/lib/openxml/docx/package.rb +73 -1
- data/lib/openxml/docx/parts/document.rb +6 -24
- data/lib/openxml/docx/parts/fonts.rb +35 -0
- data/lib/openxml/docx/parts/footer.rb +32 -0
- data/lib/openxml/docx/parts/header.rb +32 -0
- data/lib/openxml/docx/parts/settings.rb +6 -2
- data/lib/openxml/docx/parts/styles.rb +5 -6
- data/lib/openxml/docx/properties.rb +0 -1
- data/lib/openxml/docx/properties/alignment.rb +1 -1
- data/lib/openxml/docx/properties/base_property.rb +13 -0
- data/lib/openxml/docx/properties/border.rb +11 -9
- data/lib/openxml/docx/properties/color.rb +6 -4
- data/lib/openxml/docx/properties/column.rb +4 -2
- data/lib/openxml/docx/properties/columns.rb +6 -4
- data/lib/openxml/docx/properties/complex_property.rb +1 -1
- data/lib/openxml/docx/properties/conditional_formatting.rb +14 -12
- data/lib/openxml/docx/properties/document_grid.rb +4 -10
- data/lib/openxml/docx/properties/east_asian_layout.rb +6 -11
- data/lib/openxml/docx/properties/font.rb +18 -22
- data/lib/openxml/docx/properties/footer_reference.rb +21 -0
- data/lib/openxml/docx/properties/frame.rb +16 -47
- data/lib/openxml/docx/properties/header_reference.rb +21 -0
- data/lib/openxml/docx/properties/indentation.rb +11 -8
- data/lib/openxml/docx/properties/language.rb +5 -3
- data/lib/openxml/docx/properties/latent_styles.rb +9 -6
- data/lib/openxml/docx/properties/latent_styles_exception.rb +9 -6
- data/lib/openxml/docx/properties/line_numbering.rb +5 -11
- data/lib/openxml/docx/properties/manual_width.rb +4 -2
- data/lib/openxml/docx/properties/numbering.rb +4 -2
- data/lib/openxml/docx/properties/page_borders.rb +6 -19
- data/lib/openxml/docx/properties/page_margins.rb +10 -7
- data/lib/openxml/docx/properties/page_numbering.rb +66 -74
- data/lib/openxml/docx/properties/page_size.rb +5 -12
- data/lib/openxml/docx/properties/shading.rb +46 -52
- data/lib/openxml/docx/properties/spacing.rb +9 -14
- data/lib/openxml/docx/properties/table_border.rb +12 -10
- data/lib/openxml/docx/properties/table_cell_border.rb +12 -10
- data/lib/openxml/docx/properties/table_cell_margin.rb +6 -4
- data/lib/openxml/docx/properties/table_cell_spacing.rb +5 -3
- data/lib/openxml/docx/properties/table_cell_width.rb +5 -3
- data/lib/openxml/docx/properties/table_indent.rb +5 -3
- data/lib/openxml/docx/properties/table_layout.rb +2 -4
- data/lib/openxml/docx/properties/table_look.rb +8 -6
- data/lib/openxml/docx/properties/table_p_pr.rb +11 -30
- data/lib/openxml/docx/properties/table_row_height.rb +13 -0
- data/lib/openxml/docx/properties/table_width.rb +5 -3
- data/lib/openxml/docx/properties/underline.rb +13 -12
- data/lib/openxml/docx/properties/wafter.rb +5 -3
- data/lib/openxml/docx/properties/wbefore.rb +5 -3
- data/lib/openxml/docx/root_namespaces.rb +74 -0
- data/lib/openxml/docx/section.rb +2 -0
- data/lib/openxml/docx/style.rb +4 -4
- data/lib/openxml/docx/version.rb +1 -1
- data/lib/openxml/drawingml.rb +17 -0
- data/lib/openxml/drawingml/elements.rb +13 -0
- data/lib/openxml/drawingml/elements/adjust_values_list.rb +11 -0
- data/lib/openxml/drawingml/elements/blip_fill.rb +14 -0
- data/lib/openxml/drawingml/elements/extension.rb +13 -0
- data/lib/openxml/drawingml/elements/extension_list.rb +11 -0
- data/lib/openxml/drawingml/elements/extents.rb +14 -0
- data/lib/openxml/drawingml/elements/graphic.rb +10 -0
- data/lib/openxml/drawingml/elements/graphic_data.rb +12 -0
- data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +17 -0
- data/lib/openxml/drawingml/elements/head_end.rb +28 -0
- data/lib/openxml/drawingml/elements/no_fill.rb +10 -0
- data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +17 -0
- data/lib/openxml/drawingml/elements/non_visual_picture_drawing_properties.rb +12 -0
- data/lib/openxml/drawingml/elements/non_visual_picture_properties.rb +10 -0
- data/lib/openxml/drawingml/elements/offset.rb +14 -0
- data/lib/openxml/drawingml/elements/outline.rb +36 -0
- data/lib/openxml/drawingml/elements/picture.rb +10 -0
- data/lib/openxml/drawingml/elements/preset_geometry.rb +210 -0
- data/lib/openxml/drawingml/elements/round.rb +10 -0
- data/lib/openxml/drawingml/elements/shape_guide.rb +40 -0
- data/lib/openxml/drawingml/elements/solid_fill.rb +10 -0
- data/lib/openxml/drawingml/elements/srgb_color.rb +14 -0
- data/lib/openxml/drawingml/elements/tail_end.rb +28 -0
- data/lib/openxml/drawingml/elements/transform_effect.rb +18 -0
- data/lib/openxml/drawingml/elements/wordprocessing_shape_group.rb +11 -0
- data/lib/openxml/vml.rb +17 -0
- data/lib/openxml/vml/elements.rb +13 -0
- data/lib/openxml/vml/elements/group.rb +88 -0
- data/lib/openxml/vml/elements/rectangle.rb +115 -0
- data/lib/openxml/vml/elements/rounded_rectangle.rb +121 -0
- data/openxml-docx.gemspec +1 -1
- data/spec/elements/absolute_position_tab_spec.rb +15 -47
- data/spec/elements/bidi_embed_spec.rb +4 -8
- data/spec/elements/bidi_override_spec.rb +4 -8
- data/spec/elements/break_spec.rb +8 -31
- data/spec/elements/content_part_spec.rb +2 -2
- data/spec/elements/control_spec.rb +6 -6
- data/spec/elements/deleted_text_spec.rb +2 -2
- data/spec/elements/drawing_spec.rb +11 -0
- data/spec/elements/drawingml/adjust_values_list_spec.rb +8 -0
- data/spec/elements/drawingml/blip_fill_spec.rb +34 -0
- data/spec/elements/drawingml/extension_list_spec.rb +8 -0
- data/spec/elements/drawingml/extension_spec.rb +19 -0
- data/spec/elements/drawingml/extents_spec.rb +33 -0
- data/spec/elements/drawingml/graphic_data_spec.rb +19 -0
- data/spec/elements/drawingml/graphic_frame_locks_spec.rb +78 -0
- data/spec/elements/drawingml/graphic_spec.rb +8 -0
- data/spec/elements/drawingml/head_end_spec.rb +45 -0
- data/spec/elements/drawingml/no_fill_spec.rb +8 -0
- data/spec/elements/drawingml/non_visual_drawing_properties_spec.rb +63 -0
- data/spec/elements/drawingml/non_visual_picture_drawing_properties_spec.rb +18 -0
- data/spec/elements/drawingml/non_visual_picture_properties_spec.rb +8 -0
- data/spec/elements/drawingml/offset_spec.rb +32 -0
- data/spec/elements/drawingml/outline_spec.rb +58 -0
- data/spec/elements/drawingml/picture_spec.rb +8 -0
- data/spec/elements/drawingml/preset_geometry_spec.rb +19 -0
- data/spec/elements/drawingml/round_spec.rb +8 -0
- data/spec/elements/drawingml/shape_guide_spec.rb +49 -0
- data/spec/elements/drawingml/solid_fill_spec.rb +8 -0
- data/spec/elements/drawingml/srgb_color_spec.rb +20 -0
- data/spec/elements/drawingml/tail_end_spec.rb +44 -0
- data/spec/elements/drawingml/transform_effect_spec.rb +80 -0
- data/spec/elements/drawingml/wordprocessing_shape_group_spec.rb +12 -0
- data/spec/elements/group_shape_spec.rb +11 -0
- data/spec/elements/markup_compatibility_alternate_content_spec.rb +11 -0
- data/spec/elements/markup_compatibility_choice_spec.rb +22 -0
- data/spec/elements/markup_compatibility_fallback_spec.rb +11 -0
- data/spec/elements/section_properties_spec.rb +12 -0
- data/spec/elements/symbol_spec.rb +4 -7
- data/spec/elements/text_spec.rb +2 -2
- data/spec/elements/vml/group_spec.rb +542 -0
- data/spec/elements/vml/rectangle_spec.rb +739 -0
- data/spec/elements/vml/rounded_rectangle_spec.rb +656 -0
- data/spec/elements/vml_container_spec.rb +11 -0
- data/spec/elements/word_processing_drawing_anchor_spec.rb +40 -0
- data/spec/elements/word_processing_drawing_effect_extent_spec.rb +57 -0
- data/spec/elements/word_processing_drawing_extent_spec.rb +34 -0
- data/spec/elements/word_processing_drawing_nv_graphic_frame_properties_spec.rb +11 -0
- data/spec/elements/word_processing_drawing_object_nv_properties_spec.rb +67 -0
- data/spec/elements/word_processing_drawing_position_h_spec.rb +21 -0
- data/spec/elements/word_processing_drawing_position_v_spec.rb +21 -0
- data/spec/elements/word_processing_drawing_simple_position_spec.rb +34 -0
- data/spec/elements/word_processing_drawing_wrap_none_spec.rb +12 -0
- data/spec/elements/word_processing_shapes_body_properties_spec.rb +223 -0
- data/spec/elements/word_processing_shapes_shape_properties_spec.rb +21 -0
- data/spec/elements/word_processing_shapes_shape_spec.rb +23 -0
- data/spec/parts/footer_spec.rb +33 -0
- data/spec/parts/header_spec.rb +33 -0
- data/spec/properties/footer_reference_spec.rb +32 -0
- data/spec/properties/header_reference_spec.rb +32 -0
- data/spec/properties/page_numbering_spec.rb +1 -1
- data/spec/properties/{table_cell_fit_text.rb → table_cell_fit_text_spec.rb} +0 -0
- data/spec/properties/{table_cell_width.rb → table_cell_width_spec.rb} +0 -0
- data/spec/properties/table_layout_spec.rb +14 -12
- data/spec/properties/{table_row_height.rb → table_row_height_spec.rb} +0 -0
- data/spec/section_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/support/data/elements/grid_column_element.xml +1 -1
- data/spec/support/data/elements/table_grid_element.xml +1 -1
- data/spec/support/data/parts/document_with_children_part.xml +2 -1
- data/spec/support/data/parts/document_with_multiple_sections_part.xml +1 -1
- data/spec/support/data/parts/document_with_one_section_part.xml +1 -1
- data/spec/support/data/parts/empty_document_part.xml +1 -1
- data/spec/support/data/parts/empty_footer_part.xml +1 -0
- data/spec/support/data/parts/empty_header_part.xml +1 -0
- data/spec/support/data/parts/footer_with_children_part.xml +1 -0
- data/spec/support/data/parts/header_with_children_part.xml +1 -0
- data/spec/support/element_test_macros.rb +58 -9
- metadata +126 -9
- data/lib/openxml/docx/properties/tr_height.rb +0 -19
- data/lib/openxml/docx/properties/width_property.rb +0 -17
@@ -4,12 +4,15 @@ module OpenXml
|
|
4
4
|
class LatentStylesException < ComplexProperty
|
5
5
|
tag :lsdException
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
with_namespace :w do
|
8
|
+
attribute :locked, expects: :true_or_false
|
9
|
+
attribute :style_name, expects: :string, displays_as: :name
|
10
|
+
attribute :qFormat, expects: :true_or_false
|
11
|
+
attribute :semi_hidden, expects: :true_or_false, displays_as: :semiHidden
|
12
|
+
attribute :ui_priority, expects: :integer, displays_as: :uiPriority
|
13
|
+
attribute :unhide_when_used, expects: :true_or_false, displays_as: :unhideWhenUsed
|
14
|
+
end
|
15
|
+
|
13
16
|
|
14
17
|
def initialize(style_name)
|
15
18
|
self.style_name = style_name
|
@@ -4,17 +4,11 @@ module OpenXml
|
|
4
4
|
class LineNumbering < ComplexProperty
|
5
5
|
tag :lnNumType
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
VALID_LINE_NUMBERING_RESTARTS = %i(continuous newPage newSection)
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def valid_line_numbering_restart(value)
|
17
|
-
valid_in? value, VALID_LINE_NUMBERING_RESTARTS
|
7
|
+
with_namespace :w do
|
8
|
+
attribute :count_by, expects: :integer
|
9
|
+
attribute :distance, expects: :positive_integer
|
10
|
+
attribute :restart, one_of: %i(continuous newPage newSection)
|
11
|
+
attribute :start, expects: :integer
|
18
12
|
end
|
19
13
|
|
20
14
|
end
|
@@ -4,8 +4,10 @@ module OpenXml
|
|
4
4
|
class ManualWidth < ComplexProperty
|
5
5
|
tag :fitText
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
with_namespace :w do
|
8
|
+
attribute :id, expects: :integer
|
9
|
+
attribute :width, expects: :positive_integer, displays_as: :val
|
10
|
+
end
|
9
11
|
|
10
12
|
end
|
11
13
|
end
|
@@ -4,8 +4,10 @@ module OpenXml
|
|
4
4
|
class Numbering < ComplexProperty
|
5
5
|
tag :numPr
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
with_namespace :w do
|
8
|
+
attribute :level, expects: :positive_integer, displays_as: :ilvl
|
9
|
+
attribute :id, expects: :positive_integer, displays_as: :numId
|
10
|
+
end
|
9
11
|
|
10
12
|
def to_xml(xml)
|
11
13
|
return unless render?
|
@@ -5,9 +5,12 @@ module OpenXml
|
|
5
5
|
attr_reader :left, :right, :top, :bottom
|
6
6
|
|
7
7
|
tag :pgBorders
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
|
9
|
+
with_namespace :w do
|
10
|
+
attribute :display, one_of: %i(allPages firstPage notFirstPage)
|
11
|
+
attribute :offset_from, one_of: %i(page text)
|
12
|
+
attribute :z_order, one_of: %i(front back)
|
13
|
+
end
|
11
14
|
|
12
15
|
def initialize
|
13
16
|
@left = new_border :left
|
@@ -25,10 +28,6 @@ module OpenXml
|
|
25
28
|
xml["w"].public_send(tag, xml_attributes) { render_borders_xml(xml) }
|
26
29
|
end
|
27
30
|
|
28
|
-
VALID_DISPLAYS = %i(allPages firstPage notFirstPage)
|
29
|
-
VALID_OFFSETS = %i(page text)
|
30
|
-
VALID_Z_ORDERS = %i(front back)
|
31
|
-
|
32
31
|
private
|
33
32
|
|
34
33
|
def render_borders_xml(xml)
|
@@ -43,18 +42,6 @@ module OpenXml
|
|
43
42
|
OpenXml::Docx::Properties::Border.new direction
|
44
43
|
end
|
45
44
|
|
46
|
-
def valid_display(value)
|
47
|
-
valid_in? value, VALID_DISPLAYS
|
48
|
-
end
|
49
|
-
|
50
|
-
def valid_offset(value)
|
51
|
-
valid_in? value, VALID_OFFSETS
|
52
|
-
end
|
53
|
-
|
54
|
-
def valid_z_order(value)
|
55
|
-
valid_in? value, VALID_Z_ORDERS
|
56
|
-
end
|
57
|
-
|
58
45
|
end
|
59
46
|
end
|
60
47
|
end
|
@@ -4,13 +4,16 @@ module OpenXml
|
|
4
4
|
class PageMargins < ComplexProperty
|
5
5
|
tag :pgMar
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
with_namespace :w do
|
8
|
+
attribute :bottom, expects: :integer
|
9
|
+
attribute :footer, expects: :positive_integer
|
10
|
+
attribute :gutter, expects: :positive_integer
|
11
|
+
attribute :header, expects: :positive_integer
|
12
|
+
attribute :left, expects: :positive_integer
|
13
|
+
attribute :right, expects: :positive_integer
|
14
|
+
attribute :top, expects: :integer
|
15
|
+
end
|
16
|
+
|
14
17
|
end
|
15
18
|
end
|
16
19
|
end
|
@@ -4,84 +4,76 @@ module OpenXml
|
|
4
4
|
class PageNumbering < ComplexProperty
|
5
5
|
tag :pgNumType
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
with_namespace :w do
|
8
|
+
attribute :chapter_separator, one_of: %i(colon emDash enDash hyphen period), displays_as: :chapSep
|
9
|
+
attribute :chapter_style, expects: :integer, displays_as: :chapStyle
|
10
|
+
attribute :start, expects: :integer
|
11
|
+
attribute :format, displays_as: :fmt, one_of: %i(aiueo
|
12
|
+
aiueoFullWidth
|
13
|
+
arabicAbjad
|
14
|
+
arabicAlpha
|
15
|
+
bahtText
|
16
|
+
bullet
|
17
|
+
cardinalText
|
18
|
+
chicago
|
19
|
+
chineseCounting
|
20
|
+
chineseCountingThousand
|
21
|
+
chineseLegalSimplified
|
22
|
+
chosung
|
23
|
+
custom
|
24
|
+
decimal
|
25
|
+
decimalEnclosedCircle
|
26
|
+
decimalEnclosedCircleChinese
|
27
|
+
decimalEnclosedFullstop
|
28
|
+
decimalEnclosedParen
|
29
|
+
decimalFullWidth
|
30
|
+
decimalHalfWidth
|
31
|
+
decimalZero
|
32
|
+
dollarText
|
33
|
+
ganada
|
34
|
+
hebrew1
|
35
|
+
hebrew2
|
36
|
+
hex
|
37
|
+
hindiConsonants
|
38
|
+
hindiCounting
|
39
|
+
hindiNumbers
|
40
|
+
hindiVowels
|
41
|
+
ideographDigital
|
42
|
+
ideographEnclosedCircle
|
43
|
+
taiwaneseDigital
|
44
|
+
ideographLegalTraditional
|
45
|
+
ideographTraditional
|
46
|
+
ideographZodiac
|
47
|
+
ideographZodiacTraditional
|
48
|
+
iroha
|
49
|
+
irohaFullWidth
|
50
|
+
japaneseCounting
|
51
|
+
japaneseDigitalTenThousand
|
52
|
+
japaneseLegal
|
53
|
+
koreanCounting
|
54
|
+
koreanDigital
|
55
|
+
koreanDigital2
|
56
|
+
koreanLegal
|
57
|
+
lowerLetter
|
58
|
+
lowerRoman
|
59
|
+
none
|
60
|
+
numberInDash
|
61
|
+
ordinal
|
62
|
+
ordinalText
|
63
|
+
russianLower
|
64
|
+
russianUpper
|
65
|
+
taiwaneseCounting
|
66
|
+
taiwaneseCountingThousand
|
67
|
+
thaiCounting
|
68
|
+
thaiLetters
|
69
|
+
thaiNumbers
|
70
|
+
upperLetter
|
71
|
+
upperRoman
|
72
|
+
vietnameseCounting)
|
11
73
|
|
12
|
-
VALID_CHAPTER_SEPARATORS = %i(colon emDash enDash hyphen period)
|
13
|
-
VALID_PAGE_NUMBER_FORMATS = %i(aiueo
|
14
|
-
aiueoFullWidth
|
15
|
-
arabicAbjad
|
16
|
-
arabicAlpha
|
17
|
-
bahtText
|
18
|
-
bullet
|
19
|
-
cardinalText
|
20
|
-
chicago
|
21
|
-
chineseCounting
|
22
|
-
chineseCountingThousand
|
23
|
-
chineseLegalSimplified
|
24
|
-
chosung
|
25
|
-
custom
|
26
|
-
decimal
|
27
|
-
decimalEnclosedCircle
|
28
|
-
decimalEnclosedCircleChinese
|
29
|
-
decimalEnclosedFullstop
|
30
|
-
decimalEnclosedParen
|
31
|
-
decimalFullWidth
|
32
|
-
decimalHalfWidth
|
33
|
-
decimalZero
|
34
|
-
dollarText
|
35
|
-
ganada
|
36
|
-
hebrew1
|
37
|
-
hebrew2
|
38
|
-
hex
|
39
|
-
hindiConsonants
|
40
|
-
hindiCounting
|
41
|
-
hindiNumbers
|
42
|
-
hindiVowels
|
43
|
-
ideographDigital
|
44
|
-
ideographEnclosedCircle
|
45
|
-
taiwaneseDigital
|
46
|
-
ideographLegalTraditional
|
47
|
-
ideographTraditional
|
48
|
-
ideographZodiac
|
49
|
-
ideographZodiacTraditional
|
50
|
-
iroha
|
51
|
-
irohaFullWidth
|
52
|
-
japaneseCounting
|
53
|
-
japaneseDigitalTenThousand
|
54
|
-
japaneseLegal
|
55
|
-
koreanCounting
|
56
|
-
koreanDigital
|
57
|
-
koreanDigital2
|
58
|
-
koreanLegal
|
59
|
-
lowerLetter
|
60
|
-
lowerRoman
|
61
|
-
none
|
62
|
-
numberInDash
|
63
|
-
ordinal
|
64
|
-
ordinalText
|
65
|
-
russianLower
|
66
|
-
russianUpper
|
67
|
-
taiwaneseCounting
|
68
|
-
taiwaneseCountingThousand
|
69
|
-
thaiCounting
|
70
|
-
thaiLetters
|
71
|
-
thaiNumbers
|
72
|
-
upperLetter
|
73
|
-
upperRoman
|
74
|
-
vietnameseCounting)
|
75
74
|
|
76
|
-
private
|
77
|
-
|
78
|
-
def valid_chapter_separator(value)
|
79
|
-
valid_in? value, VALID_CHAPTER_SEPARATORS
|
80
75
|
end
|
81
76
|
|
82
|
-
def valid_page_number_format(value)
|
83
|
-
valid_in? value, VALID_PAGE_NUMBER_FORMATS
|
84
|
-
end
|
85
77
|
|
86
78
|
end
|
87
79
|
end
|
@@ -4,19 +4,12 @@ module OpenXml
|
|
4
4
|
class PageSize < ComplexProperty
|
5
5
|
tag :pgSz
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
VALID_PAGE_ORIENTATIONS = %i(portrait landscape)
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def valid_orientation(value)
|
17
|
-
valid_in? value, VALID_PAGE_ORIENTATIONS
|
7
|
+
with_namespace :w do
|
8
|
+
attribute :code, expects: :integer
|
9
|
+
attribute :height, expects: :positive_integer, displays_as: :h
|
10
|
+
attribute :orientation, one_of: %i(portrait landscape), displays_as: :orient
|
11
|
+
attribute :width, expects: :positive_integer, displays_as: :w
|
18
12
|
end
|
19
|
-
|
20
13
|
end
|
21
14
|
end
|
22
15
|
end
|
@@ -4,58 +4,52 @@ module OpenXml
|
|
4
4
|
class Shading < ComplexProperty
|
5
5
|
tag :shd
|
6
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
|
-
attribute :pattern, expects: :shading_pattern, displays_as: :val
|
54
|
-
|
55
|
-
private
|
56
|
-
|
57
|
-
def shading_pattern(value)
|
58
|
-
valid_in? value, VALID_SHADING_PATTERNS
|
7
|
+
with_namespace :w do
|
8
|
+
attribute :color, expects: :hex_color
|
9
|
+
attribute :fill, expects: :hex_color
|
10
|
+
attribute :theme_color, expects: :valid_theme_color
|
11
|
+
attribute :theme_fill, expects: :valid_theme_color
|
12
|
+
attribute :theme_fill_shade, expects: :hex_digit
|
13
|
+
attribute :theme_fill_tint, expects: :hex_digit
|
14
|
+
attribute :theme_shade, expects: :hex_digit
|
15
|
+
attribute :theme_tint, expects: :hex_digit
|
16
|
+
attribute :pattern, displays_as: :val, one_of: %i(clear
|
17
|
+
diagCross
|
18
|
+
diagStripe
|
19
|
+
horzCross
|
20
|
+
horzStripe
|
21
|
+
nil
|
22
|
+
pct10
|
23
|
+
pct12
|
24
|
+
pct15
|
25
|
+
pct20
|
26
|
+
pct25
|
27
|
+
pct30
|
28
|
+
pct35
|
29
|
+
pct37
|
30
|
+
pct45
|
31
|
+
pct5
|
32
|
+
pct50
|
33
|
+
pct55
|
34
|
+
pct60
|
35
|
+
pct62
|
36
|
+
pct65
|
37
|
+
pct70
|
38
|
+
pct75
|
39
|
+
pct80
|
40
|
+
pct85
|
41
|
+
pct87
|
42
|
+
pct90
|
43
|
+
pct95
|
44
|
+
reverseDiagStripe
|
45
|
+
solid
|
46
|
+
thinDiagCross
|
47
|
+
thinDiagStripe
|
48
|
+
thinHorzCross
|
49
|
+
thinHorzStripe
|
50
|
+
thinReverseDiagStripe
|
51
|
+
thinVertStripe
|
52
|
+
vertStripe)
|
59
53
|
end
|
60
54
|
|
61
55
|
end
|
@@ -2,21 +2,16 @@ module OpenXml
|
|
2
2
|
module Docx
|
3
3
|
module Properties
|
4
4
|
class Spacing < ComplexProperty
|
5
|
-
VALID_LINE_RULES = %i(atLeast auto exact)
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def valid_line_rule(value)
|
19
|
-
valid_in? value, VALID_LINE_RULES
|
6
|
+
with_namespace :w do
|
7
|
+
attribute :after, expects: :positive_integer
|
8
|
+
attribute :after_auto, expects: :on_or_off, displays_as: :afterAutospacing
|
9
|
+
attribute :after_lines, expects: :integer
|
10
|
+
attribute :before, expects: :positive_integer
|
11
|
+
attribute :before_auto, expects: :on_or_off, displays_as: :beforeAutospacing
|
12
|
+
attribute :before_lines, expects: :integer
|
13
|
+
attribute :line, expects: :integer
|
14
|
+
attribute :line_rule, one_of: %i(atLeast auto exact)
|
20
15
|
end
|
21
16
|
|
22
17
|
end
|