ooxml_parser 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +18 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +20 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/order.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_index.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point/text_value.rb +15 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point_count.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/view_3d.rb +32 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +81 -74
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +20 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +15 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +15 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +22 -11
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing/doc_properties.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +34 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +9 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +18 -25
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +4 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +23 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +15 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +104 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative/picture_dimension.rb +17 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_vertical.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +17 -16
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +12 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties/shape_placeholder.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +27 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties/preset_text_warp.rb +7 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +20 -11
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +18 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +11 -9
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb +15 -27
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +13 -9
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +20 -23
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +27 -22
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip/alpha_mod_fix.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry/shape_adjust_value_list/shape_guide.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry/shape_adjust_value_list.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +3 -3
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +22 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +20 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +9 -8
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +15 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +14 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +15 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +18 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +12 -11
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +20 -24
- data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/color.rb +48 -182
- data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +1 -63
- data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +17 -20
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop/preset_color.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +20 -7
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +12 -11
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +17 -17
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +15 -9
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +19 -16
- data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +10 -6
- data/lib/ooxml_parser/common_parser/common_data/font_style.rb +1 -61
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +33 -26
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_document_object_helper.rb +97 -0
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +23 -37
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +71 -23
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/language.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +11 -7
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/position.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_spacing.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_style.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/size.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +92 -40
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +12 -8
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +37 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +53 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +6 -6
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list/presentation_tab.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs/paragraph_tab.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb +11 -8
- data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +20 -12
- data/lib/ooxml_parser/common_parser/common_data/relationships/relationship.rb +13 -7
- data/lib/ooxml_parser/common_parser/common_data/relationships.rb +36 -4
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +12 -8
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +18 -19
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +9 -8
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +17 -14
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +16 -23
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +21 -40
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_column_band_size.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +50 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_row_band_size.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +28 -23
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties/vertical_merge.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +71 -69
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb +18 -10
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +19 -17
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +31 -48
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line/line_join.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +25 -19
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties/table_row_height.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +20 -10
- data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +20 -16
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid/grid_column.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +27 -3
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb +20 -13
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +54 -37
- data/lib/ooxml_parser/common_parser/common_data/table.rb +23 -17
- data/lib/ooxml_parser/common_parser/common_data/underline.rb +13 -10
- data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +29 -0
- data/lib/ooxml_parser/common_parser/parser.rb +32 -4
- data/lib/ooxml_parser/configuration.rb +3 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comment.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +16 -16
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +18 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb +18 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style/document_style_helper.rb +37 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +43 -14
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/accent.rb +19 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties/argument_size.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +24 -4
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +14 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +27 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +15 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +14 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +23 -7
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +16 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +20 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +4 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +36 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_grow.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_limit_location.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +19 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +52 -183
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +89 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object/ole_object.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +24 -17
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +7 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +15 -10
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +43 -245
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb +19 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +24 -65
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/inserted.rb +41 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +146 -172
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +45 -26
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/multilevel_type.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_justification.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_text.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/numbering_format.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/start.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +65 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +42 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition/abstract_numbering_id.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +45 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +15 -4
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +24 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +6 -12
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/footnote_properties.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +8 -9
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +31 -24
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +61 -64
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +56 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/paragraph_properties_default.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/run_properties_default.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +19 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +49 -54
- data/lib/ooxml_parser/docx_parser/docx_parser.rb +2 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_helpers.rb +13 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +15 -12
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties/stretch.rb +11 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties.rb +21 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +19 -6
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +27 -16
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +13 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +11 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +19 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +17 -12
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +15 -14
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +18 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +9 -11
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition.rb +16 -13
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing.rb +23 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +21 -19
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +15 -11
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +52 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +13 -7
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action.rb +11 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +13 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb +9 -14
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +30 -67
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb +11 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +6 -3
- data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +1 -1
- data/lib/ooxml_parser/version.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +28 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +25 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +38 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +35 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +38 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb +24 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +47 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +36 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_helpers.rb +11 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +11 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +8 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb +12 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +12 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +29 -8
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/x14_table.rb +24 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb +21 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +30 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb +29 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb +25 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +23 -29
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/alignment.rb +15 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style.rb +70 -37
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +16 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +31 -9
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +34 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +20 -9
- data/lib/ooxml_parser/xlsx_parser/xlsx_parser.rb +1 -1
- data/lib/ooxml_parser.rb +0 -1
- metadata +122 -58
- data/lib/ooxml_parser/common_parser/common_data/alingment.rb +0 -56
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2007_chart_style.rb +0 -17
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2010_chart_style.rb +0 -17
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_group_element.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_grouped_drawing.rb +0 -34
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_gradient_color.rb +0 -30
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_single_gradient_color.rb +0 -6
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/solid_color/docx_solid_color.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_element.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end/line_size.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_style/docx_shape_style.rb +0 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/common_non_visual_properties.rb +0 -25
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_properties.rb +0 -19
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_shape_properties.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape.rb +0 -28
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_placeholder.rb +0 -18
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/ooxml_shift.rb +0 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/transform_effect.rb +0 -28
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties.rb +0 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/ooxml_text_box.rb +0 -26
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb +0 -23
- data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching/fill_rectangle.rb +0 -22
- data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching.rb +0 -12
- data/lib/ooxml_parser/common_parser/common_data/colors/image_properties.rb +0 -16
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/strikeout.rb +0 -16
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties/numbering_level.rb +0 -25
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties.rb +0 -69
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering.rb +0 -18
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_cell_margin.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_elements.rb +0 -21
- data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/line_join.rb +0 -19
- data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/table_cell_style.rb +0 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/operator.rb +0 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/bookmark.rb +0 -10
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/paragraph_tab.rb +0 -19
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/style_parametres.rb +0 -35
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style.rb +0 -56
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/image.rb +0 -15
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/size.rb +0 -84
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping/grouping_properties.rb +0 -16
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character/excel_comment_character_properties.rb +0 -27
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character.rb +0 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position/xlsx_drawing_position_parameters.rb +0 -22
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position.rb +0 -22
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_shape_grouping.rb +0 -37
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/foreground_color.rb +0 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/ooxml_font.rb +0 -36
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_table.rb +0 -30
@@ -1,84 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
class Size
|
3
|
-
attr_accessor :height, :width, :orientation
|
4
|
-
|
5
|
-
def initialize(height = nil, width = nil, orientation = :portrait)
|
6
|
-
@height = height
|
7
|
-
@width = width
|
8
|
-
@orientation = orientation
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.get_name_by_size(height, width, is_portrait = true)
|
12
|
-
unless is_portrait
|
13
|
-
swap_value = height
|
14
|
-
height = width
|
15
|
-
width = swap_value
|
16
|
-
end
|
17
|
-
return 'US Letter' if height == '15840' && width == '12240'
|
18
|
-
return 'US Legal' if height == '20160' && width == '12240'
|
19
|
-
return 'A4' if height == '16838' && width == '11906'
|
20
|
-
return 'A5' if height == '11900' && width == '8396'
|
21
|
-
return 'B5' if height == '14179' && width == '9978'
|
22
|
-
return 'Envelope #10' if height == '13680' && width == '5941'
|
23
|
-
return 'Envelope DL' if height == '12478' && width == '6242'
|
24
|
-
return 'Tabloid' if height == '24474' && width == '15840'
|
25
|
-
return 'A3' if height == '23817' && width == '16838'
|
26
|
-
return 'Tabloid Oversize' if height == '25914' && width == '17280'
|
27
|
-
return 'ROC 16K' if height == '15477' && width == '11157'
|
28
|
-
return 'Envelope Choukei 3' if height == '13317' && width == '6797'
|
29
|
-
return 'Super B/A3' if height == '27354' && width == '18720'
|
30
|
-
'Unknown page size: Height ' + height.to_s + ' Width ' + width.to_s
|
31
|
-
end
|
32
|
-
|
33
|
-
def to_s
|
34
|
-
'Height: ' + @height.to_s + ' Width: ' + @width.to_s + ' Orientation: ' + @orientation.to_s
|
35
|
-
end
|
36
|
-
|
37
|
-
# noinspection RubyUnnecessaryReturnStatement
|
38
|
-
def ==(other)
|
39
|
-
is_same = false
|
40
|
-
if (@height == other.height) &&
|
41
|
-
(@width == other.width) &&
|
42
|
-
(@orientation == other.orientation)
|
43
|
-
is_same = true
|
44
|
-
end
|
45
|
-
is_same
|
46
|
-
end
|
47
|
-
|
48
|
-
# @return [True, False] compare dimensions of size, ignoring orientation
|
49
|
-
def same_dimensions?(other)
|
50
|
-
(@height == other.height) && (@width == other.width) ||
|
51
|
-
(@height == other.width) && (@width == other.height)
|
52
|
-
end
|
53
|
-
|
54
|
-
# @return [String] get human format name
|
55
|
-
def name
|
56
|
-
return 'US Letter' if same_dimensions?(Size.new(27.94, 21.59))
|
57
|
-
return 'US Legal' if same_dimensions?(Size.new(35.56, 21.59))
|
58
|
-
return 'A4' if same_dimensions?(Size.new(29.7, 21.0))
|
59
|
-
return 'A5' if same_dimensions?(Size.new(20.99, 14.81))
|
60
|
-
return 'B5' if same_dimensions?(Size.new(25.01, 17.6))
|
61
|
-
return 'Envelope #10' if same_dimensions?(Size.new(24.13, 10.48))
|
62
|
-
return 'Envelope DL' if same_dimensions?(Size.new(22.01, 11.01))
|
63
|
-
return 'Tabloid' if same_dimensions?(Size.new(43.17, 27.94))
|
64
|
-
return 'A3' if same_dimensions?(Size.new(42.01, 29.7))
|
65
|
-
return 'Tabloid Oversize' if same_dimensions?(Size.new(45.71, 30.48))
|
66
|
-
return 'ROC 16K' if same_dimensions?(Size.new(27.3, 19.68))
|
67
|
-
return 'Envelope Choukei 3' if same_dimensions?(Size.new(23.49, 11.99))
|
68
|
-
return 'Super B/A3' if same_dimensions?(Size.new(48.25, 33.02))
|
69
|
-
"Unknown page size: Height #{@height} Width #{@width}"
|
70
|
-
end
|
71
|
-
|
72
|
-
# Parse BordersProperties
|
73
|
-
# @param [Nokogiri::XML:Element] node with Size
|
74
|
-
# @return [Size] value of Size
|
75
|
-
def self.parse(node)
|
76
|
-
size = Size.new
|
77
|
-
size.orientation = node.attribute('orient').value.to_sym unless node.attribute('orient').nil?
|
78
|
-
# TODO: implement and understand, why 566.929, but not `unit_delimeter`
|
79
|
-
size.height = (node.attribute('h').value.to_f / 566.929).round(2)
|
80
|
-
size.width = (node.attribute('w').value.to_f / 566.929).round(2)
|
81
|
-
size
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
class GroupingProperties
|
3
|
-
attr_accessor :transform
|
4
|
-
|
5
|
-
def self.parse(grouping_properties_node)
|
6
|
-
grouping_properties = GroupingProperties.new
|
7
|
-
grouping_properties_node.xpath('*').each do |grouping_property_node|
|
8
|
-
case grouping_property_node.name
|
9
|
-
when 'xfrm'
|
10
|
-
grouping_properties.transform = TransformEffect.parse(grouping_property_node)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
grouping_properties
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# Properties of XLSX comment Character (Run)
|
2
|
-
module OoxmlParser
|
3
|
-
class ExcelCommentCharacterProperties < OOXMLDocumentObject
|
4
|
-
attr_accessor :size, :color, :font
|
5
|
-
|
6
|
-
def initialize(size = '', color = nil, font = '')
|
7
|
-
@size = size
|
8
|
-
@color = color
|
9
|
-
@font = font
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.parse(properties_node)
|
13
|
-
character_properties = ExcelCommentCharacterProperties.new
|
14
|
-
properties_node.xpath('*').each do |properties_node_child|
|
15
|
-
case properties_node_child.name
|
16
|
-
when 'sz'
|
17
|
-
character_properties.size = properties_node_child.attribute('val').value
|
18
|
-
when 'color'
|
19
|
-
character_properties.color = Color.parse_color_tag(properties_node_child)
|
20
|
-
when 'rFont'
|
21
|
-
character_properties.font = properties_node_child.attribute('val').value
|
22
|
-
end
|
23
|
-
end
|
24
|
-
character_properties
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require_relative 'excel_comment_character/excel_comment_character_properties'
|
2
|
-
# Single Properties Character (Run) of XLSX comment
|
3
|
-
module OoxmlParser
|
4
|
-
class ExcelCommentCharacter
|
5
|
-
attr_accessor :properties, :text
|
6
|
-
|
7
|
-
def initialize(properties = nil, text = '')
|
8
|
-
@properties = properties
|
9
|
-
@text = text
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.parse(character_node)
|
13
|
-
character = ExcelCommentCharacter.new
|
14
|
-
character_node.xpath('*').each do |character_node_child|
|
15
|
-
case character_node_child.name
|
16
|
-
when 'rPr'
|
17
|
-
character.properties = ExcelCommentCharacterProperties.parse(character_node_child)
|
18
|
-
when 't'
|
19
|
-
character.text = character_node_child.text
|
20
|
-
end
|
21
|
-
end
|
22
|
-
character
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
class XlsxDrawingPositionParameters
|
3
|
-
attr_accessor :column, :column_offset, :row, :row_offset
|
4
|
-
|
5
|
-
def self.parse(position_node)
|
6
|
-
drawing_position_parameters = XlsxDrawingPositionParameters.new
|
7
|
-
position_node.xpath('*').each do |position_node_child|
|
8
|
-
case position_node_child.name
|
9
|
-
when 'col'
|
10
|
-
drawing_position_parameters.column = Coordinates.get_column_name(position_node_child.text.to_i + 1)
|
11
|
-
when 'colOff'
|
12
|
-
drawing_position_parameters.column_offset = (position_node_child.text.to_f / 360_000.0).round(3)
|
13
|
-
when 'row'
|
14
|
-
drawing_position_parameters.row = position_node_child.text.to_i + 1
|
15
|
-
when 'rowOff'
|
16
|
-
drawing_position_parameters.row_offset = (position_node_child.text.to_f / 360_000.0).round(3)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
drawing_position_parameters
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require_relative 'xlsx_drawing_position/xlsx_drawing_position_parameters'
|
2
|
-
module OoxmlParser
|
3
|
-
class XlsxDrawingPosition
|
4
|
-
attr_accessor :from, :to
|
5
|
-
|
6
|
-
# Parse XlsxDrawingPosition
|
7
|
-
# @param node [Nokogiri::XML::Element] node to parse
|
8
|
-
# @return [XlsxDrawingPosition] value of XlsxDrawingPosition
|
9
|
-
def self.parse(node)
|
10
|
-
position = XlsxDrawingPosition.new
|
11
|
-
node.xpath('*').each do |drawing_node_child|
|
12
|
-
case drawing_node_child.name
|
13
|
-
when 'from'
|
14
|
-
position.from = XlsxDrawingPositionParameters.parse(drawing_node_child)
|
15
|
-
when 'to'
|
16
|
-
position.to = XlsxDrawingPositionParameters.parse(drawing_node_child)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
position
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
class XlsxShapeGrouping
|
3
|
-
attr_accessor :properties, :shapes, :pictures, :grouping
|
4
|
-
|
5
|
-
def initialize(shapes = [], pictures = [])
|
6
|
-
@shapes = shapes
|
7
|
-
@pictures = pictures
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.parse(grouping_node)
|
11
|
-
grouping = XlsxShapeGrouping.new
|
12
|
-
grouping_node.xpath('*').each do |grouping_node_child|
|
13
|
-
case grouping_node_child.name
|
14
|
-
when 'grpSpPr'
|
15
|
-
grouping.properties = DocxShapeProperties.parse(grouping_node_child)
|
16
|
-
when 'grpSp'
|
17
|
-
grouping.grouping = parse(grouping_node_child)
|
18
|
-
when 'sp'
|
19
|
-
grouping.shapes << DocxShape.parse(grouping_node_child)
|
20
|
-
when 'pic'
|
21
|
-
grouping.pictures << DocxPicture.parse(grouping_node_child)
|
22
|
-
when 'graphicFrame'
|
23
|
-
picture = DocxPicture.new
|
24
|
-
graphic_data_node = grouping_node_child.xpath('a:graphic/a:graphicData', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main')
|
25
|
-
graphic_data_node.xpath('*').each do |graphic_data_node_child|
|
26
|
-
case graphic_data_node_child.name
|
27
|
-
when 'chart'
|
28
|
-
picture.chart = Chart.parse
|
29
|
-
end
|
30
|
-
end
|
31
|
-
grouping.pictures << picture
|
32
|
-
end
|
33
|
-
end
|
34
|
-
grouping
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# Foreground Color Data
|
2
|
-
module OoxmlParser
|
3
|
-
class ForegroundColor < OOXMLDocumentObject
|
4
|
-
attr_accessor :type, :color
|
5
|
-
|
6
|
-
def initialize(type = nil, color = Color.new)
|
7
|
-
@type = type
|
8
|
-
@color = color
|
9
|
-
end
|
10
|
-
|
11
|
-
def nil?
|
12
|
-
@type.nil? && @color.nil?
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.parse(style_number)
|
16
|
-
fill_color = ForegroundColor.new
|
17
|
-
fill_style_node = XLSXWorkbook.styles_node.xpath('//xmlns:fill')[style_number.to_i].xpath('xmlns:patternFill')
|
18
|
-
if fill_style_node && !fill_style_node.empty?
|
19
|
-
fill_color.type = fill_style_node.attribute('patternType').value.to_sym if fill_style_node.attribute('patternType')
|
20
|
-
fill_color.color = Color.parse_color_tag(fill_style_node.xpath('xmlns:fgColor').first) if fill_style_node.xpath('xmlns:fgColor')
|
21
|
-
end
|
22
|
-
fill_color
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# Font Data
|
2
|
-
module OoxmlParser
|
3
|
-
class OOXMLFont < OOXMLDocumentObject
|
4
|
-
attr_accessor :name, :size, :font_style, :color
|
5
|
-
|
6
|
-
def initialize(name = 'Calibri', size = '11', font_style = nil, color = nil)
|
7
|
-
@name = name
|
8
|
-
@size = size
|
9
|
-
@font_style = font_style
|
10
|
-
@color = color
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.parse(style_number)
|
14
|
-
font = OOXMLFont.new
|
15
|
-
font_style_node = XLSXWorkbook.styles_node.xpath('//xmlns:font')[style_number.to_i]
|
16
|
-
font.name = font_style_node.xpath('xmlns:name').first.attribute('val').value if font_style_node.xpath('xmlns:name').first
|
17
|
-
font.size = font_style_node.xpath('xmlns:sz').first.attribute('val').value.to_i if font_style_node.xpath('xmlns:sz').first
|
18
|
-
font.font_style = FontStyle.new
|
19
|
-
font_style_node.xpath('*').each do |font_style_node_child|
|
20
|
-
case font_style_node_child.name
|
21
|
-
when 'b'
|
22
|
-
font.font_style.bold = true
|
23
|
-
when 'i'
|
24
|
-
font.font_style.italic = true
|
25
|
-
when 'strike'
|
26
|
-
font.font_style.strike = :single
|
27
|
-
when 'u'
|
28
|
-
font.font_style.underlined = Underline.new(:single)
|
29
|
-
when 'color'
|
30
|
-
font.color = Color.parse_color_tag(font_style_node_child)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
font
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# Table in xlsx
|
2
|
-
module OoxmlParser
|
3
|
-
class XlsxTable < OOXMLDocumentObject
|
4
|
-
attr_accessor :name, :display_name, :reference, :autofilter, :columns
|
5
|
-
|
6
|
-
def self.parse(table_part_node)
|
7
|
-
table = XlsxTable.new
|
8
|
-
link_to_table_part_xml = OOXMLDocumentObject.get_link_from_rels(table_part_node.attribute('id').value)
|
9
|
-
doc = Nokogiri::XML(File.open(OOXMLDocumentObject.path_to_folder + link_to_table_part_xml.gsub('..', 'xl')))
|
10
|
-
table_node = doc.xpath('xmlns:table').first
|
11
|
-
table_node.attributes.each do |key, value|
|
12
|
-
case key
|
13
|
-
when 'name'
|
14
|
-
table.name = value.value.to_s
|
15
|
-
when 'displayName'
|
16
|
-
table.display_name = value.value.to_s
|
17
|
-
when 'ref'
|
18
|
-
table.reference = Coordinates.parser_coordinates_range value.value.to_s
|
19
|
-
end
|
20
|
-
end
|
21
|
-
table_node.xpath('*').each do |table_node_child|
|
22
|
-
case table_node_child.name
|
23
|
-
when 'autoFilter'
|
24
|
-
table.autofilter = Coordinates.parser_coordinates_range table_node_child.attribute('ref').value
|
25
|
-
end
|
26
|
-
end
|
27
|
-
table
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|