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
@@ -0,0 +1,20 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `m:limLoc` object
|
3
|
+
class NaryLimitLocation < OOXMLDocumentObject
|
4
|
+
# @return [String] value of limit location
|
5
|
+
attr_accessor :value
|
6
|
+
|
7
|
+
# Parse NaryLimitLocation
|
8
|
+
# @param [Nokogiri::XML:Node] node with NaryLimitLocation
|
9
|
+
# @return [NaryLimitLocation] result of parsing
|
10
|
+
def parse(node)
|
11
|
+
node.attributes.each do |key, value|
|
12
|
+
case key
|
13
|
+
when 'val'
|
14
|
+
@value = value_to_symbol(value)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
self
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative 'nary_properties/nary_grow'
|
2
|
+
require_relative 'nary_properties/nary_limit_location'
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `m:naryPr` object
|
5
|
+
class NaryProperties < OOXMLDocumentObject
|
6
|
+
# @return [NaryGrow] grow value
|
7
|
+
attr_accessor :grow
|
8
|
+
# @return [NaryLimitLocation] nary limit location
|
9
|
+
attr_accessor :limit_location
|
10
|
+
|
11
|
+
# Parse NaryProperties
|
12
|
+
# @param [Nokogiri::XML:Node] node with NaryProperties
|
13
|
+
# @return [NaryProperties] result of parsing
|
14
|
+
def parse(node)
|
15
|
+
node.xpath('*').each do |nary_pr_child|
|
16
|
+
case nary_pr_child.name
|
17
|
+
when 'grow'
|
18
|
+
@grow = NaryGrow.new(parent: self).parse(nary_pr_child)
|
19
|
+
when 'limLoc'
|
20
|
+
@limit_location = NaryLimitLocation.new(parent: self).parse(nary_pr_child)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
self
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'nary/nary_properties'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for parsing `m:nary` object
|
4
|
+
class Nary < OOXMLDocumentObject
|
5
|
+
# @return [DocxFormula] top value
|
6
|
+
attr_accessor :top_value
|
7
|
+
|
8
|
+
# @return [DocxFormula] bottom_value
|
9
|
+
attr_accessor :bottom_value
|
10
|
+
|
11
|
+
# @return [NaryProperties] properties of nary
|
12
|
+
attr_accessor :properties
|
13
|
+
|
14
|
+
# Parse Nary
|
15
|
+
# @param [Nokogiri::XML:Node] node with Nary
|
16
|
+
# @return [Nary] result of parsing
|
17
|
+
def parse(node)
|
18
|
+
node.xpath('*').each do |nary_child_node|
|
19
|
+
case nary_child_node.name
|
20
|
+
when 'sub'
|
21
|
+
@bottom_value = DocxFormula.new(parent: self).parse(nary_child_node)
|
22
|
+
when 'sup'
|
23
|
+
@top_value = DocxFormula.new(parent: self).parse(nary_child_node)
|
24
|
+
when 'naryPr'
|
25
|
+
@properties = NaryProperties.new(parent: self).parse(nary_child_node)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
self
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `m:sPre` object
|
3
|
+
class PreSubSuperscript < OOXMLDocumentObject
|
4
|
+
# @return [DocxFormula] top value
|
5
|
+
attr_accessor :top_value
|
6
|
+
|
7
|
+
# @return [DocxFormula] bottom_value
|
8
|
+
attr_accessor :bottom_value
|
9
|
+
|
10
|
+
# @return [DocxFormula] base
|
11
|
+
attr_accessor :base
|
12
|
+
|
13
|
+
def parse(node)
|
14
|
+
node.xpath('*').each do |node_child|
|
15
|
+
case node_child.name
|
16
|
+
when 'sub'
|
17
|
+
@bottom_value = DocxFormula.new(parent: self).parse(node_child)
|
18
|
+
when 'sup'
|
19
|
+
@top_value = DocxFormula.new(parent: self).parse(node_child)
|
20
|
+
when 'e'
|
21
|
+
@base = DocxFormula.new(parent: self).parse(node_child)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
self
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,11 +1,25 @@
|
|
1
|
-
# Radical Data
|
2
1
|
module OoxmlParser
|
3
|
-
|
2
|
+
# Class for `rad` data
|
3
|
+
class Radical < OOXMLDocumentObject
|
4
4
|
attr_accessor :degree, :value
|
5
5
|
|
6
|
-
def initialize(
|
7
|
-
@degree =
|
8
|
-
@
|
6
|
+
def initialize(parent: nil)
|
7
|
+
@degree = 2
|
8
|
+
@parent = parent
|
9
|
+
end
|
10
|
+
|
11
|
+
# Parse Function object
|
12
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
13
|
+
# @return [Function] result of parsing
|
14
|
+
def parse(node)
|
15
|
+
node.xpath('*').each do |node_child|
|
16
|
+
case node_child.name
|
17
|
+
when 'deg'
|
18
|
+
@degree = DocxFormula.new(parent: self).parse(node_child)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
@value = DocxFormula.new(parent: self).parse(node)
|
22
|
+
self
|
9
23
|
end
|
10
24
|
end
|
11
25
|
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# Class for containg DocxFormulas
|
2
1
|
require_relative 'docx_formula/accent'
|
2
|
+
require_relative 'docx_formula/argument_properties'
|
3
3
|
require_relative 'docx_formula/bar'
|
4
4
|
require_relative 'docx_formula/box'
|
5
5
|
require_relative 'docx_formula/delimeter'
|
@@ -7,197 +7,66 @@ require_relative 'docx_formula/fraction'
|
|
7
7
|
require_relative 'docx_formula/function'
|
8
8
|
require_relative 'docx_formula/group_char'
|
9
9
|
require_relative 'docx_formula/limit'
|
10
|
+
require_relative 'docx_formula/math_run'
|
10
11
|
require_relative 'docx_formula/matrix'
|
11
|
-
require_relative 'docx_formula/
|
12
|
+
require_relative 'docx_formula/nary'
|
12
13
|
require_relative 'docx_formula/index'
|
14
|
+
require_relative 'docx_formula/pre_sub_superscript'
|
13
15
|
require_relative 'docx_formula/radical'
|
14
16
|
module OoxmlParser
|
15
|
-
|
16
|
-
|
17
|
+
# Class for formula data
|
18
|
+
class DocxFormula < OOXMLDocumentObject
|
19
|
+
attr_accessor :formula_run
|
20
|
+
# @return [ArgumentProperties] properties of arguments
|
21
|
+
attr_accessor :argument_properties
|
17
22
|
|
18
|
-
def initialize(
|
19
|
-
@
|
23
|
+
def initialize(parent: nil)
|
24
|
+
@formula_run = []
|
25
|
+
@parent = parent
|
20
26
|
end
|
21
27
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
d_pr.xpath('m:begChr').each do |beg_chr|
|
61
|
-
delimeter.begin_character = beg_chr.attribute('val').value
|
62
|
-
end
|
63
|
-
d_pr.xpath('m:endChr').each do |end_chr|
|
64
|
-
delimeter.end_character = end_chr.attribute('val').value
|
65
|
-
end
|
66
|
-
end
|
67
|
-
delimeter.value = DocxFormula.parse(sub_element)
|
68
|
-
formula.elements << delimeter
|
69
|
-
elsif sub_element.name == 'nary'
|
70
|
-
operator = Operator.new
|
71
|
-
sub_element.xpath('m:naryPr').each do |nary_pr|
|
72
|
-
nary_pr.xpath('m:chr').each do |chr|
|
73
|
-
operator.operator = chr.attribute('val').value
|
74
|
-
end
|
75
|
-
end
|
76
|
-
sub_element.xpath('m:sub').each do |sub|
|
77
|
-
operator.bottom_value = DocxFormula.parse(sub)
|
78
|
-
end
|
79
|
-
sub_element.xpath('m:sup').each do |sup|
|
80
|
-
operator.top_value = DocxFormula.parse(sup)
|
81
|
-
end
|
82
|
-
operator.value = DocxFormula.parse(sub_element)
|
83
|
-
formula.elements << operator
|
84
|
-
elsif sub_element.name == 'sSubSup'
|
85
|
-
index = Index.new
|
86
|
-
index.value = DocxFormula.parse(sub_element)
|
87
|
-
sub_element.xpath('m:sup').each do |sup|
|
88
|
-
index.top_index = DocxFormula.parse(sup)
|
89
|
-
end
|
90
|
-
sub_element.xpath('m:sub').each do |sub|
|
91
|
-
index.top_index = DocxFormula.parse(sub)
|
92
|
-
end
|
93
|
-
formula.elements << index
|
94
|
-
elsif sub_element.name == 'sSup'
|
95
|
-
index = Index.new
|
96
|
-
index.value = DocxFormula.parse(sub_element)
|
97
|
-
sub_element.xpath('m:sup').each do |sup|
|
98
|
-
index.top_index = DocxFormula.parse(sup)
|
99
|
-
end
|
100
|
-
formula.elements << index
|
101
|
-
elsif sub_element.name == 'sSub'
|
102
|
-
index = Index.new
|
103
|
-
index.value = DocxFormula.parse(sub_element)
|
104
|
-
sub_element.xpath('m:sub').each do |sub|
|
105
|
-
index.top_index = DocxFormula.parse(sub)
|
106
|
-
end
|
107
|
-
formula.elements << index
|
108
|
-
elsif sub_element.name == 'f'
|
109
|
-
fraction = Fraction.new
|
110
|
-
sub_element.xpath('m:num').each do |num|
|
111
|
-
fraction.numerator = DocxFormula.parse(num)
|
112
|
-
end
|
113
|
-
sub_element.xpath('m:den').each do |den|
|
114
|
-
fraction.denominator = DocxFormula.parse(den)
|
115
|
-
formula.elements << fraction
|
116
|
-
end
|
117
|
-
elsif sub_element.name == 'm'
|
118
|
-
matrix = Matrix.new
|
119
|
-
columns_count = 1
|
120
|
-
j = 0
|
121
|
-
sub_element.xpath('m:mPr').each do |m_pr|
|
122
|
-
m_pr.xpath('m:mcs').each do |mcs|
|
123
|
-
mcs.xpath('m:mc').each do |mc|
|
124
|
-
mc.xpath('m:mcPr').each do |mc_pr|
|
125
|
-
mc_pr.xpath('m:count').each do |count|
|
126
|
-
columns_count = count.attribute('val').value
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
sub_element.xpath('m:mr').each do |mr|
|
133
|
-
i = 0
|
134
|
-
matrix.rows << MatrixRow.new(columns_count.to_i)
|
135
|
-
mr.xpath('m:e').each do |e|
|
136
|
-
matrix.rows[j].columns[i] = DocxFormula.parse(e)
|
137
|
-
i += 1
|
138
|
-
end
|
139
|
-
j += 1
|
140
|
-
end
|
141
|
-
formula.elements << matrix
|
142
|
-
elsif sub_element.name == 'bar'
|
143
|
-
bar = Bar.new
|
144
|
-
sub_element.xpath('m:barPr').each do |bar_pr|
|
145
|
-
bar_pr.xpath('m:pos').each do |pos|
|
146
|
-
bar.position = pos.attribute('val').value
|
147
|
-
end
|
148
|
-
end
|
149
|
-
bar.element = DocxFormula.parse(sub_element)
|
150
|
-
formula.elements << bar
|
151
|
-
elsif sub_element.name == 'acc'
|
152
|
-
accent = Accent.new
|
153
|
-
sub_element.xpath('m:accPr').each do |acc_pr|
|
154
|
-
acc_pr.xpath('m:chr').each do |chr|
|
155
|
-
accent.symbol = chr.attribute('val').value
|
156
|
-
end
|
157
|
-
end
|
158
|
-
accent.element = DocxFormula.parse(sub_element)
|
159
|
-
formula.elements << accent
|
160
|
-
elsif sub_element.name == 'groupChr'
|
161
|
-
group_char = GroupChar.new
|
162
|
-
sub_element.xpath('m:groupChrPr').each do |group_chr_pr|
|
163
|
-
group_chr_pr.xpath('m:chr').each do |chr|
|
164
|
-
group_char.symbol = chr.attribute('val').value
|
165
|
-
end
|
166
|
-
group_chr_pr.xpath('m:pos').each do |pos|
|
167
|
-
group_char.position = pos.attribute('val').value
|
168
|
-
end
|
169
|
-
group_chr_pr.xpath('vertJc').each do |vert_jc|
|
170
|
-
group_char.vertical_align = vert_jc.attribute('val').value
|
171
|
-
end
|
172
|
-
end
|
173
|
-
group_char.element = DocxFormula.parse(sub_element)
|
174
|
-
formula.elements << group_char
|
175
|
-
elsif sub_element.name == 'limUpp'
|
176
|
-
limit = Limit.new
|
177
|
-
limit.type = 'Upper'
|
178
|
-
limit.element = DocxFormula.parse(sub_element)
|
179
|
-
sub_element.xpath('m:lim').each do |lim|
|
180
|
-
limit.limit = DocxFormula.parse(lim)
|
181
|
-
end
|
182
|
-
formula.elements << limit
|
183
|
-
elsif sub_element.name == 'limLow'
|
184
|
-
limit = Limit.new
|
185
|
-
limit.type = 'Lower'
|
186
|
-
limit.element = DocxFormula.parse(sub_element)
|
187
|
-
sub_element.xpath('m:lim').each do |lim|
|
188
|
-
limit.limit = DocxFormula.parse(lim)
|
189
|
-
end
|
190
|
-
formula.elements << limit
|
28
|
+
# Parse DocxFormula object
|
29
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
30
|
+
# @return [DocxFormula] result of parsing
|
31
|
+
def parse(node)
|
32
|
+
node.xpath('*').each do |node_child|
|
33
|
+
case node_child.name
|
34
|
+
when 'r'
|
35
|
+
@formula_run << MathRun.new(parent: self).parse(node_child)
|
36
|
+
when 'box', 'borderBox'
|
37
|
+
@formula_run << Box.new(parent: self).parse(node_child)
|
38
|
+
when 'func'
|
39
|
+
@formula_run << Function.new(parent: self).parse(node_child)
|
40
|
+
when 'rad'
|
41
|
+
@formula_run << Radical.new(parent: self).parse(node_child)
|
42
|
+
when 'e', 'eqArr'
|
43
|
+
@formula_run << DocxFormula.new(parent: self).parse(node_child)
|
44
|
+
when 'nary'
|
45
|
+
@formula_run << Nary.new(parent: self).parse(node_child)
|
46
|
+
when 'd'
|
47
|
+
@formula_run << Delimiter.new(parent: self).parse(node_child)
|
48
|
+
when 'sSubSup', 'sSup', 'sSub'
|
49
|
+
@formula_run << Index.new(parent: self).parse(node_child)
|
50
|
+
when 'f'
|
51
|
+
@formula_run << Fraction.new(parent: self).parse(node_child)
|
52
|
+
when 'm'
|
53
|
+
@formula_run << Matrix.new(parent: self).parse(node_child)
|
54
|
+
when 'bar'
|
55
|
+
@formula_run << Bar.new(parent: self).parse(node_child)
|
56
|
+
when 'acc'
|
57
|
+
@formula_run << Accent.new(parent: self).parse(node_child)
|
58
|
+
when 'groupChr'
|
59
|
+
@formula_run << GroupChar.new(parent: self).parse(node_child)
|
60
|
+
when 'argPr'
|
61
|
+
@argument_properties = ArgumentProperties.new(parent: self).parse(node_child)
|
62
|
+
when 'sPre'
|
63
|
+
@formula_run << PreSubSuperscript.new(parent: self).parse(node_child)
|
64
|
+
when 'limUpp', 'limLow'
|
65
|
+
@formula_run << Limit.new(parent: self).parse(node_child)
|
191
66
|
end
|
192
67
|
end
|
193
|
-
return nil if
|
194
|
-
|
195
|
-
end
|
196
|
-
|
197
|
-
def self.parse_math_character(element)
|
198
|
-
element.xpath('m:t').each do |t|
|
199
|
-
return t.text
|
200
|
-
end
|
68
|
+
return nil if @formula_run.empty?
|
69
|
+
self
|
201
70
|
end
|
202
71
|
end
|
203
72
|
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
module DocxParagraphRunHelpers
|
3
|
+
def parse_properties(node, _default_character = DocumentStructure.default_run_style)
|
4
|
+
self.font_style = FontStyle.new
|
5
|
+
node.xpath('*').each do |node_child|
|
6
|
+
case node_child.name
|
7
|
+
when 'rFonts'
|
8
|
+
node_child.attributes.each do |font_attribute, value|
|
9
|
+
case font_attribute
|
10
|
+
when 'asciiTheme'
|
11
|
+
self.font = DocxParagraphRun.parse_font_by_theme(node_child.attribute('asciiTheme').value)
|
12
|
+
when 'ascii'
|
13
|
+
self.font = value.value
|
14
|
+
break
|
15
|
+
end
|
16
|
+
end
|
17
|
+
when 'sz'
|
18
|
+
self.size = node_child.attribute('val').value.to_i / 2.0
|
19
|
+
when 'highlight'
|
20
|
+
self.highlight = node_child.attribute('val').value
|
21
|
+
when 'vertAlign'
|
22
|
+
self.vertical_align = node_child.attribute('val').value.to_sym
|
23
|
+
when 'effect'
|
24
|
+
self.effect = node_child.attribute('val').value
|
25
|
+
when 'position'
|
26
|
+
self.position = (node_child.attribute('val').value.to_f / (28.0 + 1.0 / 3.0) / 2.0).round(1)
|
27
|
+
when 'em'
|
28
|
+
self.em = node_child.attribute('val').value
|
29
|
+
when 'spacing'
|
30
|
+
self.spacing = (node_child.attribute('val').value.to_f / 566.9).round(1)
|
31
|
+
when 'textFill'
|
32
|
+
self.text_fill = TextFill.new(parent: self).parse(node_child)
|
33
|
+
when 'textOutline'
|
34
|
+
self.text_outline = TextOutline.new(parent: self).parse(node_child)
|
35
|
+
when 'bCs', 'b'
|
36
|
+
font_style.bold = option_enabled?(node_child)
|
37
|
+
when 'iCs', 'i'
|
38
|
+
font_style.italic = option_enabled?(node_child)
|
39
|
+
when 'caps'
|
40
|
+
self.caps = :caps
|
41
|
+
when 'smallCaps'
|
42
|
+
self.caps = :small_caps if option_enabled?(node_child)
|
43
|
+
when 'color'
|
44
|
+
node_child.attributes.each do |key, value|
|
45
|
+
case key
|
46
|
+
when 'val'
|
47
|
+
self.font_color = Color.new(parent: self).parse_hex_string(value.value)
|
48
|
+
when 'themeColor'
|
49
|
+
unless ThemeColors.list[value.value.to_sym].nil?
|
50
|
+
break if value.value == 'text2' || value.value == 'background2' || value.value.include?('accent') # Don't know why. Just works
|
51
|
+
self.font_color = ThemeColors.list[value.value.to_sym].dup
|
52
|
+
end
|
53
|
+
when 'themeShade'
|
54
|
+
font_color.calculate_with_shade!(value.value.hex.to_f / 255.0)
|
55
|
+
when 'themeTint'
|
56
|
+
font_color.calculate_with_tint!(1.0 - (value.value.hex.to_f / 255.0))
|
57
|
+
end
|
58
|
+
end
|
59
|
+
when 'shd'
|
60
|
+
self.background_color = node_child.attribute('fill').value
|
61
|
+
unless node_child.attribute('fill').value == 'auto' || node_child.attribute('fill').value == '' || node_child.attribute('fill').value == 'null'
|
62
|
+
self.background_color = Color.new(parent: self).parse_hex_string(node_child.attribute('fill').value)
|
63
|
+
end
|
64
|
+
when 'uCs'
|
65
|
+
font_style.underlined = Underline.new
|
66
|
+
if option_enabled?(node_child)
|
67
|
+
font_style.underlined.style = node_child.attribute('val').value
|
68
|
+
unless node_child.attribute('color').nil?
|
69
|
+
font_style.underlined.color = Color.new(parent: font_style.underlined).parse_hex_string(node_child.attribute('color').value)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
when 'u'
|
73
|
+
font_style.underlined = Underline.new
|
74
|
+
if option_enabled?(node_child)
|
75
|
+
font_style.underlined.style = node_child.attribute('val').value
|
76
|
+
unless node_child.attribute('color').nil?
|
77
|
+
font_style.underlined.color = Color.new(parent: font_style.underlined).parse_hex_string(node_child.attribute('color').value)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
when 'strike'
|
81
|
+
font_style.strike = :single if option_enabled?(node_child)
|
82
|
+
when 'dstrike'
|
83
|
+
font_style.strike = :double if option_enabled?(node_child)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
self
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `o:OLEObject` tags
|
3
|
+
class OleObject < OOXMLDocumentObject
|
4
|
+
# @return [String] id of ole_object
|
5
|
+
attr_accessor :id
|
6
|
+
# @return [FileReference] data referenced in object
|
7
|
+
attr_accessor :file_reference
|
8
|
+
|
9
|
+
# Parse OleObject object
|
10
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
11
|
+
# @return [OleObject] result of parsing
|
12
|
+
def parse(node)
|
13
|
+
node.attributes.each do |key, value|
|
14
|
+
case key
|
15
|
+
when 'id'
|
16
|
+
@id = value.value
|
17
|
+
end
|
18
|
+
end
|
19
|
+
@file_reference = FileReference.new(parent: self).parse(node)
|
20
|
+
self
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'object/ole_object'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for parsing `w:object`
|
4
|
+
class RunObject < OOXMLDocumentObject
|
5
|
+
# @return [OleObject] ole object of object
|
6
|
+
attr_accessor :ole_object
|
7
|
+
|
8
|
+
# Parse RunObject object
|
9
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
10
|
+
# @return [RunObject] result of parsing
|
11
|
+
def parse(node)
|
12
|
+
node.xpath('*').each do |node_child|
|
13
|
+
case node_child.name
|
14
|
+
when 'OLEObject'
|
15
|
+
@ole_object = OleObject.new(parent: self).parse(node_child)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
self
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,39 +1,46 @@
|
|
1
1
|
require_relative 'shape/shape_properties'
|
2
2
|
module OoxmlParser
|
3
|
+
# Class for parsing `shape`, `rect`, `oval` tags
|
3
4
|
class Shape < OOXMLDocumentObject
|
4
5
|
attr_accessor :type, :properties, :elements
|
5
6
|
|
6
|
-
def initialize(type = nil,
|
7
|
+
def initialize(type = nil,
|
8
|
+
properties = ShapeProperties.new,
|
9
|
+
elements = [],
|
10
|
+
parent: nil)
|
7
11
|
@type = type
|
8
12
|
@properties = properties
|
9
13
|
@elements = elements
|
14
|
+
@parent = parent
|
10
15
|
end
|
11
16
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
17
|
+
# Parse Shape object
|
18
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
19
|
+
# @return [Shape] result of parsing
|
20
|
+
def parse(node, type)
|
21
|
+
@type = type
|
22
|
+
node.attribute('style').value.to_s.split(';').each do |property|
|
16
23
|
if property.include?('margin-top')
|
17
|
-
|
24
|
+
@properties.margins.top = property.split(':').last
|
18
25
|
elsif property.include?('margin-left')
|
19
|
-
|
26
|
+
@properties.margins.left = property.split(':').last
|
20
27
|
elsif property.include?('margin-right')
|
21
|
-
|
28
|
+
@properties.margins.right = property.split(':').last
|
22
29
|
elsif property.include?('width')
|
23
|
-
|
30
|
+
@properties.size.width = property.split(':').last
|
24
31
|
elsif property.include?('height')
|
25
|
-
|
32
|
+
@properties.size.height = property.split(':').last
|
26
33
|
elsif property.include?('z-index')
|
27
|
-
|
34
|
+
@properties.z_index = property.split(':').last
|
28
35
|
elsif property.include?('position')
|
29
|
-
|
36
|
+
@properties.position = property.split(':').last
|
30
37
|
end
|
31
38
|
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
39
|
+
@properties.fill_color = Color.new(parent: self).parse_hex_string(node.attribute('fillcolor').value.to_s.sub('#', '').split(' ').first) unless node.attribute('fillcolor').nil?
|
40
|
+
@properties.stroke.weight = node.attribute('strokeweight').value unless node.attribute('strokeweight').nil?
|
41
|
+
@properties.stroke.color = Color.new(parent: self).parse_hex_string(node.attribute('strokecolor').value.to_s.sub('#', '').split(' ').first) unless node.attribute('strokecolor').nil?
|
42
|
+
@elements = TextBox.parse_list(node.xpath('v:textbox').first, parent: self) unless node.xpath('v:textbox').first.nil?
|
43
|
+
self
|
37
44
|
end
|
38
45
|
end
|
39
46
|
end
|
@@ -1,13 +1,14 @@
|
|
1
|
-
# Class for parsing text outline and its properties
|
2
1
|
module OoxmlParser
|
2
|
+
# Data about `textFill` object
|
3
3
|
class TextFill < OOXMLDocumentObject
|
4
4
|
attr_accessor :color_scheme
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
# Parse TextFill object
|
7
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
8
|
+
# @return [TextFill] result of parsing
|
9
|
+
def parse(node)
|
10
|
+
@color_scheme = DocxColorScheme.new(parent: self).parse(node)
|
11
|
+
self
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
@@ -1,22 +1,27 @@
|
|
1
1
|
# Class for parsing text outline and its properties
|
2
2
|
module OoxmlParser
|
3
|
+
# Class for parsing `w:textOutline`
|
3
4
|
class TextOutline < OOXMLDocumentObject
|
4
5
|
attr_accessor :width, :color_scheme
|
5
6
|
|
6
|
-
def initialize
|
7
|
-
@width = 0
|
7
|
+
def initialize(parent: nil)
|
8
|
+
@width = OoxmlSize.new(0)
|
8
9
|
@color_scheme = :none
|
10
|
+
@parent = parent
|
9
11
|
end
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
# Parse TextOutline object
|
14
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
15
|
+
# @return [TextOutline] result of parsing
|
16
|
+
def parse(node)
|
17
|
+
node.attributes.each do |key, value|
|
18
|
+
case key
|
19
|
+
when 'w'
|
20
|
+
@width = OoxmlSize.new(value.value.to_f, :emu)
|
21
|
+
end
|
16
22
|
end
|
17
|
-
|
18
|
-
|
19
|
-
text_outline
|
23
|
+
@color_scheme = DocxColorScheme.new(parent: self).parse(node)
|
24
|
+
self
|
20
25
|
end
|
21
26
|
end
|
22
27
|
end
|