ooxml_parser 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +18 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +20 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/order.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_index.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point/text_value.rb +15 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point_count.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/view_3d.rb +32 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +81 -74
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +20 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +15 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +15 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +22 -11
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing/doc_properties.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +34 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +9 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +18 -25
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +4 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +23 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +15 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +104 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative/picture_dimension.rb +17 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_vertical.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +17 -16
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +12 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties/shape_placeholder.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +27 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties/preset_text_warp.rb +7 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +20 -11
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +18 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +11 -9
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb +15 -27
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +13 -9
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +20 -23
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +27 -22
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip/alpha_mod_fix.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry/shape_adjust_value_list/shape_guide.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry/shape_adjust_value_list.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +3 -3
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +22 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +20 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +9 -8
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +15 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +14 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +15 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +18 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +12 -11
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +20 -24
- data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/color.rb +48 -182
- data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +1 -63
- data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +17 -20
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop/preset_color.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +20 -7
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +12 -11
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +17 -17
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +15 -9
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +19 -16
- data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +10 -6
- data/lib/ooxml_parser/common_parser/common_data/font_style.rb +1 -61
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +33 -26
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_document_object_helper.rb +97 -0
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +23 -37
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +71 -23
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/language.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +11 -7
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/position.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_spacing.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_style.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/size.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +92 -40
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +12 -8
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +37 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +53 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +6 -6
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list/presentation_tab.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs/paragraph_tab.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb +11 -8
- data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +20 -12
- data/lib/ooxml_parser/common_parser/common_data/relationships/relationship.rb +13 -7
- data/lib/ooxml_parser/common_parser/common_data/relationships.rb +36 -4
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +12 -8
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +18 -19
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +9 -8
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +17 -14
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +16 -23
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +21 -40
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_column_band_size.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +50 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_row_band_size.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +28 -23
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties/vertical_merge.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +71 -69
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb +18 -10
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +19 -17
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +31 -48
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line/line_join.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +25 -19
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties/table_row_height.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +20 -10
- data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +20 -16
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid/grid_column.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +27 -3
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb +20 -13
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +54 -37
- data/lib/ooxml_parser/common_parser/common_data/table.rb +23 -17
- data/lib/ooxml_parser/common_parser/common_data/underline.rb +13 -10
- data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +29 -0
- data/lib/ooxml_parser/common_parser/parser.rb +32 -4
- data/lib/ooxml_parser/configuration.rb +3 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comment.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +16 -16
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +18 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb +18 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style/document_style_helper.rb +37 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +43 -14
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/accent.rb +19 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties/argument_size.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +24 -4
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +14 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +27 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +15 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +14 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +23 -7
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +16 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +20 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +4 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +36 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_grow.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_limit_location.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +19 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +52 -183
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +89 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object/ole_object.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +24 -17
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +7 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +15 -10
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +43 -245
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb +19 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +24 -65
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/inserted.rb +41 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +146 -172
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +45 -26
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/multilevel_type.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_justification.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_text.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/numbering_format.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/start.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +65 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +42 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition/abstract_numbering_id.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +45 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +15 -4
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +24 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +6 -12
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/footnote_properties.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +8 -9
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +31 -24
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +61 -64
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +56 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/paragraph_properties_default.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/run_properties_default.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +19 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +49 -54
- data/lib/ooxml_parser/docx_parser/docx_parser.rb +2 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_helpers.rb +13 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +15 -12
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties/stretch.rb +11 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties.rb +21 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +19 -6
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +27 -16
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +13 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +11 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +19 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +17 -12
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +15 -14
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +18 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +9 -11
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition.rb +16 -13
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing.rb +23 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +21 -19
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +15 -11
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +52 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +13 -7
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action.rb +11 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +13 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb +9 -14
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +30 -67
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb +11 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +6 -3
- data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +1 -1
- data/lib/ooxml_parser/version.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +28 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +25 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +38 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +35 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +38 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb +24 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +47 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +36 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_helpers.rb +11 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +11 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +8 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb +12 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +12 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +29 -8
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/x14_table.rb +24 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb +21 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +30 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb +29 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb +25 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +23 -29
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/alignment.rb +15 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style.rb +70 -37
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +16 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +31 -9
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +34 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +20 -9
- data/lib/ooxml_parser/xlsx_parser/xlsx_parser.rb +1 -1
- data/lib/ooxml_parser.rb +0 -1
- metadata +122 -58
- data/lib/ooxml_parser/common_parser/common_data/alingment.rb +0 -56
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2007_chart_style.rb +0 -17
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2010_chart_style.rb +0 -17
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_group_element.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_grouped_drawing.rb +0 -34
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_gradient_color.rb +0 -30
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_single_gradient_color.rb +0 -6
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/solid_color/docx_solid_color.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_element.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end/line_size.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_style/docx_shape_style.rb +0 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/common_non_visual_properties.rb +0 -25
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_properties.rb +0 -19
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_shape_properties.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape.rb +0 -28
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_placeholder.rb +0 -18
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/ooxml_shift.rb +0 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/transform_effect.rb +0 -28
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties.rb +0 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/ooxml_text_box.rb +0 -26
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb +0 -23
- data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching/fill_rectangle.rb +0 -22
- data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching.rb +0 -12
- data/lib/ooxml_parser/common_parser/common_data/colors/image_properties.rb +0 -16
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/strikeout.rb +0 -16
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties/numbering_level.rb +0 -25
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties.rb +0 -69
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering.rb +0 -18
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_cell_margin.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_elements.rb +0 -21
- data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/line_join.rb +0 -19
- data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/table_cell_style.rb +0 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/operator.rb +0 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/bookmark.rb +0 -10
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/paragraph_tab.rb +0 -19
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/style_parametres.rb +0 -35
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style.rb +0 -56
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/image.rb +0 -15
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/size.rb +0 -84
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping/grouping_properties.rb +0 -16
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character/excel_comment_character_properties.rb +0 -27
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character.rb +0 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position/xlsx_drawing_position_parameters.rb +0 -22
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position.rb +0 -22
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_shape_grouping.rb +0 -37
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/foreground_color.rb +0 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/ooxml_font.rb +0 -36
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_table.rb +0 -30
@@ -0,0 +1,50 @@
|
|
1
|
+
require_relative 'table_style_properties/table_style_properties_helper'
|
2
|
+
module OoxmlParser
|
3
|
+
# Class for parsing `w:tblStylePr`
|
4
|
+
class TableStyleProperties < OOXMLDocumentObject
|
5
|
+
# @return [Symbol] type of Table Style Properties
|
6
|
+
attr_accessor :type
|
7
|
+
# @return [RunProperties] properties of run
|
8
|
+
attr_accessor :run_properties
|
9
|
+
# @return [CellProperties] properties of table cell
|
10
|
+
attr_accessor :table_cell_properties
|
11
|
+
# @return [TableProperties] properties of table
|
12
|
+
attr_accessor :table_properties
|
13
|
+
# @return [ParagraphProperties] properties of paragraph
|
14
|
+
attr_accessor :paragraph_properties
|
15
|
+
alias cell_properties table_cell_properties
|
16
|
+
|
17
|
+
def initialize(type: nil, parent: nil)
|
18
|
+
@type = type
|
19
|
+
@run_properties = nil
|
20
|
+
@table_cell_properties = CellProperties.new
|
21
|
+
@parent = parent
|
22
|
+
end
|
23
|
+
|
24
|
+
# Parse table style property
|
25
|
+
# @param node [Nokogiri::XML::Element] node to parse
|
26
|
+
# @return [TableStyleProperties]
|
27
|
+
def parse(node)
|
28
|
+
node.attributes.each do |key, value|
|
29
|
+
case key
|
30
|
+
when 'type'
|
31
|
+
@type = value.value.to_sym
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
node.xpath('*').each do |node_child|
|
36
|
+
case node_child.name
|
37
|
+
when 'rPr'
|
38
|
+
@run_properties = RunProperties.new(parent: self).parse(node_child)
|
39
|
+
when 'tcPr'
|
40
|
+
@table_cell_properties = CellProperties.new(parent: self).parse(node_child)
|
41
|
+
when 'tblPr'
|
42
|
+
@table_properties = TableProperties.new(parent: self).parse(node_child)
|
43
|
+
when 'pPr'
|
44
|
+
@paragraph_properties = ParagraphProperties.new(parent: self).parse(node_child)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
self
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `w:tblStyleRowBandSize` object
|
3
|
+
# When a style specifies the format for a band for
|
4
|
+
# rows in a table (a set of contiguous rows), this
|
5
|
+
# specifies the number of rows in a band.
|
6
|
+
class TableStyleRowBandSize < OOXMLDocumentObject
|
7
|
+
# @return [Integer] value of table style column band size
|
8
|
+
attr_accessor :value
|
9
|
+
|
10
|
+
# Parse TableStyleRowBandSize
|
11
|
+
# @param [Nokogiri::XML:Node] node with TableStyleRowBandSize
|
12
|
+
# @return [TableStyleColumnBandSize] result of parsing
|
13
|
+
def parse(node)
|
14
|
+
node.attributes.each do |key, value|
|
15
|
+
case key
|
16
|
+
when 'val'
|
17
|
+
@value = value.value.to_i
|
18
|
+
end
|
19
|
+
end
|
20
|
+
self
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,43 +1,48 @@
|
|
1
1
|
require_relative 'properties/borders'
|
2
2
|
require_relative 'cell_properties'
|
3
3
|
module OoxmlParser
|
4
|
+
# Class for parsing `tc` tags
|
4
5
|
class TableCell < OOXMLDocumentObject
|
5
6
|
attr_accessor :text_body, :properties, :grid_span, :horizontal_merge, :vertical_merge, :elements
|
6
7
|
|
7
|
-
def initialize(
|
8
|
-
@text_body = text_body
|
8
|
+
def initialize(parent: nil)
|
9
9
|
@elements = []
|
10
|
+
@parent = parent
|
10
11
|
end
|
11
12
|
|
12
13
|
alias cell_properties properties
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
cell.text_body = TextBody.parse(cell_node_child)
|
20
|
-
when 'tcPr'
|
21
|
-
cell.properties = CellProperties.parse(cell_node_child)
|
22
|
-
when 'p'
|
23
|
-
paragraph = DocxParagraph.parse(cell_node_child, 0, DocumentStructure.default_table_paragraph_style, DocumentStructure.default_table_run_style)
|
24
|
-
cell.elements << paragraph
|
25
|
-
when 'tbl'
|
26
|
-
table = Table.parse(cell_node_child)
|
27
|
-
cell.elements << table
|
28
|
-
end
|
29
|
-
end
|
30
|
-
cell_node.attributes.each do |key, value|
|
15
|
+
# Parse TableCell object
|
16
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
17
|
+
# @return [TableCell] result of parsing
|
18
|
+
def parse(node)
|
19
|
+
node.attributes.each do |key, value|
|
31
20
|
case key
|
32
21
|
when 'gridSpan'
|
33
|
-
|
22
|
+
@grid_span = value.value.to_i
|
34
23
|
when 'hMerge'
|
35
|
-
|
24
|
+
@horizontal_merge = value.value.to_i
|
36
25
|
when 'vMerge'
|
37
|
-
|
26
|
+
@vertical_merge = value.value.to_i
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
node.xpath('*').each do |node_child|
|
31
|
+
case node_child.name
|
32
|
+
when 'txBody'
|
33
|
+
@text_body = TextBody.new(parent: self).parse(node_child)
|
34
|
+
when 'tcPr'
|
35
|
+
@properties = CellProperties.new(parent: self).parse(node_child)
|
36
|
+
when 'p'
|
37
|
+
@elements << DocumentStructure.default_table_paragraph_style.copy.parse(node_child,
|
38
|
+
0,
|
39
|
+
DocumentStructure.default_table_run_style,
|
40
|
+
parent: self)
|
41
|
+
when 'tbl'
|
42
|
+
@elements << Table.new(parent: self).parse(node_child)
|
38
43
|
end
|
39
44
|
end
|
40
|
-
|
45
|
+
self
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties/vertical_merge.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `w:vMerge` object
|
3
|
+
class VerticalMerge < OOXMLDocumentObject
|
4
|
+
# @return [String] value of vertical merge
|
5
|
+
attr_accessor :value
|
6
|
+
|
7
|
+
# Parse vMerge
|
8
|
+
# @param [Nokogiri::XML:Node] node with vMerge
|
9
|
+
# @return [vMerge] result of parsing
|
10
|
+
def parse(node)
|
11
|
+
node.attributes.each do |key, value|
|
12
|
+
case key
|
13
|
+
when 'val'
|
14
|
+
@value = value.value.to_sym
|
15
|
+
end
|
16
|
+
end
|
17
|
+
self
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,85 +1,87 @@
|
|
1
|
+
require_relative 'cell_properties/vertical_merge'
|
1
2
|
require_relative 'merge'
|
2
3
|
module OoxmlParser
|
4
|
+
# Class for parsing 'w:tcPr' element
|
3
5
|
class CellProperties < OOXMLDocumentObject
|
4
|
-
attr_accessor :fill, :color, :borders, :
|
6
|
+
attr_accessor :fill, :color, :borders, :text_direction, :anchor, :anchor_center, :horizontal_overflow, :table_cell_width, :borders_properties, :vertical_align
|
7
|
+
# @return [GridSpan] data about grid span
|
8
|
+
attr_accessor :grid_span
|
9
|
+
# @return [TableMargins] margins
|
10
|
+
attr_accessor :vertical_merge
|
11
|
+
# @return [ParagraphMargins] margins of text in cell
|
12
|
+
attr_accessor :margins
|
13
|
+
# @return [Shade] shade of cell
|
14
|
+
attr_accessor :shade
|
15
|
+
# @return [TableMargins] margins of cell
|
16
|
+
attr_accessor :table_cell_margin
|
17
|
+
# @return [True, False] This element will prevent text from
|
18
|
+
# wrapping in the cell under certain conditions. If the cell width is fixed,
|
19
|
+
# then noWrap specifies that the cell will not be smaller than that fixed
|
20
|
+
# value when other cells in the row are not at their minimum. If the cell
|
21
|
+
# width is set to auto or pct, then the content of the cell will not wrap.
|
22
|
+
# > ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference 17.4.30.
|
23
|
+
attr_accessor :no_wrap
|
5
24
|
|
6
|
-
|
7
|
-
@borders = borders
|
8
|
-
@color = color
|
9
|
-
@fill = fill
|
10
|
-
@shd = :none
|
11
|
-
@merge = false
|
12
|
-
end
|
25
|
+
alias table_cell_borders borders_properties
|
13
26
|
|
14
|
-
|
15
|
-
|
27
|
+
def parse(node)
|
28
|
+
@borders_properties = Borders.new
|
29
|
+
@margins = ParagraphMargins.new(parent: self).parse(node)
|
30
|
+
@color = PresentationFill.new(parent: self).parse(node)
|
31
|
+
@borders = Borders.new(parent: self).parse(node)
|
32
|
+
node.xpath('*').each do |node_child|
|
33
|
+
case node_child.name
|
34
|
+
when 'vMerge'
|
35
|
+
@vertical_merge = VerticalMerge.new.parse(node_child)
|
36
|
+
when 'vAlign'
|
37
|
+
@vertical_align = node_child.attribute('val').value.to_sym
|
38
|
+
when 'gridSpan'
|
39
|
+
@grid_span = GridSpan.new.parse(node_child)
|
40
|
+
when 'tcW'
|
41
|
+
@table_cell_width = OoxmlSize.new(node_child.attribute('w').value.to_f)
|
42
|
+
when 'tcMar'
|
43
|
+
@table_cell_margin = TableMargins.new(parent: self).parse(node_child)
|
44
|
+
when 'textDirection'
|
45
|
+
@text_direction = value_to_symbol(node_child.attribute('val'))
|
46
|
+
when 'noWrap'
|
47
|
+
@no_wrap = option_enabled?(node_child)
|
48
|
+
when 'shd'
|
49
|
+
@shade = Shade.new(parent: self).parse(node_child)
|
50
|
+
when 'fill'
|
51
|
+
@fill = DocxColorScheme.new(parent: self).parse(node_child)
|
52
|
+
when 'tcBorders'
|
53
|
+
node_child.xpath('*').each do |border_child|
|
54
|
+
case border_child.name
|
55
|
+
when 'top'
|
56
|
+
@borders_properties.top = BordersProperties.new(parent: self).parse(border_child)
|
57
|
+
when 'right'
|
58
|
+
@borders_properties.right = BordersProperties.new(parent: self).parse(border_child)
|
59
|
+
when 'left'
|
60
|
+
@borders_properties.left = BordersProperties.new(parent: self).parse(border_child)
|
61
|
+
when 'bottom'
|
62
|
+
@borders_properties.bottom = BordersProperties.new(parent: self).parse(border_child)
|
63
|
+
when 'tl2br'
|
64
|
+
@borders_properties.top_left_to_bottom_right = BordersProperties.new(parent: self).parse(border_child)
|
65
|
+
when 'tr2bl'
|
66
|
+
@borders_properties.top_right_to_bottom_left = BordersProperties.new(parent: self).parse(border_child)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
16
71
|
|
17
|
-
|
18
|
-
cell_properties = CellProperties.new(Borders.parse(cell_properties_node), PresentationFill.parse(cell_properties_node))
|
19
|
-
cell_properties.margins = ParagraphMargins.parse(cell_properties_node)
|
20
|
-
cell_properties_node.attributes.each do |key, value|
|
72
|
+
node.attributes.each do |key, value|
|
21
73
|
case key
|
22
74
|
when 'vert'
|
23
|
-
|
75
|
+
@text_direction = value.value.to_sym
|
24
76
|
when 'anchor'
|
25
|
-
|
77
|
+
@anchor = value_to_symbol(value)
|
26
78
|
when 'anchorCtr'
|
27
|
-
|
79
|
+
@anchor_center = value.value
|
28
80
|
when 'horzOverflow'
|
29
|
-
|
81
|
+
@horizontal_overflow = value.value.to_sym
|
30
82
|
end
|
31
83
|
end
|
32
|
-
|
33
|
-
cell_properties_node.xpath("#{OOXMLDocumentObject.namespace_prefix}:vMerge").each do |v_merge|
|
34
|
-
cell_properties.merge = CellMerge.parse(v_merge)
|
35
|
-
end
|
36
|
-
cell_properties_node.xpath("#{OOXMLDocumentObject.namespace_prefix}:vAlign").each do |valign_node|
|
37
|
-
cell_properties.vertical_align = valign_node.attribute('val').value.to_sym
|
38
|
-
end
|
39
|
-
cell_properties_node.xpath("#{OOXMLDocumentObject.namespace_prefix}:gridSpan").each do |grid_span|
|
40
|
-
cell_properties.merge = CellMerge.new('horizontal', grid_span.attribute('val').value)
|
41
|
-
end
|
42
|
-
cell_properties_node.xpath("#{OOXMLDocumentObject.namespace_prefix}:tcW").each do |table_cell_width|
|
43
|
-
cell_properties.table_cell_width = table_cell_width.attribute('w').value.to_f / 567.5
|
44
|
-
end
|
45
|
-
cell_properties_node.xpath("#{OOXMLDocumentObject.namespace_prefix}:tcMar").each do |cell_margins_node|
|
46
|
-
cell_properties.table_cell_margin = TableMargins.parse(cell_margins_node)
|
47
|
-
end
|
48
|
-
cell_properties_node.xpath("#{OOXMLDocumentObject.namespace_prefix}:textDirection").each do |text_direction|
|
49
|
-
cell_properties.text_direction = Alignment.parse(text_direction.attribute('val'))
|
50
|
-
end
|
51
|
-
cell_properties_node.xpath("#{OOXMLDocumentObject.namespace_prefix}:tcBorders").each do |tc_boders|
|
52
|
-
tc_boders.xpath("#{OOXMLDocumentObject.namespace_prefix}:top").each do |top|
|
53
|
-
cell_borders.top = BordersProperties.parse(top)
|
54
|
-
end
|
55
|
-
tc_boders.xpath("#{OOXMLDocumentObject.namespace_prefix}:right").each do |right|
|
56
|
-
cell_borders.right = BordersProperties.parse(right)
|
57
|
-
end
|
58
|
-
tc_boders.xpath("#{OOXMLDocumentObject.namespace_prefix}:left").each do |left|
|
59
|
-
cell_borders.left = BordersProperties.parse(left)
|
60
|
-
end
|
61
|
-
tc_boders.xpath("#{OOXMLDocumentObject.namespace_prefix}:bottom").each do |bottom|
|
62
|
-
cell_borders.bottom = BordersProperties.parse(bottom)
|
63
|
-
end
|
64
|
-
tc_boders.xpath("#{OOXMLDocumentObject.namespace_prefix}:tl2br").each do |tl2br|
|
65
|
-
cell_borders.top_left_to_bottom_right = BordersProperties.parse(tl2br)
|
66
|
-
end
|
67
|
-
tc_boders.xpath("#{OOXMLDocumentObject.namespace_prefix}:tr2bl").each do |tr2bl|
|
68
|
-
cell_borders.top_right_to_bottom_left = BordersProperties.parse(tr2bl)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
cell_properties_node.xpath("#{OOXMLDocumentObject.namespace_prefix}:shd").each do |shd|
|
72
|
-
next if shd.attribute('val').value == 'nil'
|
73
|
-
cell_properties.shd = shd.attribute('fill').value
|
74
|
-
if !shd.attribute('fill').nil? && shd.attribute('fill').value != 'auto'
|
75
|
-
cell_properties.shd = Color.from_int16(shd.attribute('fill').value)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
cell_properties_node.xpath("#{OOXMLDocumentObject.namespace_prefix}:fill").each do |fill|
|
79
|
-
cell_properties.fill = DocxColorScheme.parse(fill)
|
80
|
-
end
|
81
|
-
cell_properties.borders_properties = cell_borders
|
82
|
-
cell_properties
|
84
|
+
self
|
83
85
|
end
|
84
86
|
end
|
85
87
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module OoxmlParser
|
2
|
-
class
|
2
|
+
class GridSpan
|
3
3
|
attr_accessor :type, :count_of_merged_cells, :value
|
4
4
|
|
5
5
|
def initialize(type = 'horizontal', value = nil, count_of_merged_cells = 2)
|
@@ -8,15 +8,23 @@ module OoxmlParser
|
|
8
8
|
@value = value
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
#
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
alias count_rows_in_span count_of_merged_cells
|
12
|
+
|
13
|
+
# Parse Grid Span data
|
14
|
+
# @param [Nokogiri::XML:Element] node with GridSpan data
|
15
|
+
# @return [GridSpan] value of GridSpan
|
16
|
+
def parse(node)
|
17
|
+
node.attributes.each do |key, value|
|
18
|
+
case key
|
19
|
+
when 'count_rows_in_span'
|
20
|
+
@count_of_merged_cells = value.value
|
21
|
+
when 'val'
|
22
|
+
@value = value.value.to_i
|
23
|
+
when 'type'
|
24
|
+
@type = value.value.to_sym
|
25
|
+
end
|
26
|
+
end
|
27
|
+
self
|
20
28
|
end
|
21
29
|
end
|
22
30
|
end
|
@@ -1,25 +1,27 @@
|
|
1
1
|
require_relative 'table_cell_line'
|
2
|
-
# Border Data
|
3
2
|
module OoxmlParser
|
4
|
-
|
3
|
+
# Border Data
|
4
|
+
class Border < OOXMLDocumentObject
|
5
5
|
attr_accessor :style, :color
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
return false if color != other.color
|
18
|
-
true
|
19
|
-
end
|
7
|
+
# Parse Border object
|
8
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
9
|
+
# @return [Border] result of parsing
|
10
|
+
def parse(node)
|
11
|
+
node.attributes.each do |key, value|
|
12
|
+
case key
|
13
|
+
when 'style'
|
14
|
+
@style = value_to_symbol(value)
|
15
|
+
end
|
16
|
+
end
|
20
17
|
|
21
|
-
|
22
|
-
|
18
|
+
node.xpath('*').each do |node_child|
|
19
|
+
case node_child.name
|
20
|
+
when 'color'
|
21
|
+
@color = Color.parse_color_tag(node_child)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
self
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative 'border'
|
2
2
|
module OoxmlParser
|
3
|
-
class Borders <
|
3
|
+
class Borders < ParagraphBorders
|
4
4
|
attr_accessor :left, :right, :top, :bottom, :inner_vertical, :inner_horizontal, :display, :between, :bar,
|
5
5
|
:top_left_to_bottom_right, :top_right_to_bottom_left, :offset_from
|
6
6
|
|
@@ -8,12 +8,14 @@ module OoxmlParser
|
|
8
8
|
right = BordersProperties.new,
|
9
9
|
top = BordersProperties.new,
|
10
10
|
bottom = BordersProperties.new,
|
11
|
-
between = BordersProperties.new
|
11
|
+
between = BordersProperties.new,
|
12
|
+
parent: nil)
|
12
13
|
@left = left
|
13
14
|
@right = right
|
14
15
|
@top = top
|
15
16
|
@bottom = bottom
|
16
17
|
@between = between
|
18
|
+
@parent = parent
|
17
19
|
end
|
18
20
|
|
19
21
|
def copy
|
@@ -46,19 +48,6 @@ module OoxmlParser
|
|
46
48
|
yield(top)
|
47
49
|
end
|
48
50
|
|
49
|
-
def border_visual_type
|
50
|
-
result = []
|
51
|
-
result << :left if @left.val == :single
|
52
|
-
result << :right if @right.val == :single
|
53
|
-
result << :top if @top.val == :single
|
54
|
-
result << :bottom if @bottom.val == :single
|
55
|
-
result << :inner if @between.val == :single
|
56
|
-
return :none if result == []
|
57
|
-
return :all if result == [:left, :right, :top, :bottom, :inner]
|
58
|
-
return :outer if result == [:left, :right, :top, :bottom]
|
59
|
-
return result.first if result.size == 1
|
60
|
-
end
|
61
|
-
|
62
51
|
def to_s
|
63
52
|
"Left border: #{left}, Right: #{right}, Top: #{top}, Bottom: #{bottom}"
|
64
53
|
end
|
@@ -71,53 +60,47 @@ module OoxmlParser
|
|
71
60
|
visible
|
72
61
|
end
|
73
62
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
63
|
+
# Parse Borders object
|
64
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
65
|
+
# @return [Borders] result of parsing
|
66
|
+
def parse(node)
|
67
|
+
node.xpath('*').each do |node_child|
|
68
|
+
case node_child.name
|
78
69
|
when 'lnL', 'left'
|
79
|
-
|
70
|
+
@left = TableCellLine.new(parent: self).parse(node_child)
|
80
71
|
when 'lnR', 'right'
|
81
|
-
|
72
|
+
@right = TableCellLine.new(parent: self).parse(node_child)
|
82
73
|
when 'lnT', 'top'
|
83
|
-
|
74
|
+
@top = TableCellLine.new(parent: self).parse(node_child)
|
84
75
|
when 'lnB', 'bottom'
|
85
|
-
|
76
|
+
@bottom = TableCellLine.new(parent: self).parse(node_child)
|
86
77
|
when 'lnTlToBr', 'tl2br'
|
87
|
-
|
78
|
+
@top_left_to_bottom_right = TableCellLine.new(parent: self).parse(node_child)
|
88
79
|
when 'lnBlToTr', 'tr2bl'
|
89
|
-
|
80
|
+
@top_right_to_bottom_left = TableCellLine.new(parent: self).parse(node_child)
|
90
81
|
when 'insideV'
|
91
|
-
|
82
|
+
@inner_vertical = TableCellLine.new(parent: self).parse(node_child)
|
92
83
|
when 'insideH'
|
93
|
-
|
84
|
+
@inner_horizontal = TableCellLine.new(parent: self).parse(node_child)
|
94
85
|
end
|
95
86
|
end
|
96
|
-
|
87
|
+
self
|
97
88
|
end
|
98
89
|
|
99
90
|
def self.parse_from_style(style_number)
|
100
|
-
|
91
|
+
node = XLSXWorkbook.styles_node.xpath('//xmlns:border')[style_number.to_i]
|
101
92
|
cell_borders = Borders.new
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
cell_borders.right = Border.new
|
114
|
-
cell_borders.right.style = border_style_node.xpath('xmlns:right')[0].attribute('style').value
|
115
|
-
cell_borders.right.color = Color.parse_color_tag(border_style_node.xpath('xmlns:right/xmlns:color')[0])
|
116
|
-
end
|
117
|
-
unless border_style_node.xpath('xmlns:left')[0].attribute('style').nil?
|
118
|
-
cell_borders.left = Border.new
|
119
|
-
cell_borders.left.style = border_style_node.xpath('xmlns:left')[0].attribute('style').value
|
120
|
-
cell_borders.left.color = Color.parse_color_tag(border_style_node.xpath('xmlns:left/xmlns:color')[0])
|
93
|
+
node.xpath('*').each do |node_child|
|
94
|
+
case node_child.name
|
95
|
+
when 'bottom'
|
96
|
+
cell_borders.bottom = Border.new(parent: cell_borders).parse(node_child)
|
97
|
+
when 'top'
|
98
|
+
cell_borders.top = Border.new(parent: cell_borders).parse(node_child)
|
99
|
+
when 'right'
|
100
|
+
cell_borders.right = Border.new(parent: cell_borders).parse(node_child)
|
101
|
+
when 'left'
|
102
|
+
cell_borders.left = Border.new(parent: cell_borders).parse(node_child)
|
103
|
+
end
|
121
104
|
end
|
122
105
|
cell_borders
|
123
106
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
class LineJoin < OOXMLDocumentObject
|
3
|
+
attr_accessor :type, :limit
|
4
|
+
|
5
|
+
# Parse LineJoin object
|
6
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
7
|
+
# @return [LineJoin] result of parsing
|
8
|
+
def parse(node)
|
9
|
+
node.xpath('*').each do |node_child|
|
10
|
+
case node_child.name
|
11
|
+
when 'round', 'bevel'
|
12
|
+
@type = node_child.name.to_sym
|
13
|
+
when 'miter'
|
14
|
+
@type = :miter
|
15
|
+
@limit = node_child.attribute('lim').value.to_f
|
16
|
+
end
|
17
|
+
end
|
18
|
+
self
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb
CHANGED
@@ -1,35 +1,41 @@
|
|
1
|
+
require_relative 'table_cell_line/line_join'
|
1
2
|
module OoxmlParser
|
3
|
+
# Class for parsing Table Cell Lines
|
2
4
|
class TableCellLine < OOXMLDocumentObject
|
3
5
|
attr_accessor :fill, :dash, :line_join, :head_end, :tail_end, :align, :width, :cap_type, :compound_line_type
|
4
6
|
|
5
|
-
def initialize(fill = nil, line_join = nil)
|
7
|
+
def initialize(fill = nil, line_join = nil, parent: nil)
|
6
8
|
@fill = fill
|
7
9
|
@line_join = line_join
|
10
|
+
@parent = parent
|
8
11
|
end
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
line.head_end = LineEnd.parse(border_node_child)
|
18
|
-
when 'tailEnd'
|
19
|
-
line.tail_end = LineEnd.parse(border_node_child)
|
20
|
-
when 'ln'
|
21
|
-
return TableCellLine.parse(border_node_child)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
border_node.attributes.each do |key, value|
|
13
|
+
# Parse TableCellLine object
|
14
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
15
|
+
# @return [TableCellLine] result of parsing
|
16
|
+
def parse(node)
|
17
|
+
@fill = PresentationFill.new(parent: self).parse(node)
|
18
|
+
@line_join = LineJoin.new(parent: self).parse(node)
|
19
|
+
node.attributes.each do |key, value|
|
25
20
|
case key
|
26
21
|
when 'w'
|
27
|
-
|
22
|
+
@width = OoxmlSize.new(value.value.to_f, :emu)
|
28
23
|
when 'algn'
|
29
|
-
|
24
|
+
@align = value_to_symbol(value)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
node.xpath('*').each do |node_child|
|
29
|
+
case node_child.name
|
30
|
+
when 'headEnd'
|
31
|
+
@head_end = LineEnd.new(parent: self).parse(node_child)
|
32
|
+
when 'tailEnd'
|
33
|
+
@tail_end = LineEnd.new(parent: self).parse(node_child)
|
34
|
+
when 'ln'
|
35
|
+
return TableCellLine.new(parent: self).parse(node_child)
|
30
36
|
end
|
31
37
|
end
|
32
|
-
|
38
|
+
self
|
33
39
|
end
|
34
40
|
end
|
35
41
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `w:trHeight` object
|
3
|
+
class TableRowHeight < OOXMLDocumentObject
|
4
|
+
# @return [Integer] value of size
|
5
|
+
attr_accessor :value
|
6
|
+
|
7
|
+
# Parse TableRowHeight
|
8
|
+
# @param [Nokogiri::XML:Node] node with TableRowHeight
|
9
|
+
# @return [TableRowHeight] result of parsing
|
10
|
+
def parse(node)
|
11
|
+
node.attributes.each do |key, value|
|
12
|
+
case key
|
13
|
+
when 'val'
|
14
|
+
@value = OoxmlSize.new(value.value.to_f)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
self
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|