ooxml_parser 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +18 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +20 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/order.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_index.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point/text_value.rb +15 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point_count.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/view_3d.rb +32 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +81 -74
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +20 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +15 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +15 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +22 -11
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing/doc_properties.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +34 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +9 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +18 -25
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +4 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +23 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +15 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +104 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative/picture_dimension.rb +17 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_vertical.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +17 -16
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +12 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties/shape_placeholder.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +27 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties/preset_text_warp.rb +7 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +20 -11
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +18 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +11 -9
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb +15 -27
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +13 -9
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +20 -23
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +27 -22
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip/alpha_mod_fix.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry/shape_adjust_value_list/shape_guide.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry/shape_adjust_value_list.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +3 -3
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +22 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +20 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +9 -8
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +15 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +14 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +15 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +18 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +12 -11
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +20 -24
- data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/color.rb +48 -182
- data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +1 -63
- data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +17 -20
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop/preset_color.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +20 -7
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +12 -11
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +17 -17
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +15 -9
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +19 -16
- data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +10 -6
- data/lib/ooxml_parser/common_parser/common_data/font_style.rb +1 -61
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +33 -26
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_document_object_helper.rb +97 -0
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +23 -37
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +71 -23
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/language.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +11 -7
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/position.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_spacing.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_style.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/size.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +92 -40
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +12 -8
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +37 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +53 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +6 -6
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list/presentation_tab.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs/paragraph_tab.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb +11 -8
- data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +20 -12
- data/lib/ooxml_parser/common_parser/common_data/relationships/relationship.rb +13 -7
- data/lib/ooxml_parser/common_parser/common_data/relationships.rb +36 -4
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +12 -8
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +18 -19
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +9 -8
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +17 -14
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +16 -23
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +21 -40
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_column_band_size.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +50 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_row_band_size.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +28 -23
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties/vertical_merge.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +71 -69
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb +18 -10
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +19 -17
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +31 -48
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line/line_join.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +25 -19
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties/table_row_height.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +20 -10
- data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +20 -16
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid/grid_column.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +27 -3
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb +20 -13
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +54 -37
- data/lib/ooxml_parser/common_parser/common_data/table.rb +23 -17
- data/lib/ooxml_parser/common_parser/common_data/underline.rb +13 -10
- data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +29 -0
- data/lib/ooxml_parser/common_parser/parser.rb +32 -4
- data/lib/ooxml_parser/configuration.rb +3 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comment.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +16 -16
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +18 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb +18 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style/document_style_helper.rb +37 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +43 -14
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/accent.rb +19 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties/argument_size.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +24 -4
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +14 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +27 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +15 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +14 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +23 -7
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +16 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +20 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +4 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +36 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_grow.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_limit_location.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +19 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +52 -183
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +89 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object/ole_object.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +24 -17
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +7 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +15 -10
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +43 -245
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb +19 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +24 -65
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/inserted.rb +41 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +146 -172
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +45 -26
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/multilevel_type.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_justification.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_text.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/numbering_format.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/start.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +65 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +42 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition/abstract_numbering_id.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +45 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +15 -4
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +24 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +6 -12
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/footnote_properties.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +8 -9
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +31 -24
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +61 -64
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +56 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/paragraph_properties_default.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/run_properties_default.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +19 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +49 -54
- data/lib/ooxml_parser/docx_parser/docx_parser.rb +2 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_helpers.rb +13 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +15 -12
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties/stretch.rb +11 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties.rb +21 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +19 -6
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +27 -16
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +13 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +11 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +19 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +17 -12
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +15 -14
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +18 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +9 -11
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition.rb +16 -13
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing.rb +23 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +21 -19
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +15 -11
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +52 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +13 -7
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action.rb +11 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +13 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb +9 -14
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +30 -67
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb +11 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +6 -3
- data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +1 -1
- data/lib/ooxml_parser/version.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +28 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +25 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +38 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +35 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +38 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb +24 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +47 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +36 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_helpers.rb +11 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +11 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +8 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb +12 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +12 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +29 -8
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/x14_table.rb +24 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb +21 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +30 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb +29 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb +25 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +23 -29
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/alignment.rb +15 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style.rb +70 -37
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +16 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +31 -9
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +34 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +20 -9
- data/lib/ooxml_parser/xlsx_parser/xlsx_parser.rb +1 -1
- data/lib/ooxml_parser.rb +0 -1
- metadata +122 -58
- data/lib/ooxml_parser/common_parser/common_data/alingment.rb +0 -56
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2007_chart_style.rb +0 -17
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2010_chart_style.rb +0 -17
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_group_element.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_grouped_drawing.rb +0 -34
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_gradient_color.rb +0 -30
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_single_gradient_color.rb +0 -6
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/solid_color/docx_solid_color.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_element.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end/line_size.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_style/docx_shape_style.rb +0 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/common_non_visual_properties.rb +0 -25
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_properties.rb +0 -19
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_shape_properties.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape.rb +0 -28
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_placeholder.rb +0 -18
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/ooxml_shift.rb +0 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/transform_effect.rb +0 -28
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties.rb +0 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/ooxml_text_box.rb +0 -26
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb +0 -23
- data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching/fill_rectangle.rb +0 -22
- data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching.rb +0 -12
- data/lib/ooxml_parser/common_parser/common_data/colors/image_properties.rb +0 -16
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/strikeout.rb +0 -16
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties/numbering_level.rb +0 -25
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties.rb +0 -69
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering.rb +0 -18
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_cell_margin.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_elements.rb +0 -21
- data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/line_join.rb +0 -19
- data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/table_cell_style.rb +0 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/operator.rb +0 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/bookmark.rb +0 -10
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/paragraph_tab.rb +0 -19
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/style_parametres.rb +0 -35
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style.rb +0 -56
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/image.rb +0 -15
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/size.rb +0 -84
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping/grouping_properties.rb +0 -16
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character/excel_comment_character_properties.rb +0 -27
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character.rb +0 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position/xlsx_drawing_position_parameters.rb +0 -22
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position.rb +0 -22
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_shape_grouping.rb +0 -37
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/foreground_color.rb +0 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/ooxml_font.rb +0 -36
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_table.rb +0 -30
@@ -1,33 +1,36 @@
|
|
1
|
-
# DOCX Color Scheme
|
2
1
|
module OoxmlParser
|
2
|
+
# DOCX Color Scheme
|
3
3
|
class DocxColorScheme < OOXMLDocumentObject
|
4
4
|
attr_accessor :color, :type
|
5
5
|
|
6
|
-
def initialize
|
6
|
+
def initialize(parent: nil)
|
7
7
|
@color = Color.new
|
8
8
|
@type = :unknown
|
9
|
+
@parent = parent
|
9
10
|
end
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
# Parse DocxColorScheme object
|
13
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
14
|
+
# @return [DocxColorScheme] result of parsing
|
15
|
+
def parse(node)
|
16
|
+
node.xpath('*').each do |node_child|
|
17
|
+
case node_child.name
|
15
18
|
when 'solidFill'
|
16
|
-
|
17
|
-
|
19
|
+
@type = :solid
|
20
|
+
@color = Color.parse_color_model(node_child)
|
18
21
|
when 'gradFill'
|
19
|
-
|
20
|
-
|
22
|
+
@type = :gradient
|
23
|
+
@color = GradientColor.new(parent: self).parse(node_child)
|
21
24
|
when 'noFill'
|
22
|
-
|
23
|
-
|
25
|
+
@color = :none
|
26
|
+
@type = :none
|
24
27
|
when 'srgbClr'
|
25
|
-
|
28
|
+
@color = Color.new(parent: self).parse_hex_string(node_child.attribute('val').value)
|
26
29
|
when 'schemeClr'
|
27
|
-
|
30
|
+
@color = Color.parse_scheme_color(node_child)
|
28
31
|
end
|
29
32
|
end
|
30
|
-
|
33
|
+
self
|
31
34
|
end
|
32
35
|
|
33
36
|
def to_s
|
@@ -1,20 +1,22 @@
|
|
1
|
-
# Docx Pattern Fill Data
|
2
1
|
module OoxmlParser
|
2
|
+
# Docx Pattern Fill Data
|
3
3
|
class DocxPatternFill < OOXMLDocumentObject
|
4
4
|
attr_accessor :foreground_color, :background_color, :preset
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
# Parse DocxPatternFill object
|
7
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
8
|
+
# @return [DocxPatternFill] result of parsing
|
9
|
+
def parse(node)
|
10
|
+
@preset = node.attribute('prst').value.to_sym
|
11
|
+
node.xpath('*').each do |node_child|
|
12
|
+
case node_child.name
|
11
13
|
when 'fgClr'
|
12
|
-
|
14
|
+
@foreground_color = Color.parse_color_model(node_child)
|
13
15
|
when 'bgClr'
|
14
|
-
|
16
|
+
@background_color = Color.parse_color_model(node_child)
|
15
17
|
end
|
16
18
|
end
|
17
|
-
|
19
|
+
self
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Docx Shape Line Element
|
3
|
+
class DocxShapeLineElement < OOXMLDocumentObject
|
4
|
+
attr_accessor :type, :points
|
5
|
+
|
6
|
+
def initialize(points = [], parent: nil)
|
7
|
+
@points = points
|
8
|
+
@parent = parent
|
9
|
+
end
|
10
|
+
|
11
|
+
# Parse DocxShapeLineElement
|
12
|
+
# @param [Nokogiri::XML:Node] node with DocxShapeLineElement
|
13
|
+
# @return [DocxShapeLineElement] result of parsing
|
14
|
+
def parse(node)
|
15
|
+
case node.name
|
16
|
+
when 'moveTo'
|
17
|
+
@type = :move
|
18
|
+
when 'lnTo'
|
19
|
+
@type = :line
|
20
|
+
when 'arcTo'
|
21
|
+
@type = :arc
|
22
|
+
when 'cubicBezTo'
|
23
|
+
@type = :cubic_bezier
|
24
|
+
when 'quadBezTo'
|
25
|
+
@type = :quadratic_bezier
|
26
|
+
when 'close'
|
27
|
+
@type = :close
|
28
|
+
end
|
29
|
+
|
30
|
+
node.xpath('*').each do |node_child|
|
31
|
+
case node_child.name
|
32
|
+
when 'pt'
|
33
|
+
@points << OOXMLCoordinates.parse(node_child)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
self
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -1,44 +1,32 @@
|
|
1
|
-
|
1
|
+
require_relative 'docx_shape_line_path/docx_shape_line_element'
|
2
2
|
module OoxmlParser
|
3
|
+
# Docx Shape Line Path
|
3
4
|
class DocxShapeLinePath < OOXMLDocumentObject
|
4
5
|
attr_accessor :width, :height, :fill, :stroke, :elements
|
5
6
|
|
6
|
-
def initialize(elements = [])
|
7
|
+
def initialize(elements = [], parent: nil)
|
7
8
|
@elements = elements
|
9
|
+
@parent = parent
|
8
10
|
end
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
# Parse DocxShapeLinePath object
|
13
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
14
|
+
# @return [DocxShapeLinePath] result of parsing
|
15
|
+
def parse(node)
|
16
|
+
node.attributes.each do |key, value|
|
13
17
|
case key
|
14
18
|
when 'w'
|
15
|
-
|
19
|
+
@width = value.value.to_f
|
16
20
|
when 'h'
|
17
|
-
|
21
|
+
@height = value.value.to_f
|
18
22
|
when 'stroke'
|
19
|
-
|
23
|
+
@stroke = value.value.to_f
|
20
24
|
end
|
21
25
|
end
|
22
|
-
|
23
|
-
|
24
|
-
case line_path_element_node.name
|
25
|
-
when 'moveTo'
|
26
|
-
line_element.type = :move
|
27
|
-
when 'lnTo'
|
28
|
-
line_element.type = :line
|
29
|
-
when 'arcTo'
|
30
|
-
line_element.type = :arc
|
31
|
-
when 'cubicBezTo'
|
32
|
-
line_element.type = :cubic_bezier
|
33
|
-
when 'quadBezTo'
|
34
|
-
line_element.type = :quadratic_bezier
|
35
|
-
when 'close'
|
36
|
-
line_element.type = :close
|
37
|
-
end
|
38
|
-
line_path_element_node.xpath('a:pt', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main').each { |point_node| line_element.points << OOXMLCoordinates.parse(point_node, delimiter: 1) }
|
39
|
-
shape_line_path.elements << line_element
|
26
|
+
node.xpath('*').each do |node_child|
|
27
|
+
@elements << DocxShapeLineElement.new(parent: self).parse(node_child)
|
40
28
|
end
|
41
|
-
|
29
|
+
self
|
42
30
|
end
|
43
31
|
end
|
44
32
|
end
|
@@ -1,23 +1,27 @@
|
|
1
|
-
require_relative 'docx_custom_geometry/docx_shape_line_element'
|
2
1
|
require_relative 'docx_custom_geometry/docx_shape_line_path'
|
3
2
|
# Docx Custom Geometry
|
4
3
|
module OoxmlParser
|
5
|
-
class OOXMLCustomGeometry
|
4
|
+
class OOXMLCustomGeometry < OOXMLDocumentObject
|
6
5
|
attr_accessor :paths_list
|
7
6
|
|
8
|
-
def initialize(paths_list = [])
|
7
|
+
def initialize(paths_list = [], parent: nil)
|
9
8
|
@paths_list = paths_list
|
9
|
+
@parent = parent
|
10
10
|
end
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
# Parse OOXMLCustomGeometry object
|
13
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
14
|
+
# @return [OOXMLCustomGeometry] result of parsing
|
15
|
+
def parse(node)
|
16
|
+
node.xpath('*').each do |node_child|
|
17
|
+
case node_child.name
|
16
18
|
when 'pathLst'
|
17
|
-
|
19
|
+
node_child.xpath('a:path', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main').each do |path_node|
|
20
|
+
@paths_list << DocxShapeLinePath.new(parent: self).parse(path_node)
|
21
|
+
end
|
18
22
|
end
|
19
23
|
end
|
20
|
-
|
24
|
+
self
|
21
25
|
end
|
22
26
|
end
|
23
27
|
end
|
@@ -1,43 +1,40 @@
|
|
1
|
-
require_relative 'color/gradient_color/docx_gradient_color'
|
2
1
|
require_relative 'color/docx_pattern_fill'
|
3
|
-
# Color inside DOCX
|
4
2
|
module OoxmlParser
|
3
|
+
# Color inside DOCX
|
5
4
|
class DocxColor < OOXMLDocumentObject
|
6
5
|
attr_accessor :type, :value, :stretching_type, :alpha
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
shape_properties_node.xpath('*').each do |fill_node|
|
15
|
-
case fill_node.name
|
7
|
+
# Parse DocxColor object
|
8
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
9
|
+
# @return [DocxColor] result of parsing
|
10
|
+
def parse(node)
|
11
|
+
node.xpath('*').each do |node_child|
|
12
|
+
case node_child.name
|
16
13
|
when 'blipFill'
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
@type = :picture
|
15
|
+
@value = DocxBlip.new(parent: self).parse(node_child)
|
16
|
+
node_child.xpath('*').each do |fill_type_node_child|
|
20
17
|
case fill_type_node_child.name
|
21
18
|
when 'tile'
|
22
|
-
|
19
|
+
@stretching_type = :tile
|
23
20
|
when 'stretch'
|
24
|
-
|
21
|
+
@stretching_type = :stretch
|
25
22
|
when 'blip'
|
26
|
-
fill_type_node_child.xpath('alphaModFix').each { |alpha_node|
|
23
|
+
fill_type_node_child.xpath('alphaModFix').each { |alpha_node| @alpha = alpha_node.attribute('amt').value.to_i / 1_000.0 }
|
27
24
|
end
|
28
25
|
end
|
29
26
|
when 'solidFill'
|
30
|
-
|
31
|
-
|
27
|
+
@type = :solid
|
28
|
+
@value = Color.parse_color_model(node_child)
|
32
29
|
when 'gradFill'
|
33
|
-
|
34
|
-
|
30
|
+
@type = :gradient
|
31
|
+
@value = GradientColor.new(parent: self).parse(node_child)
|
35
32
|
when 'pattFill'
|
36
|
-
|
37
|
-
|
33
|
+
@type = :pattern
|
34
|
+
@value = DocxPatternFill.new(parent: self).parse(node_child)
|
38
35
|
end
|
39
36
|
end
|
40
|
-
|
37
|
+
self
|
41
38
|
end
|
42
39
|
end
|
43
40
|
end
|
@@ -2,13 +2,16 @@ require_relative 'color/docx_color_scheme'
|
|
2
2
|
require_relative 'line/line_end'
|
3
3
|
# Docx Shape Line
|
4
4
|
module OoxmlParser
|
5
|
-
class DocxShapeLine
|
5
|
+
class DocxShapeLine < OOXMLDocumentObject
|
6
6
|
attr_accessor :width, :color_scheme, :cap, :head_end, :tail_end, :fill
|
7
|
+
# @return [ValuedChild] dash properties
|
8
|
+
attr_accessor :dash
|
7
9
|
|
8
10
|
alias color color_scheme
|
9
11
|
|
10
|
-
def initialize
|
11
|
-
@width = 0
|
12
|
+
def initialize(parent: nil)
|
13
|
+
@width = OoxmlSize.new(0)
|
14
|
+
@parent = parent
|
12
15
|
end
|
13
16
|
|
14
17
|
def stroke_size
|
@@ -20,35 +23,37 @@ module OoxmlParser
|
|
20
23
|
end
|
21
24
|
|
22
25
|
def nil?
|
23
|
-
stroke_size
|
26
|
+
stroke_size.zero? && cap.nil?
|
24
27
|
end
|
25
28
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
shape_line.cap = :flat
|
29
|
+
# Parse DocxShapeLine object
|
30
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
31
|
+
# @return [DocxShapeLine] result of parsing
|
32
|
+
def parse(node)
|
33
|
+
node.attributes.each do |key, value|
|
34
|
+
case key
|
35
|
+
when 'w'
|
36
|
+
@width = OoxmlSize.new(value.value.to_f, :emu)
|
37
|
+
when 'cap'
|
38
|
+
@cap = value_to_symbol(value)
|
37
39
|
end
|
38
40
|
end
|
39
|
-
|
40
|
-
|
41
|
+
|
42
|
+
node.xpath('*').each do |node_child|
|
43
|
+
case node_child.name
|
41
44
|
when 'solidFill'
|
42
|
-
|
45
|
+
@color_scheme = DocxColorScheme.new(parent: self).parse(node_child)
|
43
46
|
when 'noFill'
|
44
|
-
|
47
|
+
@width = OoxmlSize.new(0)
|
45
48
|
when 'headEnd'
|
46
|
-
|
49
|
+
@head_end = LineEnd.new(parent: self).parse(node_child)
|
47
50
|
when 'tailEnd'
|
48
|
-
|
51
|
+
@tail_end = LineEnd.new(parent: self).parse(node_child)
|
52
|
+
when 'prstDash'
|
53
|
+
@dash = ValuedChild.new(:symbol, parent: self).parse(node_child)
|
49
54
|
end
|
50
55
|
end
|
51
|
-
|
56
|
+
self
|
52
57
|
end
|
53
58
|
end
|
54
59
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `a:alphaModFix` tag
|
3
|
+
class AlphaModFix < OOXMLDocumentObject
|
4
|
+
attr_accessor :amount
|
5
|
+
|
6
|
+
# Parse AlphaModFix object
|
7
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
8
|
+
# @return [AlphaModFix] result of parsing
|
9
|
+
def parse(node)
|
10
|
+
node.attributes.each do |key, value|
|
11
|
+
case key
|
12
|
+
when 'amt'
|
13
|
+
@amount = OoxmlSize.new(value.value.to_f, :one_1000th_percent)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'blip/alpha_mod_fix'
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `a:blip` tag
|
5
|
+
class Blip < OOXMLDocumentObject
|
6
|
+
attr_accessor :alpha_mod_fix
|
7
|
+
|
8
|
+
# Parse Blip object
|
9
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
10
|
+
# @return [Blip] result of parsing
|
11
|
+
def parse(node)
|
12
|
+
node.xpath('*').each do |node_child|
|
13
|
+
case node_child.name
|
14
|
+
when 'alphaModFix'
|
15
|
+
@alpha_mod_fix = AlphaModFix.new(parent: self).parse(node_child)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
self
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative 'blip_fill/blip'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for parsing `a:blipFill` tag
|
4
|
+
class BlipFill < OOXMLDocumentObject
|
5
|
+
attr_accessor :blip
|
6
|
+
# @return [Stretch]
|
7
|
+
attr_accessor :stretch
|
8
|
+
|
9
|
+
# Parse BlipFill object
|
10
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
11
|
+
# @return [BlipFill] result of parsing
|
12
|
+
def parse(node)
|
13
|
+
node.xpath('*').each do |node_child|
|
14
|
+
case node_child.name
|
15
|
+
when 'blip'
|
16
|
+
@blip = Blip.new(parent: self).parse(node_child)
|
17
|
+
when 'stretch'
|
18
|
+
@stretch = Stretch.new(parent: self).parse(node_child)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
self
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for describing Shape Guide
|
3
|
+
class ShapeGuide < OOXMLDocumentObject
|
4
|
+
# @return [String] name of guide
|
5
|
+
attr_accessor :name
|
6
|
+
# @return [String] shape guide formula
|
7
|
+
attr_accessor :formula
|
8
|
+
|
9
|
+
# Parse ShapeGuide
|
10
|
+
# @param [Nokogiri::XML:Node] node with Shape Guide
|
11
|
+
# @return [ShapeGuide] result of parsing
|
12
|
+
def parse(node)
|
13
|
+
node.attributes.each do |key, value|
|
14
|
+
case key
|
15
|
+
when 'name'
|
16
|
+
@name = value.value.to_sym
|
17
|
+
when 'fmla'
|
18
|
+
@formula = value.value
|
19
|
+
end
|
20
|
+
end
|
21
|
+
self
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'shape_adjust_value_list/shape_guide'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for describing List of Shape Adjust Values
|
4
|
+
class ShapeAdjustValueList < OOXMLDocumentObject
|
5
|
+
# @return [Array] list of shape guides
|
6
|
+
attr_accessor :shape_guides_list
|
7
|
+
|
8
|
+
def initialize(parent: nil)
|
9
|
+
@shape_guides_list = []
|
10
|
+
@parent = parent
|
11
|
+
end
|
12
|
+
|
13
|
+
# @return [Array, Column] accessor for relationship
|
14
|
+
def [](key)
|
15
|
+
@shape_guides_list[key]
|
16
|
+
end
|
17
|
+
|
18
|
+
# Parse ShapeAdjustValueList
|
19
|
+
# @param [Nokogiri::XML:Node] node with List of Shape Adjust Values
|
20
|
+
# @return [ShapeAdjustValueList] result of parsing
|
21
|
+
def parse(node)
|
22
|
+
node.xpath('*').each do |node_child|
|
23
|
+
case node_child.name
|
24
|
+
when 'gd'
|
25
|
+
@shape_guides_list << ShapeGuide.new(parent: self).parse(node_child)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
self
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative 'preset_geometry/shape_adjust_value_list'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for describing Preset Geometry
|
4
|
+
class PresetGeometry < OOXMLDocumentObject
|
5
|
+
# @return [String] name of preset geometry
|
6
|
+
attr_accessor :name
|
7
|
+
# @return [ShapeAdjustValueList] list of adjust values
|
8
|
+
attr_accessor :adjust_values_list
|
9
|
+
|
10
|
+
# Parse PresetGeometry
|
11
|
+
# @param [Nokogiri::XML:Node] node with PresetGeometry
|
12
|
+
# @return [PresetGeometry] result of parsing
|
13
|
+
def parse(node)
|
14
|
+
@name = node.attribute('prst').value.to_sym if node.attribute('prst')
|
15
|
+
node.xpath('*').each do |node_child|
|
16
|
+
case node_child.name
|
17
|
+
when 'avLst'
|
18
|
+
@adjust_values_list = ShapeAdjustValueList.new(parent: self).parse(node_child)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
self
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -4,7 +4,7 @@ module OoxmlParser
|
|
4
4
|
# Parse TextBox List
|
5
5
|
# @param [Nokogiri::XML:Node] node with TextBox
|
6
6
|
# @return [Array] array of elements
|
7
|
-
def self.parse_list(node)
|
7
|
+
def self.parse_list(node, parent: nil)
|
8
8
|
elements = []
|
9
9
|
text_box_content_node = node.xpath('w:txbxContent').first
|
10
10
|
unless text_box_content_node.nil?
|
@@ -13,9 +13,9 @@ module OoxmlParser
|
|
13
13
|
when 'p'
|
14
14
|
DocumentStructure.default_paragraph_style = DocxParagraph.new
|
15
15
|
DocumentStructure.default_paragraph_style.spacing = Spacing.new(0, 0.35, 1.15, :multiple)
|
16
|
-
elements <<
|
16
|
+
elements << DocumentStructure.default_paragraph_style.copy.parse(textbox_element, i, parent: parent)
|
17
17
|
when 'tbl'
|
18
|
-
elements << Table.parse(textbox_element, i)
|
18
|
+
elements << Table.new(parent: parent).parse(textbox_element, i)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -1,40 +1,49 @@
|
|
1
1
|
require_relative 'docx_color'
|
2
2
|
require_relative 'docx_shape_size'
|
3
3
|
require_relative 'docx_shape_line'
|
4
|
+
require_relative 'docx_shape_properties/blip_fill'
|
5
|
+
require_relative 'docx_shape_properties/preset_geometry'
|
4
6
|
require_relative 'docx_shape_properties/text_box'
|
5
7
|
require_relative 'custom_geometry/ooxml_custom_geometry'
|
6
8
|
# DOCX Shape Properties
|
7
9
|
module OoxmlParser
|
8
10
|
class DocxShapeProperties < OOXMLDocumentObject
|
9
11
|
attr_accessor :shape_size, :preset_geometry, :fill_color, :text_box, :line, :custom_geometry
|
12
|
+
attr_accessor :blip_fill
|
10
13
|
|
11
14
|
alias transform shape_size
|
12
15
|
alias fill fill_color
|
13
16
|
alias preset preset_geometry
|
14
17
|
|
15
|
-
def initialize
|
18
|
+
def initialize(parent: nil)
|
16
19
|
@line = DocxShapeLine.new
|
20
|
+
@parent = parent
|
17
21
|
end
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
23
|
+
# Parse DocxShapeProperties object
|
24
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
25
|
+
# @return [DocxShapeProperties] result of parsing
|
26
|
+
def parse(node)
|
27
|
+
@fill_color = DocxColor.new(parent: self).parse(node)
|
28
|
+
node.xpath('*').each do |node_child|
|
29
|
+
case node_child.name
|
24
30
|
when 'xfrm'
|
25
|
-
|
31
|
+
@shape_size = DocxShapeSize.new(parent: self).parse(node_child)
|
26
32
|
when 'prstGeom'
|
27
|
-
|
33
|
+
@preset_geometry = PresetGeometry.new(parent: self).parse(node_child)
|
28
34
|
when 'txbx'
|
29
|
-
|
35
|
+
@text_box = TextBox.parse_list(node_child)
|
30
36
|
when 'ln'
|
31
|
-
|
37
|
+
@line = DocxShapeLine.new(parent: self).parse(node_child)
|
38
|
+
when 'blipFill'
|
39
|
+
@blip_fill = BlipFill.new(parent: self).parse(node_child)
|
32
40
|
when 'custGeom'
|
33
|
-
|
34
|
-
|
41
|
+
@preset_geometry = PresetGeometry.new(parent: self).parse(node_child)
|
42
|
+
@preset_geometry.name = :custom
|
43
|
+
@custom_geometry = OOXMLCustomGeometry.new(parent: self).parse(node_child)
|
35
44
|
end
|
36
45
|
end
|
37
|
-
|
46
|
+
self
|
38
47
|
end
|
39
48
|
end
|
40
49
|
end
|
@@ -1,31 +1,39 @@
|
|
1
1
|
# Docx Shape Size
|
2
2
|
module OoxmlParser
|
3
|
-
class DocxShapeSize
|
3
|
+
class DocxShapeSize < OOXMLDocumentObject
|
4
4
|
attr_accessor :rotation, :flip_horizontal, :flip_vertical, :offset, :extent
|
5
|
+
attr_accessor :child_offset
|
6
|
+
attr_accessor :child_extent
|
5
7
|
|
6
8
|
alias extents extent
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
|
10
|
+
# Parse DocxShapeSize object
|
11
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
12
|
+
# @return [DocxShapeSize] result of parsing
|
13
|
+
def parse(node)
|
14
|
+
node.attributes.each do |key, value|
|
11
15
|
case key
|
12
16
|
when 'rot'
|
13
|
-
|
17
|
+
@rotation = value.value.to_f
|
14
18
|
when 'flipH'
|
15
|
-
|
19
|
+
@flip_horizontal = value.value.to_f
|
16
20
|
when 'flipV'
|
17
|
-
|
21
|
+
@flip_vertical = value.value.to_f
|
18
22
|
end
|
19
23
|
end
|
20
|
-
|
21
|
-
case
|
24
|
+
node.xpath('*').each do |node_child|
|
25
|
+
case node_child.name
|
22
26
|
when 'off'
|
23
|
-
|
27
|
+
@offset = OOXMLCoordinates.parse(node_child, unit: :emu)
|
24
28
|
when 'ext'
|
25
|
-
|
29
|
+
@extent = OOXMLCoordinates.parse(node_child, x_attr: 'cx', y_attr: 'cy', unit: :emu)
|
30
|
+
when 'chOff'
|
31
|
+
@child_offset = OOXMLCoordinates.parse(node_child, unit: :emu)
|
32
|
+
when 'chExt'
|
33
|
+
@child_extent = OOXMLCoordinates.parse(node_child, x_attr: 'cx', y_attr: 'cy', unit: :emu)
|
26
34
|
end
|
27
35
|
end
|
28
|
-
|
36
|
+
self
|
29
37
|
end
|
30
38
|
end
|
31
39
|
end
|