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
data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
# Class for storing SheetFormatProperties
|
2
1
|
module OoxmlParser
|
3
|
-
|
2
|
+
# Class for storing SheetFormatProperties
|
3
|
+
class SheetFormatProperties < OOXMLDocumentObject
|
4
4
|
attr_accessor :default_column_width, :default_row_height
|
5
5
|
|
6
|
-
def initialize(column_width = nil, row_height = nil)
|
7
|
-
@default_column_width = column_width
|
8
|
-
@default_row_height = row_height
|
9
|
-
end
|
10
|
-
|
11
6
|
# Parse SheetFormatProperties
|
12
7
|
# @param node [Nokogiri::XML::Element] node to parse
|
13
8
|
# @return [SheetFormatProperties] value of SheetFormatProperties
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
def parse(node)
|
10
|
+
node.attributes.each do |key, value|
|
11
|
+
case key
|
12
|
+
when 'defaultColWidth'
|
13
|
+
@default_column_width = value.value.to_f
|
14
|
+
when 'defaultRowHeight'
|
15
|
+
@default_row_height = value.value.to_f
|
16
|
+
end
|
17
|
+
end
|
18
|
+
self
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb
CHANGED
@@ -1,23 +1,25 @@
|
|
1
|
-
# XLSX data of pane
|
2
1
|
module OoxmlParser
|
3
|
-
|
2
|
+
# Class for `pane` data
|
3
|
+
class Pane < OOXMLDocumentObject
|
4
4
|
attr_accessor :state, :top_left_cell, :x_split, :y_split
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
# Parse Pane object
|
7
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
8
|
+
# @return [Pane] result of parsing
|
9
|
+
def parse(node)
|
10
|
+
node.attributes.each do |key, value|
|
9
11
|
case key
|
10
12
|
when 'state'
|
11
|
-
|
13
|
+
@state = value.value.to_sym
|
12
14
|
when 'topLeftCell'
|
13
|
-
|
15
|
+
@top_left_cell = Coordinates.parse_coordinates_from_string(value.value)
|
14
16
|
when 'xSplit'
|
15
|
-
|
17
|
+
@x_split = value.value
|
16
18
|
when 'ySplit'
|
17
|
-
|
19
|
+
@y_split = value.value
|
18
20
|
end
|
19
21
|
end
|
20
|
-
|
22
|
+
self
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -1,18 +1,39 @@
|
|
1
1
|
require_relative 'sheet_view/pane'
|
2
|
-
# Class for Sheet View
|
3
2
|
module OoxmlParser
|
4
|
-
|
3
|
+
# Class for `sheetView` data
|
4
|
+
class SheetView < OOXMLDocumentObject
|
5
5
|
attr_accessor :pane
|
6
|
+
# @return [True, False] Flag indicating whether this sheet should display gridlines.
|
7
|
+
attr_accessor :show_gridlines
|
8
|
+
# @return [True, False] Flag indicating whether the sheet should display row and column headings.
|
9
|
+
attr_accessor :show_row_column_headers
|
6
10
|
|
7
|
-
def
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
+
def initialize(parent: nil)
|
12
|
+
@parent = parent
|
13
|
+
@show_gridlines = true
|
14
|
+
@show_row_column_headers = true
|
15
|
+
end
|
16
|
+
|
17
|
+
# Parse SheetView object
|
18
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
19
|
+
# @return [SheetView] result of parsing
|
20
|
+
def parse(node)
|
21
|
+
node.attributes.each do |key, _value|
|
22
|
+
case key
|
23
|
+
when 'showGridLines'
|
24
|
+
@show_gridlines = attribute_enabled?(node, key)
|
25
|
+
when 'showRowColHeaders'
|
26
|
+
@show_row_column_headers = attribute_enabled?(node, key)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
node.xpath('*').each do |node_child|
|
31
|
+
case node_child.name
|
11
32
|
when 'pane'
|
12
|
-
|
33
|
+
@pane = Pane.new(parent: self).parse(node_child)
|
13
34
|
end
|
14
35
|
end
|
15
|
-
|
36
|
+
self
|
16
37
|
end
|
17
38
|
end
|
18
39
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for `x14:table` data
|
3
|
+
class X14Table < OOXMLDocumentObject
|
4
|
+
# @return [String] alternate text for table
|
5
|
+
attr_accessor :alt_text
|
6
|
+
# @return [String] alternate text summary table
|
7
|
+
attr_accessor :alt_text_summary
|
8
|
+
|
9
|
+
# Parse X14Table data
|
10
|
+
# @param [Nokogiri::XML:Element] node with X14Table data
|
11
|
+
# @return [X14Table] value of X14Table data
|
12
|
+
def parse(node)
|
13
|
+
node.attributes.each do |key, value|
|
14
|
+
case key
|
15
|
+
when 'altText'
|
16
|
+
@alt_text = value.value.to_s
|
17
|
+
when 'altTextSummary'
|
18
|
+
@alt_text_summary = value.value.to_s
|
19
|
+
end
|
20
|
+
end
|
21
|
+
self
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'extension/x14_table'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for `ext` data
|
4
|
+
class Extension < OOXMLDocumentObject
|
5
|
+
# @return [X14Table] table data in x14 namespace
|
6
|
+
attr_accessor :table
|
7
|
+
|
8
|
+
# Parse Extension data
|
9
|
+
# @param [Nokogiri::XML:Element] node with Extension data
|
10
|
+
# @return [Extension] value of Extension data
|
11
|
+
def parse(node)
|
12
|
+
node.xpath('*').each do |column_node|
|
13
|
+
case column_node.name
|
14
|
+
when 'table'
|
15
|
+
@table = X14Table.new(parent: self).parse(column_node)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
self
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require_relative 'extension_list/extension'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for `extLst` data
|
4
|
+
class ExtensionList < OOXMLDocumentObject
|
5
|
+
attr_accessor :extension_array
|
6
|
+
|
7
|
+
def initialize(parent: nil)
|
8
|
+
@extension_array = []
|
9
|
+
@parent = parent
|
10
|
+
end
|
11
|
+
|
12
|
+
# @return [Array, Extension] accessor
|
13
|
+
def [](key)
|
14
|
+
@extension_array[key]
|
15
|
+
end
|
16
|
+
|
17
|
+
# Parse ExtensionList data
|
18
|
+
# @param [Nokogiri::XML:Element] node with ExtensionList data
|
19
|
+
# @return [ExtensionList] value of ExtensionList data
|
20
|
+
def parse(node)
|
21
|
+
node.xpath('*').each do |column_node|
|
22
|
+
case column_node.name
|
23
|
+
when 'ext'
|
24
|
+
@extension_array << Extension.new(parent: self).parse(column_node)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
self
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative 'table_part/extension_list'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for `tablePart` data
|
4
|
+
class TablePart < OOXMLDocumentObject
|
5
|
+
attr_accessor :name, :display_name, :reference, :autofilter, :columns
|
6
|
+
# @return [ExtensionList] list of extensions
|
7
|
+
attr_accessor :extension_list
|
8
|
+
|
9
|
+
# Parse TablePart object
|
10
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
11
|
+
# @return [TablePart] result of parsing
|
12
|
+
def parse(node)
|
13
|
+
link_to_table_part_xml = OOXMLDocumentObject.get_link_from_rels(node.attribute('id').value)
|
14
|
+
doc = Nokogiri::XML(File.open(OOXMLDocumentObject.path_to_folder + link_to_table_part_xml.gsub('..', 'xl')))
|
15
|
+
table_node = doc.xpath('xmlns:table').first
|
16
|
+
table_node.attributes.each do |key, value|
|
17
|
+
case key
|
18
|
+
when 'name'
|
19
|
+
@name = value.value.to_s
|
20
|
+
when 'displayName'
|
21
|
+
@display_name = value.value.to_s
|
22
|
+
when 'ref'
|
23
|
+
@reference = Coordinates.parser_coordinates_range value.value.to_s
|
24
|
+
end
|
25
|
+
end
|
26
|
+
table_node.xpath('*').each do |node_child|
|
27
|
+
case node_child.name
|
28
|
+
when 'autoFilter'
|
29
|
+
@autofilter = Coordinates.parser_coordinates_range node_child.attribute('ref').value
|
30
|
+
when 'extLst'
|
31
|
+
@extension_list = ExtensionList.new(parent: self).parse(node_child)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
self
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb
CHANGED
@@ -1,21 +1,40 @@
|
|
1
|
-
# Properties of XLSX column
|
2
1
|
module OoxmlParser
|
2
|
+
# Properties of XLSX column
|
3
3
|
class XlsxColumnProperties < OOXMLDocumentObject
|
4
4
|
attr_accessor :from, :to, :width, :style
|
5
|
+
# @return [True, False] is width custom
|
6
|
+
attr_accessor :custom_width
|
7
|
+
# @return [True, False] Flag indicating if the
|
8
|
+
# specified column(s) is set to 'best fit'
|
9
|
+
attr_accessor :best_fit
|
5
10
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
# Parse XlsxColumnProperties object
|
12
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
13
|
+
# @return [XlsxColumnProperties] result of parsing
|
14
|
+
def parse(node)
|
15
|
+
node.attributes.each do |key, value|
|
16
|
+
case key
|
17
|
+
when 'min'
|
18
|
+
@from = value.value.to_i
|
19
|
+
when 'max'
|
20
|
+
@to = value.value.to_i
|
21
|
+
when 'style'
|
22
|
+
@style = CellStyle.new(parent: self).parse(value.value)
|
23
|
+
when 'width'
|
24
|
+
@width = value.value.to_f - 0.7109375
|
25
|
+
when 'customWidth'
|
26
|
+
@custom_width = option_enabled?(node, 'customWidth')
|
27
|
+
when 'bestFit'
|
28
|
+
@best_fit = attribute_enabled?(value)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
self
|
13
32
|
end
|
14
33
|
|
15
|
-
def self.parse_list(columns_width_node)
|
34
|
+
def self.parse_list(columns_width_node, parent: nil)
|
16
35
|
columns = []
|
17
36
|
columns_width_node.xpath('xmlns:col').each do |col_node|
|
18
|
-
col = XlsxColumnProperties.parse(col_node)
|
37
|
+
col = XlsxColumnProperties.new(parent: parent).parse(col_node)
|
19
38
|
columns << col
|
20
39
|
end
|
21
40
|
columns
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing offset of drawing `xdr:from`, `xdr:to`
|
3
|
+
class XlsxDrawingPositionParameters < OOXMLDocumentObject
|
4
|
+
attr_accessor :column, :column_offset, :row, :row_offset
|
5
|
+
|
6
|
+
# Parse XlsxDrawingPositionParameters object
|
7
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
8
|
+
# @return [XlsxDrawingPositionParameters] result of parsing
|
9
|
+
def parse(node)
|
10
|
+
node.xpath('*').each do |node_child|
|
11
|
+
case node_child.name
|
12
|
+
when 'col'
|
13
|
+
@column = Coordinates.get_column_name(node_child.text.to_i + 1)
|
14
|
+
when 'colOff'
|
15
|
+
@column_offset = OoxmlSize.new(node_child.text.to_f, :emu)
|
16
|
+
when 'row'
|
17
|
+
@row = node_child.text.to_i + 1
|
18
|
+
when 'rowOff'
|
19
|
+
@row_offset = OoxmlSize.new(node_child.text.to_f, :emu)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
self
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,49 +1,43 @@
|
|
1
|
-
require_relative 'xlsx_drawing/
|
2
|
-
require_relative 'xlsx_drawing/xlsx_shape_grouping'
|
1
|
+
require_relative 'xlsx_drawing/xlsx_drawing_position_parameters'
|
3
2
|
module OoxmlParser
|
4
3
|
class XlsxDrawing < OOXMLDocumentObject
|
5
|
-
attr_accessor :
|
4
|
+
attr_accessor :picture, :shape, :grouping
|
5
|
+
# @return [XlsxDrawingPositionParameters] position from
|
6
|
+
attr_accessor :from
|
7
|
+
# @return [XlsxDrawingPositionParameters] position to
|
8
|
+
attr_accessor :to
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
# Parse XlsxDrawing object
|
11
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
12
|
+
# @return [XlsxDrawing] result of parsing
|
13
|
+
def parse(node)
|
14
|
+
node.xpath('*').each do |child_node|
|
15
|
+
case child_node.name
|
16
|
+
when 'from'
|
17
|
+
@from = XlsxDrawingPositionParameters.new(parent: self).parse(child_node)
|
18
|
+
when 'to'
|
19
|
+
@to = XlsxDrawingPositionParameters.new(parent: self).parse(child_node)
|
16
20
|
when 'sp'
|
17
|
-
|
21
|
+
@shape = DocxShape.new(parent: self).parse(child_node)
|
18
22
|
when 'grpSp'
|
19
|
-
|
23
|
+
@grouping = ShapesGrouping.new(parent: self).parse(child_node)
|
20
24
|
when 'pic'
|
21
|
-
|
25
|
+
@picture = DocxPicture.new(parent: self).parse(child_node)
|
22
26
|
when 'graphicFrame'
|
23
|
-
|
24
|
-
graphic_data_node =
|
27
|
+
@picture = DocxPicture.new
|
28
|
+
graphic_data_node = child_node.xpath('a:graphic/a:graphicData', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main')
|
25
29
|
graphic_data_node.xpath('*').each do |graphic_data_node_child|
|
26
30
|
case graphic_data_node_child.name
|
27
31
|
when 'chart'
|
28
32
|
path_to_chart_xml = OOXMLDocumentObject.get_link_from_rels(graphic_data_node_child.attribute('id').value)
|
29
33
|
OOXMLDocumentObject.add_to_xmls_stack(path_to_chart_xml)
|
30
|
-
|
34
|
+
@picture.chart = Chart.parse
|
31
35
|
OOXMLDocumentObject.xmls_stack.pop
|
32
36
|
end
|
33
37
|
end
|
34
38
|
end
|
35
39
|
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.parse_list(worksheet)
|
40
|
-
drawing_node = Nokogiri::XML(File.open(OOXMLDocumentObject.current_xml))
|
41
|
-
drawing_node.xpath('xdr:wsDr/*').each do |drawing_node_child|
|
42
|
-
case drawing_node_child.name
|
43
|
-
when 'twoCellAnchor'
|
44
|
-
worksheet.drawings << XlsxDrawing.parse(drawing_node_child)
|
45
|
-
end
|
46
|
-
end
|
40
|
+
self
|
47
41
|
end
|
48
42
|
end
|
49
43
|
end
|
@@ -1,30 +1,33 @@
|
|
1
|
-
# Character Alignment in XLSX
|
2
1
|
module OoxmlParser
|
3
|
-
|
2
|
+
# Character Alignment in XLSX
|
3
|
+
class XlsxAlignment < OOXMLDocumentObject
|
4
4
|
attr_accessor :horizontal, :vertical, :wrap_text, :text_rotation
|
5
5
|
|
6
|
-
def initialize(horizontal = :left, vertical = :bottom, wrap_text = false)
|
6
|
+
def initialize(horizontal = :left, vertical = :bottom, wrap_text = false, parent: nil)
|
7
7
|
@horizontal = horizontal
|
8
8
|
@vertical = vertical
|
9
9
|
@wrap_text = wrap_text
|
10
|
+
@parent = parent
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
# Parse XlsxAlignment object
|
14
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
15
|
+
# @return [XlsxAlignment] result of parsing
|
16
|
+
def parse(node)
|
17
|
+
node.attributes.each do |key, value|
|
15
18
|
case key
|
16
19
|
when 'horizontal'
|
17
|
-
|
18
|
-
|
20
|
+
@horizontal = value.value.to_sym
|
21
|
+
@wrap_text = true if @horizontal == :justify
|
19
22
|
when 'vertical'
|
20
|
-
|
23
|
+
@vertical = value.value.to_sym
|
21
24
|
when 'wrapText'
|
22
|
-
|
25
|
+
@wrap_text = value.value.to_s == '1'
|
23
26
|
when 'textRotation'
|
24
|
-
|
27
|
+
@text_rotation = value.value.to_i
|
25
28
|
end
|
26
29
|
end
|
27
|
-
|
30
|
+
self
|
28
31
|
end
|
29
32
|
end
|
30
33
|
end
|
@@ -1,7 +1,6 @@
|
|
1
|
-
require_relative 'cell_style/foreground_color'
|
2
1
|
require_relative 'cell_style/alignment'
|
3
|
-
require_relative 'cell_style/ooxml_font'
|
4
2
|
module OoxmlParser
|
3
|
+
# Class for parsing cell style
|
5
4
|
class CellStyle < OOXMLDocumentObject
|
6
5
|
ALL_FORMAT_VALUE = %w|0 0.00 #,##0 #,##0.00 $#,##0_);($#,##0) $#,##0_);[Red]($#,##0) $#,##0.00_);($#,##0.00)
|
7
6
|
$#,##0.00_);[Red]($#,##0.00)
|
@@ -49,47 +48,81 @@ module OoxmlParser
|
|
49
48
|
attr_accessor :font, :borders, :fill_color, :numerical_format, :alignment
|
50
49
|
# @return [True, False] check if style should add QuotePrefix (' symbol) to start of the string
|
51
50
|
attr_accessor :quote_prefix
|
51
|
+
# @return [True, False] is font applied
|
52
|
+
attr_accessor :apply_font
|
53
|
+
# @return [True, False] is border applied
|
54
|
+
attr_accessor :apply_border
|
55
|
+
# @return [True, False] is fill applied
|
56
|
+
attr_accessor :apply_fill
|
57
|
+
# @return [True, False] is number format applied
|
58
|
+
attr_accessor :apply_number_format
|
59
|
+
# @return [True, False] is alignment applied
|
60
|
+
attr_accessor :apply_alignment
|
61
|
+
# @return [Integer] id of font
|
62
|
+
attr_accessor :font_id
|
63
|
+
# @return [Integer] id of border
|
64
|
+
attr_accessor :border_id
|
65
|
+
# @return [Integer] id of fill
|
66
|
+
attr_accessor :fill_id
|
67
|
+
# @return [Integer] id of number format
|
68
|
+
attr_accessor :number_format_id
|
52
69
|
|
53
|
-
def initialize(
|
54
|
-
@
|
55
|
-
@
|
56
|
-
@
|
57
|
-
@numerical_format = numerical_format
|
58
|
-
@alignment = alignment
|
70
|
+
def initialize(parent: nil)
|
71
|
+
@numerical_format = 'General'
|
72
|
+
@alignment = XlsxAlignment.new
|
73
|
+
@parent = parent
|
59
74
|
end
|
60
75
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
76
|
+
# Parse CellStyle object
|
77
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
78
|
+
# @return [CellStyle] result of parsing
|
79
|
+
def parse(node)
|
80
|
+
style_node = XLSXWorkbook.styles_node.xpath('//xmlns:cellXfs/xmlns:xf')[node.to_i]
|
81
|
+
style_node.attributes.each do |key, value|
|
82
|
+
case key
|
83
|
+
when 'applyFont'
|
84
|
+
@apply_font = attribute_enabled?(value)
|
85
|
+
when 'applyBorder'
|
86
|
+
@apply_border = attribute_enabled?(value)
|
87
|
+
when 'applyFill'
|
88
|
+
@apply_fill = attribute_enabled?(value)
|
89
|
+
when 'applyNumberFormat'
|
90
|
+
@apply_number_format = attribute_enabled?(value)
|
91
|
+
when 'applyAlignment'
|
92
|
+
@apply_alignment = attribute_enabled?(value)
|
93
|
+
when 'fontId'
|
94
|
+
@font_id = value.value.to_i
|
95
|
+
when 'borderId'
|
96
|
+
@border_id = value.value.to_i
|
97
|
+
when 'fillId'
|
98
|
+
@fill_id = value.value.to_i
|
99
|
+
when 'numFmtId'
|
100
|
+
@number_format_id = value.value.to_i
|
101
|
+
when 'quotePrefix'
|
102
|
+
@quote_prefix = attribute_enabled?(value)
|
84
103
|
end
|
85
|
-
cell_style.numerical_format = CellStyle::ALL_FORMAT_VALUE[format_id - 1] if CellStyle::ALL_FORMAT_VALUE[format_id - 1]
|
86
104
|
end
|
87
|
-
|
88
|
-
|
89
|
-
|
105
|
+
style_node.xpath('*').each do |node_child|
|
106
|
+
case node_child.name
|
107
|
+
when 'alignment'
|
108
|
+
@alignment.parse(node_child) if @apply_alignment
|
109
|
+
end
|
90
110
|
end
|
91
|
-
|
92
|
-
|
111
|
+
calculate_values
|
112
|
+
self
|
113
|
+
end
|
114
|
+
|
115
|
+
def calculate_values
|
116
|
+
@font = root_object.style_sheet.fonts[@font_id]
|
117
|
+
@borders = Borders.parse_from_style(@border_id) if @apply_border
|
118
|
+
@fill_color = root_object.style_sheet.fills[@fill_id] if @apply_fill
|
119
|
+
return unless @apply_number_format
|
120
|
+
format = root_object.style_sheet.number_formats.format_by_id(@number_format_id)
|
121
|
+
@numerical_format = if format
|
122
|
+
format.format_code
|
123
|
+
else
|
124
|
+
CellStyle::ALL_FORMAT_VALUE[@number_format_id - 1]
|
125
|
+
end
|
93
126
|
end
|
94
127
|
end
|
95
128
|
end
|
data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb
CHANGED
@@ -7,25 +7,29 @@ module OoxmlParser
|
|
7
7
|
# @return [String] text without applying any style modificators, like quote_prefix
|
8
8
|
attr_accessor :raw_text
|
9
9
|
|
10
|
-
def initialize(style = nil, text = '')
|
10
|
+
def initialize(style = nil, text = '', parent: nil)
|
11
11
|
@style = style
|
12
12
|
@text = text
|
13
13
|
@raw_text = ''
|
14
|
+
@parent = parent
|
14
15
|
end
|
15
16
|
|
16
|
-
|
17
|
+
# Parse XlsxCell object
|
18
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
19
|
+
# @return [XlsxCell] result of parsing
|
20
|
+
def parse(node)
|
17
21
|
text_string_id = nil
|
18
|
-
text_string_id =
|
19
|
-
|
20
|
-
if
|
21
|
-
|
22
|
+
text_string_id = node.attribute('s').value unless node.attribute('s').nil?
|
23
|
+
@style = CellStyle.new(parent: self).parse(text_string_id)
|
24
|
+
if node.attribute('t').nil?
|
25
|
+
@raw_text = node.xpath('xmlns:v').text
|
22
26
|
else
|
23
|
-
|
27
|
+
node.attribute('t').value == 's' ? XlsxCell.get_shared_string(node.xpath('xmlns:v').text, self) : @raw_text = node.xpath('xmlns:v').text
|
24
28
|
end
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
+
@formula = node.xpath('xmlns:f').text unless node.xpath('xmlns:f').text == ''
|
30
|
+
@text = @raw_text.dup unless @raw_text.nil?
|
31
|
+
@text.insert(0, "'") if @style.quote_prefix
|
32
|
+
self
|
29
33
|
end
|
30
34
|
|
31
35
|
# Get shared string by it's number
|
@@ -37,7 +41,7 @@ module OoxmlParser
|
|
37
41
|
XLSXWorkbook.shared_strings[value.to_i].xpath('*').each do |si_node_child|
|
38
42
|
case si_node_child.name
|
39
43
|
when 'r'
|
40
|
-
cell.character = ParagraphRun.parse(si_node_child)
|
44
|
+
cell.character = ParagraphRun.new(parent: cell).parse(si_node_child)
|
41
45
|
when 't'
|
42
46
|
cell.raw_text = si_node_child.text
|
43
47
|
end
|