ooxml_parser 0.14.1-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats/pivot_format.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/plot_area/common_chart_data.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/plot_area.rb +67 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/number_string_reference.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/number_string_cache.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point/text_value.rb +17 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point.rb +38 -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/x_y_values.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb +52 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/view_3d.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +174 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis/scaling.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +48 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_point.rb +13 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +43 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing/doc_properties.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +46 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +63 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +44 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +46 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +116 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative/picture_dimension.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_vertical.rb +32 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +37 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +43 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb +40 -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 +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties.rb +25 -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/shape_style/effect_reference.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/fill_reference.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/font_reference.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/line_reference.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +28 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +49 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties/preset_text_warp.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +49 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +43 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +24 -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/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 +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +63 -0
- 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 +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill.rb +26 -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 +26 -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 +33 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +59 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +52 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_element.rb +12 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_properties.rb +8 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +28 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +32 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +73 -0
- data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +59 -0
- data/lib/ooxml_parser/common_parser/common_data/color/color_indexes.list +66 -0
- data/lib/ooxml_parser/common_parser/common_data/color/ooxml_color.rb +66 -0
- data/lib/ooxml_parser/common_parser/common_data/color.rb +308 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/color_alpha_channel.rb +17 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +67 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +41 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/scheme_color.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/content_types/content_type_default.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/content_types/content_type_override.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/content_types.rb +45 -0
- data/lib/ooxml_parser/common_parser/common_data/coordinates.rb +155 -0
- data/lib/ooxml_parser/common_parser/common_data/font_style.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +89 -0
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_document_object_helper.rb +117 -0
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_object_attribute_helper.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +144 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +109 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/position.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_spacing.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_style.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +60 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/size.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +148 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/text.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +63 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +41 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +57 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_stlye_ref.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing/line_spacing.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +100 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs/tab.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +46 -0
- data/lib/ooxml_parser/common_parser/common_data/relationships/relationship.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/relationships.rb +68 -0
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +54 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +48 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +50 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +61 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_column_band_size.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +45 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +57 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_row_band_size.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +52 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +89 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/grid_span.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +96 -0
- 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 +43 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties/table_row_height.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +40 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid/grid_column.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +104 -0
- data/lib/ooxml_parser/common_parser/common_data/table.rb +52 -0
- data/lib/ooxml_parser/common_parser/common_data/underline.rb +50 -0
- data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_document_structure.rb +25 -0
- data/lib/ooxml_parser/common_parser/parser.rb +49 -0
- data/lib/ooxml_parser/configuration.rb +13 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments/comment.rb +37 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments.rb +36 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended/comment_extended.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended.rb +42 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +35 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +33 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb +19 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style/document_style_helper.rb +39 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +98 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark_end.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark_start.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/comment_range_end.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/comment_range_start.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/accent.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties/argument_size.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +35 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +24 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +28 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +13 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +45 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_grow.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_limit_location.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties.rb +28 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb +33 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +75 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_helper.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +111 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object/ole_object.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_margins.rb +14 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_size.rb +13 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/stroke.rb +13 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties.rb +19 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +77 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +16 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +29 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +147 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/field_simple.rb +41 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb +51 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +51 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/inserted.rb +57 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_content.rb +46 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_properties.rb +30 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/structured_document_tag.rb +28 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +30 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +273 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +63 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/multilevel_type.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_justification.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_text.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/numbering_format.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +33 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +66 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +44 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +56 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +56 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/footnote_properties.rb +34 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +52 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +45 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +83 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +62 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/paragraph_properties_default.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/run_properties_default.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults.rb +28 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +290 -0
- data/lib/ooxml_parser/docx_parser/docx_parser.rb +19 -0
- data/lib/ooxml_parser/helpers/string_helper.rb +24 -0
- data/lib/ooxml_parser/name.rb +9 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/comment_authors/comment_author.rb +38 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/comment_authors.rb +39 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comments/presentation_comment.rb +39 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comments.rb +33 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_helpers.rb +16 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/font_scheme/font_collection/text_font.rb +22 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/font_scheme/font_collection.rb +31 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/font_scheme.rb +36 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +47 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +54 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties/stretch.rb +13 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties.rb +23 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +35 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data/shape_tree.rb +35 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data.rb +28 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/connection_shape.rb +7 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +50 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +27 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_notes.rb +23 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +38 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +30 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +33 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +28 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +23 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/codition_list/condition.rb +23 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition_list.rb +27 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing.rb +44 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +59 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +29 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +68 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +25 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action.rb +22 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +36 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties/wheel.rb +22 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb +30 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +85 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb +25 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/table_styles.rb +38 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +62 -0
- data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +17 -0
- data/lib/ooxml_parser/version.rb +9 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb +42 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_source/worksheet_source.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_source.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache.rb +41 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items/column_row_item.rb +22 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb +34 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items/item.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_table_style_info.rb +42 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition.rb +114 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table/string_index.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table.rb +46 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/cell_style/alignment.rb +35 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/xf.rb +150 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +35 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +49 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +40 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +44 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +40 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +44 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb +34 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +50 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_helpers.rb +14 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/author.rb +16 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/comment_list.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +31 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +44 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/ole_objects.rb +20 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/page_setup.rb +105 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb +23 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +27 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +41 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column/custom_filters/custom_filter.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb +42 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column.rb +40 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter.rb +36 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/data_validations/data_validation/data_validation_formula.rb +22 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/data_validations/data_validation.rb +88 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/data_validations.rb +47 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb +115 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/x14_table.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +32 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_columns/table_column.rb +34 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_columns.rb +42 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part.rb +50 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/worksheet_helper.rb +14 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb +54 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb +27 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +40 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_header_footer/header_footer_child.rb +56 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_header_footer.rb +64 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/formula.rb +39 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +84 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +152 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +165 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_parser.rb +17 -0
- data/lib/ooxml_parser.rb +40 -0
- metadata +572 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'content_types/content_type_default'
|
4
|
+
require_relative 'content_types/content_type_override'
|
5
|
+
module OoxmlParser
|
6
|
+
# Class for data from `[Content_Types].xml` file
|
7
|
+
class ContentTypes < OOXMLDocumentObject
|
8
|
+
# @return [Array] list of content types
|
9
|
+
attr_accessor :content_types_list
|
10
|
+
|
11
|
+
def initialize(parent: nil)
|
12
|
+
@content_types_list = []
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Array] accessor
|
17
|
+
def [](key)
|
18
|
+
@content_types_list[key]
|
19
|
+
end
|
20
|
+
|
21
|
+
# Parse ContentTypes object
|
22
|
+
# @return [ContentTypes] result of parsing
|
23
|
+
def parse
|
24
|
+
doc = Nokogiri::XML.parse(File.open("#{OOXMLDocumentObject.path_to_folder}/[Content_Types].xml"))
|
25
|
+
node = doc.xpath('*').first
|
26
|
+
|
27
|
+
node.xpath('*').each do |node_child|
|
28
|
+
case node_child.name
|
29
|
+
when 'Default'
|
30
|
+
@content_types_list << ContentTypeDefault.new(parent: self).parse(node_child)
|
31
|
+
when 'Override'
|
32
|
+
@content_types_list << ContentTypeOverride.new(parent: self).parse(node_child)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
self
|
36
|
+
end
|
37
|
+
|
38
|
+
# Get content definition by type
|
39
|
+
# @param [String] type of definition
|
40
|
+
# @return [Object] resulting objects
|
41
|
+
def by_type(type)
|
42
|
+
@content_types_list.select { |item| item.content_type == type }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,155 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for working with coordinates
|
5
|
+
class Coordinates
|
6
|
+
attr_accessor :row, :column, :list
|
7
|
+
|
8
|
+
def initialize(row = nil, column = nil, list = nil)
|
9
|
+
@row = row.nil? ? row : row.to_i
|
10
|
+
@column = column
|
11
|
+
@list = list
|
12
|
+
end
|
13
|
+
|
14
|
+
class << self
|
15
|
+
# @param [String] string to parse
|
16
|
+
# @return [Coordinates]
|
17
|
+
def parse_coordinates_from_string(string)
|
18
|
+
coordinates = Coordinates.new
|
19
|
+
begin
|
20
|
+
coordinates.list = string.match(/'\w+'/)[0].delete("''")
|
21
|
+
rescue StandardError
|
22
|
+
'Raise Exception'
|
23
|
+
end
|
24
|
+
string = string.split('!').last
|
25
|
+
if coordinates?(string)
|
26
|
+
coordinates.row = string.scan(/[0-9]/).join.to_i
|
27
|
+
coordinates.column = string.scan(/[A-Z]/).join
|
28
|
+
end
|
29
|
+
coordinates
|
30
|
+
end
|
31
|
+
|
32
|
+
# Parse range of coordinates
|
33
|
+
# @param arguments_string [String] data to parse
|
34
|
+
# @return [Array] result
|
35
|
+
def parser_coordinates_range(arguments_string)
|
36
|
+
return parse_coordinates_array(arguments_string) if arguments_string.include?(',')
|
37
|
+
return warn "Formulas with # is unsupported: #{arguments_string}" if arguments_string.include?('#')
|
38
|
+
return warn 'Formulas consists from `!` only' if arguments_string == '!'
|
39
|
+
|
40
|
+
sheet_name = 'Sheet1'
|
41
|
+
|
42
|
+
if arguments_string.include?('!')
|
43
|
+
sheet_name = arguments_string.match(/.*!/).to_s
|
44
|
+
arguments_string = arguments_string.sub(sheet_name, '')
|
45
|
+
end
|
46
|
+
|
47
|
+
range = arguments_string.split(':')
|
48
|
+
|
49
|
+
difference = []
|
50
|
+
symbols_from = range.first.scan(/[a-zA-z]/).join
|
51
|
+
symbols_to = range.last.scan(/[a-zA-z]/).join
|
52
|
+
digits_from = range.first.scan(/[0-9]/).join
|
53
|
+
digits_to = range.last.scan(/[0-9]/).join
|
54
|
+
|
55
|
+
difference[0] = [symbols_from, symbols_to] unless symbols_from == symbols_to
|
56
|
+
difference[1] = [digits_from, digits_to] unless digits_from == digits_to
|
57
|
+
arguments_array = []
|
58
|
+
case difference.length
|
59
|
+
when 0
|
60
|
+
arguments_array << Coordinates.new(digits_from, symbols_from)
|
61
|
+
when 1
|
62
|
+
(difference.first.first..difference.first.last).each do |symbol|
|
63
|
+
arguments_array << Coordinates.new(digits_from, symbol, sheet_name)
|
64
|
+
end
|
65
|
+
when 2
|
66
|
+
case difference.first
|
67
|
+
when nil
|
68
|
+
(difference.last.first..difference.last.last).each do |digit|
|
69
|
+
arguments_array << Coordinates.new(digit, symbols_from, sheet_name)
|
70
|
+
end
|
71
|
+
else
|
72
|
+
(difference.first.first..difference.first.last).each do |symbol|
|
73
|
+
(difference.last.first..difference.last.last).each do |digit|
|
74
|
+
arguments_array << Coordinates.new(digit, symbol, sheet_name)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
arguments_array
|
80
|
+
end
|
81
|
+
|
82
|
+
# Parse array of coordinates
|
83
|
+
# @param arguments_string [String] string
|
84
|
+
# @return [Array] result
|
85
|
+
def parse_coordinates_array(arguments_string)
|
86
|
+
result = []
|
87
|
+
coord_array = arguments_string.split(',')
|
88
|
+
coord_array.each do |current_coord|
|
89
|
+
result << parser_coordinates_range(current_coord)
|
90
|
+
end
|
91
|
+
result
|
92
|
+
end
|
93
|
+
|
94
|
+
# This method check is argument contains coordinate
|
95
|
+
# @param [String] string
|
96
|
+
def coordinates?(string)
|
97
|
+
!/^([A-Z]+)(\d+)$/.match(string).nil?
|
98
|
+
end
|
99
|
+
|
100
|
+
# @param [String or Fixnum] number to convert
|
101
|
+
# @return [String] column's name
|
102
|
+
# This method takes string like '12' or '45' etc.
|
103
|
+
# and converts into spreadsheet column's name
|
104
|
+
# StringHelper.get_column_name('12') #=> "L"
|
105
|
+
# StringHelper.get_column_name('45') #=> "AS"
|
106
|
+
# StringHelper.get_column_name('287') #=> "KA"
|
107
|
+
def get_column_name(number)
|
108
|
+
(number.to_i.positive? ? ('A'..'Z').to_a[(number.to_i - 1) % 26] + get_column_name((number.to_i - 1) / 26).reverse : '').reverse
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# @return [Integer] number of column
|
113
|
+
# This method takes @column string
|
114
|
+
# and converts into integer
|
115
|
+
def column_number
|
116
|
+
@column.reverse.each_char.reduce(0) do |result, char|
|
117
|
+
result + (char.downcase.ord - 96) * (26**@column.reverse.index(char))
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
alias get_column_number column_number
|
122
|
+
extend Gem::Deprecate
|
123
|
+
deprecate :get_column_number, 'column_number', 2020, 1
|
124
|
+
|
125
|
+
# Compares rows of two cells
|
126
|
+
# @param [Coordinates] other_cell other cell coordinates
|
127
|
+
# @return [true, false] true, if row greater, than other row
|
128
|
+
def row_greater_that_other?(other_cell)
|
129
|
+
@row > other_cell.row
|
130
|
+
end
|
131
|
+
|
132
|
+
# Compares columns of two cells
|
133
|
+
# @param [Coordinates] other_cell other cell coordinates
|
134
|
+
# @return [true, false] true, if column greater, than other row
|
135
|
+
def column_greater_that_other?(other_cell)
|
136
|
+
column_number > other_cell.column_number
|
137
|
+
end
|
138
|
+
|
139
|
+
# @return [String] result of convert of object to string
|
140
|
+
def to_s
|
141
|
+
"#{@column}#{@row} #{@list ? "list: #{@list}" : ''}"
|
142
|
+
end
|
143
|
+
|
144
|
+
def nil?
|
145
|
+
@column.nil? && @list.nil? && @row.nil?
|
146
|
+
end
|
147
|
+
|
148
|
+
# Compare this object to other
|
149
|
+
# @param other [Object] any other object
|
150
|
+
# @return [True, False] result of comparision
|
151
|
+
def ==(other)
|
152
|
+
other.is_a?(Coordinates) ? (@row == other.row && @column == other.column) : false
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'underline'
|
4
|
+
# @author Pavel.Lobashov
|
5
|
+
module OoxmlParser
|
6
|
+
# Class for working with font styles (bold,italic,underlined,strike)
|
7
|
+
class FontStyle
|
8
|
+
# @return [false,true] is bold?
|
9
|
+
attr_accessor :bold
|
10
|
+
# @return [false,true] is bold?
|
11
|
+
attr_accessor :italic
|
12
|
+
# @return [Underline] underline type
|
13
|
+
attr_accessor :underlined
|
14
|
+
# @return [Strike] strike type
|
15
|
+
attr_accessor :strike
|
16
|
+
|
17
|
+
# Default constructor
|
18
|
+
# @param [true, false] bold is bold?
|
19
|
+
# @param [true, false] italic is italic?
|
20
|
+
# @param [true, false, String] underlined if not false or nil - default Underline, else none
|
21
|
+
# @param [Symbol] strike string with strike type
|
22
|
+
# @return [FontStyle] new font style
|
23
|
+
def initialize(bold = false, italic = false, underlined = Underline.new(:none), strike = :none)
|
24
|
+
@bold = bold
|
25
|
+
@italic = italic
|
26
|
+
@underlined = underlined == false || underlined.nil? ? Underline.new(:none) : underlined
|
27
|
+
@strike = strike
|
28
|
+
end
|
29
|
+
|
30
|
+
# Default == operator
|
31
|
+
# @return [true, false] true if two same, false if different
|
32
|
+
def ==(other)
|
33
|
+
(@bold == other.bold) && (@italic == other.italic) && (@underlined == other.underlined) && (@strike == other.strike)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Default to_s operator
|
37
|
+
# @return [String] with text representation
|
38
|
+
def to_s
|
39
|
+
"Bold: #{@bold}, Italic: #{@italic}, Underlined: #{@underlined}, Strike: #{@strike}"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `hlinkClick`, `hyperlink` tags
|
5
|
+
class Hyperlink < OOXMLDocumentObject
|
6
|
+
# @return [OOXMLDocumentObject] url of hyperlink
|
7
|
+
attr_accessor :url
|
8
|
+
# @return [String] tooltip value
|
9
|
+
attr_reader :tooltip
|
10
|
+
# @return [Coordinates] coordinates of link
|
11
|
+
attr_reader :coordinates
|
12
|
+
# @return [True, False] should click be highlighted
|
13
|
+
attr_reader :highlight_click
|
14
|
+
# @return [Symbol] type of action
|
15
|
+
attr_reader :action
|
16
|
+
# @return [String] value of action link
|
17
|
+
attr_reader :action_link
|
18
|
+
# @return [String] id of link
|
19
|
+
attr_reader :id
|
20
|
+
# @return [Array<ParagraphRun>] run of paragraph
|
21
|
+
attr_reader :runs
|
22
|
+
|
23
|
+
def initialize(link = nil,
|
24
|
+
tooltip = nil,
|
25
|
+
coordinates = nil,
|
26
|
+
parent: nil)
|
27
|
+
@url = link
|
28
|
+
@tooltip = tooltip
|
29
|
+
@coordinates = coordinates
|
30
|
+
@runs = []
|
31
|
+
super(parent: parent)
|
32
|
+
end
|
33
|
+
|
34
|
+
alias link url
|
35
|
+
alias link_to url
|
36
|
+
alias link= url=
|
37
|
+
alias link_to= url=
|
38
|
+
|
39
|
+
# Parse Hyperlink object
|
40
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
41
|
+
# @return [Hyperlink] result of parsing
|
42
|
+
def parse(node)
|
43
|
+
node.attributes.each do |key, value|
|
44
|
+
case key
|
45
|
+
when 'location'
|
46
|
+
@url = Coordinates.parse_coordinates_from_string(value.value)
|
47
|
+
when 'id'
|
48
|
+
@id = value.value
|
49
|
+
@url = OOXMLDocumentObject.get_link_from_rels(@id) unless @id.empty?
|
50
|
+
when 'tooltip'
|
51
|
+
@tooltip = value.value
|
52
|
+
when 'ref'
|
53
|
+
@coordinates = Coordinates.parse_coordinates_from_string(value.value)
|
54
|
+
when 'action'
|
55
|
+
@action_link = value.value
|
56
|
+
when 'highlightClick'
|
57
|
+
@highlight_click = attribute_enabled?(value)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
node.xpath('*').each do |node_child|
|
62
|
+
case node_child.name
|
63
|
+
when 'r'
|
64
|
+
@runs << ParagraphRun.new(parent: self).parse(node_child)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
case @action_link
|
69
|
+
when 'ppaction://hlinkshowjump?jump=previousslide'
|
70
|
+
@action = :previous_slide
|
71
|
+
when 'ppaction://hlinkshowjump?jump=nextslide'
|
72
|
+
@action = :next_slide
|
73
|
+
when 'ppaction://hlinkshowjump?jump=firstslide'
|
74
|
+
@action = :first_slide
|
75
|
+
when 'ppaction://hlinkshowjump?jump=lastslide'
|
76
|
+
@action = :last_slide
|
77
|
+
when 'ppaction://hlinksldjump'
|
78
|
+
@action = :slide
|
79
|
+
@url = OOXMLDocumentObject.get_link_from_rels(@id).scan(/\d+/).join.to_i
|
80
|
+
else
|
81
|
+
if @id && !@id.empty?
|
82
|
+
@action = :external_link
|
83
|
+
@url = OOXMLDocumentObject.get_link_from_rels(@id)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
self
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Module for helper methods for OOXMLDocumentObject
|
5
|
+
module OoxmlDocumentObjectHelper
|
6
|
+
# Convert object to hash
|
7
|
+
# @return [Hash]
|
8
|
+
def to_hash
|
9
|
+
result_hash = {}
|
10
|
+
instance_variables.each do |current_attribute|
|
11
|
+
next if current_attribute == :@parent
|
12
|
+
|
13
|
+
attribute_value = instance_variable_get(current_attribute)
|
14
|
+
next unless attribute_value
|
15
|
+
|
16
|
+
if attribute_value.is_a?(Array)
|
17
|
+
attribute_value.each_with_index do |object_element, index|
|
18
|
+
result_hash["#{current_attribute}_#{index}".to_sym] = object_element.to_hash
|
19
|
+
end
|
20
|
+
else
|
21
|
+
result_hash[current_attribute.to_sym] = if attribute_value.respond_to?(:to_hash)
|
22
|
+
attribute_value.to_hash
|
23
|
+
else
|
24
|
+
attribute_value.to_s
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
result_hash
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
VALUE_TO_SYMBOL_HASH = { l: :left,
|
34
|
+
ctr: :center,
|
35
|
+
r: :right,
|
36
|
+
just: :justify,
|
37
|
+
b: :bottom,
|
38
|
+
t: :top,
|
39
|
+
tr: :top_right,
|
40
|
+
tl: :top_left,
|
41
|
+
br: :bottom_right,
|
42
|
+
bl: :bottom_left,
|
43
|
+
contentLocked: :content_locked,
|
44
|
+
dist: :distributed,
|
45
|
+
tb: :horizontal,
|
46
|
+
rl: :rotate_on_90,
|
47
|
+
lr: :rotate_on_270,
|
48
|
+
inset: :in,
|
49
|
+
lu: :left_up,
|
50
|
+
ru: :right_up,
|
51
|
+
ld: :left_down,
|
52
|
+
rd: :right_down,
|
53
|
+
d: :down,
|
54
|
+
u: :up,
|
55
|
+
lg: :large,
|
56
|
+
med: :medium,
|
57
|
+
sm: :small,
|
58
|
+
beneathText: :beneath_text,
|
59
|
+
greaterThan: :greater_than,
|
60
|
+
pageBottom: :page_bottom,
|
61
|
+
sectEnd: :section_end,
|
62
|
+
docEnd: :document_end,
|
63
|
+
eachSect: :each_section,
|
64
|
+
eachPage: :each_page,
|
65
|
+
sngStrike: :single,
|
66
|
+
dblStrike: :double,
|
67
|
+
noStrike: :none,
|
68
|
+
lgDash: :large_dash,
|
69
|
+
dashDot: :dash_dot,
|
70
|
+
dashDotDot: :dash_dot_dot,
|
71
|
+
mediumDashed: :medium_dashed,
|
72
|
+
mediumDashDot: :medium_dash_dot,
|
73
|
+
mediumDashDotDot: :medium_dash_dot_dot,
|
74
|
+
lgDashDot: :large_dash_dot,
|
75
|
+
lgDashDotDot: :large_dash_dot_dot,
|
76
|
+
sdtLocked: :sdt_locked,
|
77
|
+
sdtContentLocked: :sdt_content_locked,
|
78
|
+
sysDash: :system_dash,
|
79
|
+
sysDot: :system_dot,
|
80
|
+
sysDashDot: :system_dash_dot,
|
81
|
+
sysDashDotDot: :system_dash_dot_dot,
|
82
|
+
rightMargin: :right_margin,
|
83
|
+
leftMargin: :left_margin,
|
84
|
+
bottomMargin: :bottom_margin,
|
85
|
+
topMargin: :top_margin,
|
86
|
+
undOvr: :under_over,
|
87
|
+
subSup: :subscript_superscript,
|
88
|
+
lrTb: :left_to_right_top_to_bottom,
|
89
|
+
tbRl: :top_to_bottom_right_to_left,
|
90
|
+
btLr: :bottom_to_top_left_to_right,
|
91
|
+
singlelevel: :single_level,
|
92
|
+
maxMin: :max_min,
|
93
|
+
middleDot: :middle_dot,
|
94
|
+
minMax: :min_max,
|
95
|
+
multilevel: :multi_level,
|
96
|
+
nextTo: :next_to,
|
97
|
+
hybridMultilevel: :hybrid_multi_level,
|
98
|
+
rnd: :round,
|
99
|
+
sq: :square }.freeze
|
100
|
+
|
101
|
+
# Convert value to human readable symbol
|
102
|
+
# @param [String] value to convert
|
103
|
+
# @return [Symbol]
|
104
|
+
def value_to_symbol(value)
|
105
|
+
symbol = VALUE_TO_SYMBOL_HASH[value.value.to_sym]
|
106
|
+
return value.value.to_sym if symbol.nil?
|
107
|
+
|
108
|
+
symbol
|
109
|
+
end
|
110
|
+
|
111
|
+
def root_object
|
112
|
+
tree_object = self
|
113
|
+
tree_object = tree_object.parent until tree_object.parent.nil?
|
114
|
+
tree_object
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|