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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17ff610450bb961ad457f38aa206097940893f58
|
4
|
+
data.tar.gz: bcfe11a7a961f9a103eb8c047fb503e324d05bb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03f3590091b03d708883a052300a754e9e94b64c55fbc85564514d3194d8bf3e9e1927069eaa30ee2aea0a095e77a089c0a899029eceb5f60394064869e6c59c
|
7
|
+
data.tar.gz: 4c7eb4fa0cf09ced780de674a48acd4939b29b01bb09b0e240627cc1654a1f90a945c738dba76d0e59db3c88ee859028f3dda38b4990c8165bc9adf9b200ef67
|
data/README.md
CHANGED
@@ -11,16 +11,17 @@ _ooxml_parser_ is a Ooxml files (docx, xlsx, pptx) parser written in Ruby.
|
|
11
11
|
Parse a docx file
|
12
12
|
|
13
13
|
require 'ooxml_parser'
|
14
|
-
docx = OoxmlParser::
|
14
|
+
docx = OoxmlParser::Parser.parse('spec/document/document_properties/page_count.docx')
|
15
15
|
p docx.document_properties.pages # 2
|
16
16
|
|
17
17
|
|
18
18
|
## Configuration
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
### Accuracy
|
21
|
+
|
22
|
+
Accuracy of digits in fraction part
|
23
|
+
Default is 2 digits in fraction part
|
23
24
|
|
24
25
|
OoxmlParser.configure do |config|
|
25
|
-
config.
|
26
|
+
config.accuracy = 3
|
26
27
|
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Chart Style
|
3
|
+
class ChartStyle < OOXMLDocumentObject
|
4
|
+
attr_accessor :style_number
|
5
|
+
|
6
|
+
# Parse ChartStyle
|
7
|
+
# @param [Nokogiri::XML:Node] node with Relationships
|
8
|
+
# @return [ChartStyle] result of parsing
|
9
|
+
def parse(node)
|
10
|
+
node.xpath('*').each do |node_child|
|
11
|
+
case node_child.name
|
12
|
+
when 'style'
|
13
|
+
@style_number = node_child.attribute('val').value.to_i
|
14
|
+
end
|
15
|
+
end
|
16
|
+
self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for storing math paragraph
|
3
|
+
class MathParagraph < OOXMLDocumentObject
|
4
|
+
attr_accessor :math
|
5
|
+
# Parse MathParagraph object
|
6
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
7
|
+
# @return [MathParagraph] result of parsing
|
8
|
+
def parse(node)
|
9
|
+
node.xpath('*').each do |node_child|
|
10
|
+
case node_child.name
|
11
|
+
when 'oMath'
|
12
|
+
@math = DocxFormula.new(parent: self).parse(node_child)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
self
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative 'math_text/math_paragraph'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for storing math text
|
4
|
+
class MathText < OOXMLDocumentObject
|
5
|
+
attr_accessor :math_paragraph
|
6
|
+
# Parse MathText object
|
7
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
8
|
+
# @return [MathText] result of parsing
|
9
|
+
def parse(node)
|
10
|
+
node.xpath('*').each do |node_child|
|
11
|
+
case node_child.name
|
12
|
+
when 'oMathPara'
|
13
|
+
@math_paragraph = MathParagraph.new(parent: self).parse(node_child)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'choice/math_text'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for storing choice (for office 2014 and newer)
|
4
|
+
# graphic data
|
5
|
+
class Choice < OOXMLDocumentObject
|
6
|
+
attr_accessor :math_text
|
7
|
+
# Parse Choice object
|
8
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
9
|
+
# @return [Choice] result of parsing
|
10
|
+
def parse(node)
|
11
|
+
node.xpath('*').each do |node_child|
|
12
|
+
case node_child.name
|
13
|
+
when 'm'
|
14
|
+
@math_text = MathText.new(parent: self).parse(node_child)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
self
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,34 +1,40 @@
|
|
1
|
+
require_relative 'alternate_content/choice'
|
2
|
+
require_relative 'alternate_content/chart_style'
|
1
3
|
require_relative 'chart/chart'
|
2
4
|
require_relative 'drawing/docx_drawing'
|
3
|
-
require_relative 'shape/shape'
|
4
5
|
require_relative 'picture/old_docx_picture'
|
5
|
-
# Class for storing fallback graphic elements
|
6
6
|
module OoxmlParser
|
7
|
-
|
7
|
+
# Class for storing fallback graphic elements
|
8
|
+
class AlternateContent < OOXMLDocumentObject
|
8
9
|
attr_accessor :office2010_content, :office2007_content
|
10
|
+
# @return [Choice] choice data
|
11
|
+
attr_accessor :choice
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
+
# Parse AlternateContent
|
14
|
+
# @param [Nokogiri::XML:Node] node with Relationships
|
15
|
+
# @return [AlternateContent] result of parsing
|
16
|
+
def parse(node)
|
17
|
+
node.xpath('*').each do |node_child|
|
13
18
|
begin
|
14
|
-
|
19
|
+
node_child.xpath('w:drawing')
|
15
20
|
rescue Nokogiri::XML::XPath::SyntaxError # This mean it is Chart
|
16
|
-
case
|
21
|
+
case node_child.name
|
17
22
|
when 'Choice'
|
18
|
-
|
23
|
+
@office2010_content = ChartStyle.new(parent: self).parse(node_child)
|
19
24
|
when 'Fallback'
|
20
|
-
|
25
|
+
@office2007_content = ChartStyle.new(parent: self).parse(node_child)
|
21
26
|
end
|
22
27
|
next
|
23
28
|
end
|
24
|
-
case
|
29
|
+
case node_child.name
|
25
30
|
when 'Choice'
|
26
|
-
|
31
|
+
@office2010_content = DocxDrawing.new(parent: self).parse(node_child.xpath('w:drawing').first) unless node_child.xpath('w:drawing').first.nil?
|
32
|
+
@choice = Choice.new(parent: self).parse(node_child)
|
27
33
|
when 'Fallback'
|
28
|
-
|
34
|
+
@office2007_content = OldDocxPicture.new(parent: self).parse(node_child.xpath('w:pict').first) unless node_child.xpath('w:pict').first.nil?
|
29
35
|
end
|
30
36
|
end
|
31
|
-
|
37
|
+
self
|
32
38
|
end
|
33
39
|
end
|
34
40
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `c:order` object
|
3
|
+
class Order < OOXMLDocumentObject
|
4
|
+
# @return [Integer] value of order
|
5
|
+
attr_accessor :value
|
6
|
+
|
7
|
+
# Parse Order
|
8
|
+
# @param [Nokogiri::XML:Node] node with Order
|
9
|
+
# @return [Order] result of parsing
|
10
|
+
def parse(node)
|
11
|
+
node.attributes.each do |key, value|
|
12
|
+
case key
|
13
|
+
when 'val'
|
14
|
+
@value = value.value.to_f
|
15
|
+
end
|
16
|
+
end
|
17
|
+
self
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_index.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `c:idx` object
|
3
|
+
class SeriesIndex < OOXMLDocumentObject
|
4
|
+
# @return [Integer] value of index
|
5
|
+
attr_accessor :value
|
6
|
+
|
7
|
+
# Parse SeriesIndex
|
8
|
+
# @param [Nokogiri::XML:Node] node with Index
|
9
|
+
# @return [SeriesIndex] result of parsing
|
10
|
+
def parse(node)
|
11
|
+
node.attributes.each do |key, value|
|
12
|
+
case key
|
13
|
+
when 'val'
|
14
|
+
@value = value.value.to_f
|
15
|
+
end
|
16
|
+
end
|
17
|
+
self
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `c:v` object
|
3
|
+
class TextValue < OOXMLDocumentObject
|
4
|
+
# @return [String] text of value
|
5
|
+
attr_accessor :value
|
6
|
+
|
7
|
+
# Parse TextValue
|
8
|
+
# @param [Nokogiri::XML:Node] node with TextValue
|
9
|
+
# @return [TextValue] result of parsing
|
10
|
+
def parse(node)
|
11
|
+
@value = node.text
|
12
|
+
self
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'point/text_value'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for parsing `c:pt` object
|
4
|
+
class Point < OOXMLDocumentObject
|
5
|
+
# @return [Integer] index of point
|
6
|
+
attr_accessor :index
|
7
|
+
# @return [TextValue] value of text
|
8
|
+
attr_accessor :text
|
9
|
+
|
10
|
+
# Parse PointCount
|
11
|
+
# @param [Nokogiri::XML:Node] node with PointCount
|
12
|
+
# @return [PointCount] result of parsing
|
13
|
+
def parse(node)
|
14
|
+
node.attributes.each do |key, value|
|
15
|
+
case key
|
16
|
+
when 'idx'
|
17
|
+
@index = value.value.to_f
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
node.xpath('*').each do |node_child|
|
22
|
+
case node_child.name
|
23
|
+
when 'v'
|
24
|
+
@text = TextValue.new(parent: self).parse(node_child)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
self
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `c:ptCount` object
|
3
|
+
class PointCount < OOXMLDocumentObject
|
4
|
+
# @return [Integer] value of point count
|
5
|
+
attr_accessor :value
|
6
|
+
|
7
|
+
# Parse PointCount
|
8
|
+
# @param [Nokogiri::XML:Node] node with PointCount
|
9
|
+
# @return [PointCount] result of parsing
|
10
|
+
def parse(node)
|
11
|
+
node.attributes.each do |key, value|
|
12
|
+
case key
|
13
|
+
when 'val'
|
14
|
+
@value = value.value.to_f
|
15
|
+
end
|
16
|
+
end
|
17
|
+
self
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'string_cache/point_count'
|
2
|
+
require_relative 'string_cache/point'
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `c:tx` object
|
5
|
+
class StringCache < OOXMLDocumentObject
|
6
|
+
# @return [StringReference] String reference of series
|
7
|
+
attr_accessor :point_count
|
8
|
+
# @return [Array, Point] array of points
|
9
|
+
attr_accessor :points
|
10
|
+
|
11
|
+
def initialize(parent: nil)
|
12
|
+
@points = []
|
13
|
+
@parent = parent
|
14
|
+
end
|
15
|
+
|
16
|
+
# Parse Order
|
17
|
+
# @param [Nokogiri::XML:Node] node with Order
|
18
|
+
# @return [Order] result of parsing
|
19
|
+
def parse(node)
|
20
|
+
node.xpath('*').each do |node_child|
|
21
|
+
case node_child.name
|
22
|
+
when 'ptCount'
|
23
|
+
@point_count = PointCount.new(parent: self).parse(node_child)
|
24
|
+
when 'pt'
|
25
|
+
@points << Point.new(parent: self).parse(node_child)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
self
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require_relative 'string_reference/string_cache'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for parsing `c:strRef` object
|
4
|
+
class StringReference < OOXMLDocumentObject
|
5
|
+
# @return [String] formula
|
6
|
+
attr_accessor :formula
|
7
|
+
# @return [StringCache] cache of string
|
8
|
+
attr_accessor :cache
|
9
|
+
|
10
|
+
# Parse Order
|
11
|
+
# @param [Nokogiri::XML:Node] node with Order
|
12
|
+
# @return [Order] result of parsing
|
13
|
+
def parse(node)
|
14
|
+
node.xpath('*').each do |reference_child|
|
15
|
+
case reference_child.name
|
16
|
+
when 'f'
|
17
|
+
@formula = reference_child.text
|
18
|
+
when 'strCache'
|
19
|
+
@cache = StringCache.new(parent: self).parse(reference_child)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
self
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require_relative 'series_text/string_reference'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for parsing `c:tx` object
|
4
|
+
class SeriesText < OOXMLDocumentObject
|
5
|
+
# @return [StringReference] String reference of series
|
6
|
+
attr_accessor :string
|
7
|
+
|
8
|
+
# Parse Order
|
9
|
+
# @param [Nokogiri::XML:Node] node with Order
|
10
|
+
# @return [Order] result of parsing
|
11
|
+
def parse(node)
|
12
|
+
node.xpath('*').each do |series_child|
|
13
|
+
case series_child.name
|
14
|
+
when 'strRef'
|
15
|
+
@string = StringReference.new(parent: self).parse(series_child)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
self
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
Categories = SeriesText
|
23
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require_relative 'series/order'
|
2
|
+
require_relative 'series/series_index'
|
3
|
+
require_relative 'series/series_text'
|
4
|
+
module OoxmlParser
|
5
|
+
# Class for parsing `c:ser` object
|
6
|
+
class Series < OOXMLDocumentObject
|
7
|
+
# @return [Index] index of chart
|
8
|
+
attr_accessor :index
|
9
|
+
# @return [Order] order of chart
|
10
|
+
attr_accessor :order
|
11
|
+
# @return [SeriesText] text of series
|
12
|
+
attr_accessor :text
|
13
|
+
# @return [Categories] categories of chart
|
14
|
+
attr_accessor :categories
|
15
|
+
# @return [DisplayLabelsProperties]
|
16
|
+
attr_accessor :display_labels
|
17
|
+
|
18
|
+
# Parse Series
|
19
|
+
# @param [Nokogiri::XML:Node] node with Series
|
20
|
+
# @return [Series] result of parsing
|
21
|
+
def parse(node)
|
22
|
+
node.xpath('*').each do |node_child|
|
23
|
+
case node_child.name
|
24
|
+
when 'idx'
|
25
|
+
@index = SeriesIndex.new(parent: self).parse(node_child)
|
26
|
+
when 'order'
|
27
|
+
@order = Order.new(parent: self).parse(node_child)
|
28
|
+
when 'tx'
|
29
|
+
@text = SeriesText.new(parent: self).parse(node_child)
|
30
|
+
when 'cat'
|
31
|
+
@categories = Categories.new(parent: self).parse(node_child)
|
32
|
+
when 'dLbls'
|
33
|
+
@display_labels = DisplayLabelsProperties.new(parent: self).parse(node_child)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
self
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Parsing Chart 3D view tag 'view3D'
|
3
|
+
class View3D < OOXMLDocumentObject
|
4
|
+
# @return [ValuedChild] This element specifies the amount
|
5
|
+
# a 3-D chart shall be rotated in the X direction
|
6
|
+
attr_accessor :rotation_x
|
7
|
+
# @return [ValuedChild] This element specifies the amount
|
8
|
+
# a 3-D chart shall be rotated in the Y direction
|
9
|
+
attr_accessor :rotation_y
|
10
|
+
# @return [True, False] This element specifies that the
|
11
|
+
# chart axes are at right angles, rather than drawn
|
12
|
+
# in perspective. Applies only to 3-D charts.
|
13
|
+
attr_accessor :right_angle_axis
|
14
|
+
|
15
|
+
# Parse View3D object
|
16
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
17
|
+
# @return [View3D] result of parsing
|
18
|
+
def parse(node)
|
19
|
+
node.xpath('*').each do |node_child|
|
20
|
+
case node_child.name
|
21
|
+
when 'rotX'
|
22
|
+
@rotation_x = ValuedChild.new(:integer, parent: self).parse(node_child)
|
23
|
+
when 'rotY'
|
24
|
+
@rotation_y = ValuedChild.new(:integer, parent: self).parse(node_child)
|
25
|
+
when 'rAngAx'
|
26
|
+
@right_angle_axis = option_enabled?(node_child)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
self
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -3,12 +3,16 @@ require_relative 'chart_cells_range'
|
|
3
3
|
require_relative 'chart_legend'
|
4
4
|
require_relative 'chart_point'
|
5
5
|
require_relative 'display_labels_properties'
|
6
|
-
require_relative '
|
7
|
-
require_relative '
|
6
|
+
require_relative 'chart/series'
|
7
|
+
require_relative 'chart/view_3d'
|
8
8
|
|
9
9
|
module OoxmlParser
|
10
10
|
class Chart < OOXMLDocumentObject
|
11
11
|
attr_accessor :type, :data, :grouping, :title, :legend, :display_labels, :axises, :alternate_content, :shape_properties
|
12
|
+
# @return [Array, Series] series of chart
|
13
|
+
attr_accessor :series
|
14
|
+
# @return [View3D] properties of 3D view
|
15
|
+
attr_accessor :view_3d
|
12
16
|
|
13
17
|
def initialize
|
14
18
|
@type = ''
|
@@ -17,6 +21,7 @@ module OoxmlParser
|
|
17
21
|
@title = nil
|
18
22
|
@legend = nil
|
19
23
|
@axises = []
|
24
|
+
@series = []
|
20
25
|
end
|
21
26
|
|
22
27
|
def parse_properties(chart_prop_node)
|
@@ -25,18 +30,17 @@ module OoxmlParser
|
|
25
30
|
when 'grouping'
|
26
31
|
@grouping = chart_props_node_child.attribute('val').value.to_sym
|
27
32
|
when 'ser'
|
33
|
+
@series << Series.new(parent: self).parse(chart_props_node_child)
|
28
34
|
case @type
|
29
|
-
when :bar, :line, :area, :pie, :doughnut, :radar, :stock, :surface_3d, :column
|
30
|
-
val = chart_props_node_child.xpath('c:val')[0]
|
31
35
|
when :point, :bubble
|
32
36
|
val = chart_props_node_child.xpath('c:yVal')[0]
|
33
37
|
else
|
34
|
-
|
38
|
+
val = chart_props_node_child.xpath('c:val')[0]
|
35
39
|
end
|
36
40
|
next if val.xpath('c:numRef').empty?
|
37
|
-
@data << ChartCellsRange.parse(val.xpath('c:numRef').first).dup
|
41
|
+
@data << ChartCellsRange.new(parent: self).parse(val.xpath('c:numRef').first).dup
|
38
42
|
when 'dLbls'
|
39
|
-
@display_labels = DisplayLabelsProperties.parse(chart_props_node_child)
|
43
|
+
@display_labels = DisplayLabelsProperties.new(parent: self).parse(chart_props_node_child)
|
40
44
|
end
|
41
45
|
end
|
42
46
|
end
|
@@ -44,76 +48,79 @@ module OoxmlParser
|
|
44
48
|
def self.parse
|
45
49
|
chart = Chart.new
|
46
50
|
chart_xml = Nokogiri::XML(File.open(OOXMLDocumentObject.current_xml))
|
47
|
-
chart_xml.xpath('
|
48
|
-
case
|
49
|
-
when '
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
when '
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
51
|
+
chart_xml.xpath('*').each do |chart_node|
|
52
|
+
case chart_node.name
|
53
|
+
when 'chartSpace'
|
54
|
+
chart_node.xpath('*').each do |chart_space_node_child|
|
55
|
+
case chart_space_node_child.name
|
56
|
+
when 'AlternateContent'
|
57
|
+
chart.alternate_content = AlternateContent.new(parent: chart).parse(chart_space_node_child)
|
58
|
+
when 'spPr'
|
59
|
+
chart.shape_properties = DocxShapeProperties.new(parent: chart).parse(chart_space_node_child)
|
60
|
+
when 'chart'
|
61
|
+
chart_space_node_child.xpath('*').each do |chart_node_child|
|
62
|
+
case chart_node_child.name
|
63
|
+
when 'plotArea'
|
64
|
+
chart_node_child.xpath('*').each do |plot_area_node_child|
|
65
|
+
next unless chart.type.empty?
|
66
|
+
case plot_area_node_child.name
|
67
|
+
when 'barChart'
|
68
|
+
chart.type = :bar
|
69
|
+
bar_dir_node = plot_area_node_child.xpath('c:barDir')
|
70
|
+
chart.type = :column if bar_dir_node.first.attribute('val').value == 'col'
|
71
|
+
chart.parse_properties(plot_area_node_child)
|
72
|
+
when 'lineChart'
|
73
|
+
chart.type = :line
|
74
|
+
chart.parse_properties(plot_area_node_child)
|
75
|
+
when 'areaChart'
|
76
|
+
chart.type = :area
|
77
|
+
chart.parse_properties(plot_area_node_child)
|
78
|
+
when 'bubbleChart'
|
79
|
+
chart.type = :bubble
|
80
|
+
chart.parse_properties(plot_area_node_child)
|
81
|
+
when 'doughnutChart'
|
82
|
+
chart.type = :doughnut
|
83
|
+
chart.parse_properties(plot_area_node_child)
|
84
|
+
when 'pieChart'
|
85
|
+
chart.type = :pie
|
86
|
+
chart.parse_properties(plot_area_node_child)
|
87
|
+
when 'scatterChart'
|
88
|
+
chart.type = :point
|
89
|
+
chart.parse_properties(plot_area_node_child)
|
90
|
+
when 'radarChart'
|
91
|
+
chart.type = :radar
|
92
|
+
chart.parse_properties(plot_area_node_child)
|
93
|
+
when 'stockChart'
|
94
|
+
chart.type = :stock
|
95
|
+
chart.parse_properties(plot_area_node_child)
|
96
|
+
when 'surface3DChart'
|
97
|
+
chart.type = :surface_3d
|
98
|
+
chart.parse_properties(plot_area_node_child)
|
99
|
+
when 'line3DChart'
|
100
|
+
chart.type = :line_3d
|
101
|
+
chart.parse_properties(plot_area_node_child)
|
102
|
+
when 'bar3DChart'
|
103
|
+
chart.type = :bar_3d
|
104
|
+
chart.parse_properties(plot_area_node_child)
|
105
|
+
when 'pie3DChart'
|
106
|
+
chart.type = :pie_3d
|
107
|
+
chart.parse_properties(plot_area_node_child)
|
108
|
+
end
|
65
109
|
end
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
chart.
|
76
|
-
when '
|
77
|
-
chart.
|
78
|
-
chart.parse_properties(plot_area_node_child)
|
79
|
-
when 'pieChart'
|
80
|
-
chart.type = :pie
|
81
|
-
chart.parse_properties(plot_area_node_child)
|
82
|
-
when 'scatterChart'
|
83
|
-
chart.type = :point
|
84
|
-
chart.parse_properties(plot_area_node_child)
|
85
|
-
when 'radarChart'
|
86
|
-
chart.type = :radar
|
87
|
-
chart.parse_properties(plot_area_node_child)
|
88
|
-
when 'stockChart'
|
89
|
-
chart.type = :stock
|
90
|
-
chart.parse_properties(plot_area_node_child)
|
91
|
-
when 'surface3DChart'
|
92
|
-
chart.type = :surface_3d
|
93
|
-
chart.parse_properties(plot_area_node_child)
|
94
|
-
when 'line3DChart'
|
95
|
-
chart.type = :line_3d
|
96
|
-
chart.parse_properties(plot_area_node_child)
|
97
|
-
when 'bar3DChart'
|
98
|
-
chart.type = :bar_3d
|
99
|
-
chart.parse_properties(plot_area_node_child)
|
100
|
-
when 'pie3DChart'
|
101
|
-
chart.type = :pie_3d
|
102
|
-
chart.parse_properties(plot_area_node_child)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
chart_node_child.xpath('*').each do |plot_area_node_child|
|
106
|
-
case plot_area_node_child.name
|
107
|
-
when 'catAx'
|
108
|
-
chart.axises << ChartAxis.parse(plot_area_node_child)
|
109
|
-
when 'valAx'
|
110
|
-
chart.axises << ChartAxis.parse(plot_area_node_child)
|
110
|
+
chart_node_child.xpath('*').each do |plot_area_node_child|
|
111
|
+
case plot_area_node_child.name
|
112
|
+
when 'catAx', 'valAx'
|
113
|
+
chart.axises << ChartAxis.new(parent: chart).parse(plot_area_node_child)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
when 'title'
|
117
|
+
chart.title = ChartAxisTitle.new(parent: chart).parse(chart_node_child)
|
118
|
+
when 'legend'
|
119
|
+
chart.legend = ChartLegend.new(parent: chart).parse(chart_node_child)
|
120
|
+
when 'view3D'
|
121
|
+
chart.view_3d = View3D.new(parent: chart).parse(chart_node_child)
|
111
122
|
end
|
112
123
|
end
|
113
|
-
when 'title'
|
114
|
-
chart.title = ChartAxisTitle.parse(chart_node_child)
|
115
|
-
when 'legend'
|
116
|
-
chart.legend = ChartLegend.parse(chart_node_child)
|
117
124
|
end
|
118
125
|
end
|
119
126
|
end
|