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,65 @@
|
|
1
|
+
require_relative 'numbering_level/level_justification'
|
2
|
+
require_relative 'numbering_level/level_text'
|
3
|
+
require_relative 'numbering_level/numbering_format'
|
4
|
+
require_relative 'numbering_level/start'
|
5
|
+
require_relative 'numbering_level/suffix'
|
6
|
+
module OoxmlParser
|
7
|
+
# This element specifies the appearance and behavior of a numbering level
|
8
|
+
# within a given abstract numbering
|
9
|
+
class NumberingLevel < OOXMLDocumentObject
|
10
|
+
# @return [Integer] level id
|
11
|
+
attr_accessor :ilvl
|
12
|
+
# @return [Start] start data
|
13
|
+
attr_accessor :start
|
14
|
+
# @return [NumberingFormat] numbering format data
|
15
|
+
attr_accessor :numbering_format
|
16
|
+
# @return [LevelText] level text
|
17
|
+
attr_accessor :text
|
18
|
+
# @return [LevelJustification] justification of level
|
19
|
+
attr_accessor :justification
|
20
|
+
# @return [ParagraphProperties] properties of paragraph
|
21
|
+
attr_accessor :paragraph_properties
|
22
|
+
# @return [RunProperties] properties of run
|
23
|
+
attr_accessor :run_properties
|
24
|
+
# @return [Suffix] value of Suffix
|
25
|
+
attr_accessor :suffix
|
26
|
+
|
27
|
+
def initialize(parent: nil)
|
28
|
+
@parent = parent
|
29
|
+
@suffix = Suffix.new(parent: self)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Parse Numbering Level data
|
33
|
+
# @param [Nokogiri::XML:Element] node with Numbering Level data
|
34
|
+
# @return [NumberingLevel] value of Numbering Level data
|
35
|
+
def parse(node)
|
36
|
+
node.attributes.each do |key, value|
|
37
|
+
case key
|
38
|
+
when 'ilvl'
|
39
|
+
@ilvl = value.value.to_f
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
node.xpath('*').each do |num_level_child|
|
44
|
+
case num_level_child.name
|
45
|
+
when 'start'
|
46
|
+
@start = Start.new(parent: self).parse(num_level_child)
|
47
|
+
when 'numFmt'
|
48
|
+
@numbering_format = NumberingFormat.new(parent: self).parse(num_level_child)
|
49
|
+
when 'lvlText'
|
50
|
+
@text = LevelText.new(parent: self).parse(num_level_child)
|
51
|
+
when 'lvlJc'
|
52
|
+
@justification = LevelJustification.new(parent: self).parse(num_level_child)
|
53
|
+
when 'pPr'
|
54
|
+
@paragraph_properties = ParagraphProperties.new(parent: self).parse(num_level_child)
|
55
|
+
when 'rPr'
|
56
|
+
@run_properties = RunProperties.new(parent: self).parse(num_level_child)
|
57
|
+
when 'suff'
|
58
|
+
@suffix = @suffix.parse(num_level_child)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
self
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require_relative 'abstract_numbering/multilevel_type'
|
2
|
+
require_relative 'abstract_numbering/numbering_level'
|
3
|
+
module OoxmlParser
|
4
|
+
# This element specifies a set of properties which shall dictate the appearance and
|
5
|
+
# behavior of a set of numbered
|
6
|
+
# paragraphs in a WordprocessingML document.
|
7
|
+
class AbstractNumbering < OOXMLDocumentObject
|
8
|
+
# @return [Integer] abstruct numbering id
|
9
|
+
attr_accessor :id
|
10
|
+
# @return [MultilevelType] myltylevel type
|
11
|
+
attr_accessor :multilevel_type
|
12
|
+
# @return [Array, NumberingLevel] numbering level data list
|
13
|
+
attr_accessor :level_list
|
14
|
+
|
15
|
+
def initialize(parent: nil)
|
16
|
+
@level_list = []
|
17
|
+
@parent = parent
|
18
|
+
end
|
19
|
+
|
20
|
+
# Parse Abstract Numbering data
|
21
|
+
# @param [Nokogiri::XML:Element] node with Abstract Numbering data
|
22
|
+
# @return [AbstractNumbering] value of Abstract Numbering data
|
23
|
+
def parse(node)
|
24
|
+
node.attributes.each do |key, value|
|
25
|
+
case key
|
26
|
+
when 'abstractNumId'
|
27
|
+
@id = value.value.to_f
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
node.xpath('*').each do |numbering_child_node|
|
32
|
+
case numbering_child_node.name
|
33
|
+
when 'multiLevelType'
|
34
|
+
@multilevel_type = MultilevelType.new(parent: self).parse(numbering_child_node)
|
35
|
+
when 'lvl'
|
36
|
+
@level_list << NumberingLevel.new(parent: self).parse(numbering_child_node)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
self
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for storing AbstractNumberingId
|
3
|
+
class AbstractNumberingId < OOXMLDocumentObject
|
4
|
+
# @return [String] value of start
|
5
|
+
attr_accessor :value
|
6
|
+
|
7
|
+
# Parse AbstractNumberingId
|
8
|
+
# @param [Nokogiri::XML:Node] node with AbstractNumberingId
|
9
|
+
# @return [AbstractNumberingId] 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_i
|
15
|
+
end
|
16
|
+
end
|
17
|
+
self
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'numbering_definition/abstract_numbering_id'
|
2
|
+
module OoxmlParser
|
3
|
+
# This element specifies a unique instance of numbering information that can be referenced by zero or more
|
4
|
+
# paragraphs within the parent WordprocessingML document.
|
5
|
+
class NumberingDefinition < OOXMLDocumentObject
|
6
|
+
# @return [Integer] num id
|
7
|
+
attr_accessor :id
|
8
|
+
# @return [AbstractNumberingId] abstract numbering id
|
9
|
+
attr_accessor :abstract_numbering_id
|
10
|
+
|
11
|
+
# Parse NumberingDefinition data
|
12
|
+
# @param [Nokogiri::XML:Element] node with NumberingDefinition data
|
13
|
+
# @return [NumberingDefinition] value of Abstract Numbering data
|
14
|
+
def parse(node)
|
15
|
+
node.attributes.each do |key, value|
|
16
|
+
case key
|
17
|
+
when 'numId'
|
18
|
+
@id = value.value.to_f
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
node.xpath('*').each do |numbering_child_node|
|
23
|
+
case numbering_child_node.name
|
24
|
+
when 'abstractNumId'
|
25
|
+
@abstract_numbering_id = AbstractNumberingId.new(parent: self).parse(numbering_child_node)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
self
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require_relative 'numbering/abstract_numbering'
|
2
|
+
require_relative 'numbering/numbering_definition'
|
3
|
+
|
4
|
+
module OoxmlParser
|
5
|
+
class Numbering < OOXMLDocumentObject
|
6
|
+
# @return [Array, AbstractNumbering] abstract numbering list
|
7
|
+
attr_accessor :abstract_numbering_list
|
8
|
+
# @return [Array, NumberingDefinition] numbering definition list
|
9
|
+
attr_accessor :numbering_definition_list
|
10
|
+
|
11
|
+
def initialize(parent: nil)
|
12
|
+
@abstract_numbering_list = []
|
13
|
+
@numbering_definition_list = []
|
14
|
+
@parent = parent
|
15
|
+
end
|
16
|
+
|
17
|
+
def properties_by_num_id(num_id)
|
18
|
+
abstract_num_id = nil
|
19
|
+
@numbering_definition_list.each do |num_def|
|
20
|
+
next unless num_id == num_def.id
|
21
|
+
abstract_num_id = num_def.abstract_numbering_id.value
|
22
|
+
break
|
23
|
+
end
|
24
|
+
return nil if abstract_num_id.nil?
|
25
|
+
@abstract_numbering_list.each do |abstract_num_item|
|
26
|
+
return abstract_num_item if abstract_num_id == abstract_num_item.id
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def parse
|
31
|
+
numbering_xml = OOXMLDocumentObject.path_to_folder + 'word/numbering.xml'
|
32
|
+
return nil unless File.exist?(numbering_xml)
|
33
|
+
node = Nokogiri::XML(File.open(numbering_xml), 'r:UTF-8')
|
34
|
+
node.xpath('w:numbering/*').each do |numbering_child_node|
|
35
|
+
case numbering_child_node.name
|
36
|
+
when 'abstractNum'
|
37
|
+
@abstract_numbering_list << AbstractNumbering.new(parent: self).parse(numbering_child_node)
|
38
|
+
when 'num'
|
39
|
+
@numbering_definition_list << NumberingDefinition.new(parent: self).parse(numbering_child_node)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
self
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb
CHANGED
@@ -1,10 +1,21 @@
|
|
1
1
|
module OoxmlParser
|
2
|
-
|
2
|
+
# Class for parsing `w:col` object
|
3
|
+
class Column < OOXMLDocumentObject
|
3
4
|
attr_accessor :width, :space, :separator
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
# Parse Column
|
7
|
+
# @param [Nokogiri::XML:Node] node with Column
|
8
|
+
# @return [Column] result of parsing
|
9
|
+
def parse(node)
|
10
|
+
node.attributes.each do |key, value|
|
11
|
+
case key
|
12
|
+
when 'w'
|
13
|
+
@width = OoxmlSize.new(value.value.to_f)
|
14
|
+
when 'space'
|
15
|
+
@space = OoxmlSize.new(value.value.to_f)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
self
|
8
19
|
end
|
9
20
|
end
|
10
21
|
end
|
@@ -6,8 +6,10 @@ module OoxmlParser
|
|
6
6
|
attr_accessor :equal_width
|
7
7
|
alias equal_width? equal_width
|
8
8
|
attr_accessor :column_array
|
9
|
+
# @return [OoxmlSize] space between columns
|
10
|
+
attr_accessor :space
|
9
11
|
|
10
|
-
def initialize(columns_count)
|
12
|
+
def initialize(columns_count = 0)
|
11
13
|
@count = columns_count
|
12
14
|
@column_array = []
|
13
15
|
end
|
@@ -19,19 +21,28 @@ module OoxmlParser
|
|
19
21
|
|
20
22
|
# Parse Columns data
|
21
23
|
# @param [Nokogiri::XML:Element] node with Columns data
|
22
|
-
# @return [
|
23
|
-
def
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
24
|
+
# @return [Columns] value of Columns data
|
25
|
+
def parse(node)
|
26
|
+
node.attributes.each do |key, value|
|
27
|
+
case key
|
28
|
+
when 'num'
|
29
|
+
@count = value.value.to_i
|
30
|
+
when 'sep'
|
31
|
+
@separator = value.value
|
32
|
+
when 'equalWidth'
|
33
|
+
@equal_width = option_enabled?(node, 'equalWidth')
|
34
|
+
when 'space'
|
35
|
+
@space = OoxmlSize.new(value.value.to_f)
|
36
|
+
end
|
33
37
|
end
|
34
|
-
|
38
|
+
|
39
|
+
node.xpath('*').each do |column_node|
|
40
|
+
case column_node.name
|
41
|
+
when 'col'
|
42
|
+
@column_array << Column.new(parent: self).parse(column_node)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
self
|
35
46
|
end
|
36
47
|
end
|
37
48
|
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb
CHANGED
@@ -1,29 +1,23 @@
|
|
1
1
|
module OoxmlParser
|
2
|
+
# Class for parsing `docGrid` tags
|
2
3
|
class DocumentGrid < OOXMLDocumentObject
|
3
4
|
attr_accessor :type, :line_pitch, :char_space
|
4
5
|
|
5
|
-
def initialize(type = nil, line_pitch = nil, char_space = nil)
|
6
|
-
@type = type
|
7
|
-
@line_pitch = line_pitch
|
8
|
-
@char_space = char_space
|
9
|
-
end
|
10
|
-
|
11
6
|
# Parse DocumentGrid
|
12
7
|
# @param [Nokogiri::XML:Element] node with DocumentGrid
|
13
8
|
# @return [DocumentGrid] value of DocumentGrid
|
14
|
-
def
|
15
|
-
document_grid = DocumentGrid.new
|
9
|
+
def parse(node)
|
16
10
|
node.attributes.each do |key, value|
|
17
11
|
case key
|
18
12
|
when 'charSpace'
|
19
|
-
|
13
|
+
@char_space = value.value
|
20
14
|
when 'linePitch'
|
21
|
-
|
15
|
+
@line_pitch = value.value.to_i
|
22
16
|
when 'type'
|
23
|
-
|
17
|
+
@type = value.value
|
24
18
|
end
|
25
19
|
end
|
26
|
-
|
20
|
+
self
|
27
21
|
end
|
28
22
|
end
|
29
23
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `footnotePr` tags
|
3
|
+
class FootnoteProperties < OOXMLDocumentObject
|
4
|
+
# @return [NumberingFormat] format of numbering
|
5
|
+
attr_accessor :numbering_format
|
6
|
+
# @return [ValuedChild] type of numbering restart
|
7
|
+
attr_accessor :numbering_restart
|
8
|
+
# @return [ValuedChild] value of numbering start
|
9
|
+
attr_accessor :numbering_start
|
10
|
+
# @return [ValuedChild] position of footnote
|
11
|
+
attr_accessor :position
|
12
|
+
|
13
|
+
# Parse FootnoteProperties
|
14
|
+
# @param [Nokogiri::XML:Element] node with FootnoteProperties
|
15
|
+
# @return [FootnoteProperties] value of FootnoteProperties
|
16
|
+
def parse(node)
|
17
|
+
node.xpath('*').each do |node_child|
|
18
|
+
case node_child.name
|
19
|
+
when 'numFmt'
|
20
|
+
@numbering_format = ValuedChild.new(:symbol, parent: self).parse(node_child)
|
21
|
+
when 'numRestart'
|
22
|
+
@numbering_restart = ValuedChild.new(:symbol, parent: self).parse(node_child)
|
23
|
+
when 'numStart'
|
24
|
+
@numbering_start = ValuedChild.new(:integer, parent: self).parse(node_child)
|
25
|
+
when 'pos'
|
26
|
+
@position = ValuedChild.new(:symbol, parent: self).parse(node_child)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
self
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -2,16 +2,15 @@ module OoxmlParser
|
|
2
2
|
class Note < OOXMLDocumentObject
|
3
3
|
attr_accessor :type, :elements, :assigned_to
|
4
4
|
|
5
|
-
def initialize
|
6
|
-
@
|
7
|
-
@elements = elements
|
8
|
-
@assigned_to = assigned_to
|
5
|
+
def initialize
|
6
|
+
@elements = []
|
9
7
|
end
|
10
8
|
|
11
|
-
def self.parse(default_paragraph, default_character, target, assigned_to, type)
|
9
|
+
def self.parse(default_paragraph, default_character, target, assigned_to, type, parent: nil)
|
12
10
|
note = Note.new
|
13
11
|
note.type = type
|
14
12
|
note.assigned_to = assigned_to
|
13
|
+
note.parent = parent
|
15
14
|
doc = Nokogiri::XML(File.open(OOXMLDocumentObject.path_to_folder + "word/#{target}"))
|
16
15
|
if type.include?('footer')
|
17
16
|
xpath_note = '//w:ftr'
|
@@ -24,19 +23,19 @@ module OoxmlParser
|
|
24
23
|
number = 0
|
25
24
|
ftr.xpath('*').each do |sub_element|
|
26
25
|
if sub_element.name == 'p'
|
27
|
-
note.elements <<
|
26
|
+
note.elements << default_paragraph.copy.parse(sub_element, number, default_character, parent: note)
|
28
27
|
number += 1
|
29
28
|
elsif sub_element.name == 'tbl'
|
30
|
-
note.elements << Table.parse(sub_element, number)
|
29
|
+
note.elements << Table.new(parent: note).parse(sub_element, number)
|
31
30
|
number += 1
|
32
31
|
elsif sub_element.name == 'std'
|
33
32
|
sub_element.xpath('w:p').each do |p|
|
34
|
-
note.elements <<
|
33
|
+
note.elements << default_paragraph.copy.parse(p, number, default_character)
|
35
34
|
number += 1
|
36
35
|
end
|
37
36
|
sub_element.xpath('w:sdtContent').each do |sdt_content|
|
38
37
|
sdt_content.xpath('w:p').each do |p|
|
39
|
-
note.elements <<
|
38
|
+
note.elements << default_paragraph.copy.parse(p, number, default_character)
|
40
39
|
number += 1
|
41
40
|
end
|
42
41
|
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
module OoxmlParser
|
2
|
-
|
2
|
+
# Class for parsing `pgMar` tags
|
3
|
+
class PageMargins < OOXMLDocumentObject
|
3
4
|
attr_accessor :top, :bottom, :left, :right, :footer, :gutter, :header
|
4
5
|
|
5
|
-
def initialize(top: nil,
|
6
|
+
def initialize(top: nil,
|
7
|
+
bottom: nil,
|
8
|
+
left: nil,
|
9
|
+
right: nil,
|
10
|
+
header: nil,
|
11
|
+
footer: nil,
|
12
|
+
gutter: nil,
|
13
|
+
parent: nil)
|
6
14
|
@top = top
|
7
15
|
@bottom = bottom
|
8
16
|
@left = left
|
@@ -10,33 +18,32 @@ module OoxmlParser
|
|
10
18
|
@header = header
|
11
19
|
@footer = footer
|
12
20
|
@gutter = gutter
|
13
|
-
|
14
|
-
|
15
|
-
def ==(other)
|
16
|
-
other.class == PageMargins &&
|
17
|
-
@top == other.top &&
|
18
|
-
@bottom == other.bottom &&
|
19
|
-
@left == other.left &&
|
20
|
-
@right == other.right &&
|
21
|
-
@footer == other.footer &&
|
22
|
-
@header == other.header &&
|
23
|
-
@gutter == other.gutter
|
21
|
+
@parent = parent
|
24
22
|
end
|
25
23
|
|
26
24
|
# Parse BordersProperties
|
27
25
|
# @param [Nokogiri::XML:Element] node with PageMargins
|
28
26
|
# @return [PageMargins] value of PageMargins
|
29
|
-
def
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
27
|
+
def parse(node)
|
28
|
+
node.attributes.each do |key, value|
|
29
|
+
case key
|
30
|
+
when 'top'
|
31
|
+
@top = OoxmlSize.new(value.value.to_f)
|
32
|
+
when 'left'
|
33
|
+
@left = OoxmlSize.new(value.value.to_f)
|
34
|
+
when 'right'
|
35
|
+
@right = OoxmlSize.new(value.value.to_f)
|
36
|
+
when 'bottom'
|
37
|
+
@bottom = OoxmlSize.new(value.value.to_f)
|
38
|
+
when 'header'
|
39
|
+
@header = OoxmlSize.new(value.value.to_f)
|
40
|
+
when 'footer'
|
41
|
+
@footer = OoxmlSize.new(value.value.to_f)
|
42
|
+
when 'gutter'
|
43
|
+
@gutter = OoxmlSize.new(value.value.to_f)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
self
|
40
47
|
end
|
41
48
|
end
|
42
49
|
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require_relative 'document_grid'
|
2
|
-
require_relative '
|
2
|
+
require_relative 'footnote_properties'
|
3
|
+
require_relative 'page_size'
|
3
4
|
require_relative 'page_margins'
|
4
5
|
require_relative 'columns'
|
5
6
|
require_relative 'note'
|
@@ -7,75 +8,71 @@ module OoxmlParser
|
|
7
8
|
class PageProperties < OOXMLDocumentObject
|
8
9
|
attr_accessor :type, :size, :margins, :document_grid, :num_type, :form_prot, :text_direction, :page_borders, :columns,
|
9
10
|
:notes
|
11
|
+
# @return [FootnoteProperties] properties of footnote
|
12
|
+
attr_accessor :footnote_properties
|
10
13
|
|
11
|
-
def initialize
|
12
|
-
@type = nil
|
13
|
-
@size = nil
|
14
|
-
@margins = nil
|
15
|
-
@document_grid = nil
|
16
|
-
@num_type = nil
|
17
|
-
@form_prot = nil
|
18
|
-
@text_direction = nil
|
19
|
-
@columns = nil
|
14
|
+
def initialize(parent: nil)
|
20
15
|
@notes = []
|
16
|
+
@parent = parent
|
21
17
|
end
|
22
18
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
19
|
+
# Parse PageProperties data
|
20
|
+
# @param [Nokogiri::XML:Element] node with PageProperties data
|
21
|
+
# @return [PageProperties] value of PageProperties data
|
22
|
+
def parse(node, default_paragraph, default_character)
|
23
|
+
node.xpath('*').each do |pg_size_subnode|
|
24
|
+
case pg_size_subnode.name
|
25
|
+
when 'pgSz'
|
26
|
+
@size = PageSize.new.parse(pg_size_subnode)
|
27
|
+
when 'pgBorders'
|
28
|
+
page_borders = Borders.new
|
29
|
+
unless pg_size_subnode.attribute('display').nil?
|
30
|
+
page_borders.display = pg_size_subnode.attribute('display').value.to_sym
|
31
|
+
end
|
32
|
+
unless pg_size_subnode.attribute('offsetFrom').nil?
|
33
|
+
page_borders.offset_from = pg_size_subnode.attribute('offsetFrom').value.to_sym
|
34
|
+
end
|
35
|
+
pg_size_subnode.xpath('w:bottom').each do |bottom|
|
36
|
+
page_borders.bottom = BordersProperties.new(parent: page_borders).parse(bottom)
|
37
|
+
end
|
38
|
+
pg_size_subnode.xpath('w:left').each do |left|
|
39
|
+
page_borders.bottom = BordersProperties.new(parent: page_borders).parse(left)
|
40
|
+
end
|
41
|
+
pg_size_subnode.xpath('w:top').each do |top|
|
42
|
+
page_borders.bottom = BordersProperties.new(parent: page_borders).parse(top)
|
43
|
+
end
|
44
|
+
pg_size_subnode.xpath('w:right').each do |right|
|
45
|
+
page_borders.bottom = BordersProperties.new(parent: page_borders).parse(right)
|
46
|
+
end
|
47
|
+
@page_borders = page_borders
|
48
|
+
when 'type'
|
49
|
+
@type = pg_size_subnode.attribute('val').value
|
50
|
+
when 'pgMar'
|
51
|
+
@margins = PageMargins.new(parent: self).parse(pg_size_subnode)
|
52
|
+
when 'pgNumType'
|
53
|
+
@num_type = pg_size_subnode.attribute('fmt').value unless pg_size_subnode.attribute('fmt').nil?
|
54
|
+
when 'formProt'
|
55
|
+
@form_prot = pg_size_subnode.attribute('val').value
|
56
|
+
when 'textDirection'
|
57
|
+
@text_direction = pg_size_subnode.attribute('val').value
|
58
|
+
when 'docGrid'
|
59
|
+
@document_grid = DocumentGrid.new(parent: self).parse(pg_size_subnode)
|
60
|
+
when 'cols'
|
61
|
+
@columns = Columns.new.parse(pg_size_subnode)
|
62
|
+
when 'headerReference', 'footerReference'
|
63
|
+
target = OOXMLDocumentObject.get_link_from_rels(pg_size_subnode.attribute('id').value)
|
64
|
+
OOXMLDocumentObject.add_to_xmls_stack("word/#{target}")
|
65
|
+
note = Note.parse(default_paragraph, default_character, target,
|
66
|
+
pg_size_subnode.attribute('type').value,
|
67
|
+
File.basename(target).sub('.xml', ''),
|
68
|
+
parent: self)
|
69
|
+
@notes << note
|
70
|
+
OOXMLDocumentObject.xmls_stack.pop
|
71
|
+
when 'footnotePr'
|
72
|
+
@footnote_properties = FootnoteProperties.new(parent: self).parse(pg_size_subnode)
|
41
73
|
end
|
42
|
-
pg_borders.xpath('w:top').each do |top|
|
43
|
-
page_borders.bottom = BordersProperties.parse(top)
|
44
|
-
end
|
45
|
-
pg_borders.xpath('w:right').each do |right|
|
46
|
-
page_borders.bottom = BordersProperties.parse(right)
|
47
|
-
end
|
48
|
-
page_properties.page_borders = page_borders
|
49
|
-
end
|
50
|
-
sect_pr.xpath('w:type').each do |type|
|
51
|
-
page_properties.type = type.attribute('val').value
|
52
|
-
end
|
53
|
-
sect_pr.xpath('w:pgMar').each do |pg_mar|
|
54
|
-
page_properties.margins = PageMargins.parse(pg_mar)
|
55
|
-
end
|
56
|
-
sect_pr.xpath('w:pgNumType').each do |pg_num_type|
|
57
|
-
page_properties.num_type = pg_num_type.attribute('fmt').value unless pg_num_type.attribute('fmt').nil?
|
58
|
-
end
|
59
|
-
sect_pr.xpath('w:formProt').each do |form_prot|
|
60
|
-
page_properties.form_prot = form_prot.attribute('val').value
|
61
|
-
end
|
62
|
-
sect_pr.xpath('w:textDirection').each do |text_direction|
|
63
|
-
page_properties.text_direction = text_direction.attribute('val').value
|
64
|
-
end
|
65
|
-
sect_pr.xpath('w:docGrid').each do |doc_grid|
|
66
|
-
page_properties.document_grid = DocumentGrid.parse(doc_grid)
|
67
|
-
end
|
68
|
-
sect_pr.xpath('w:cols').each do |columns_grid|
|
69
|
-
page_properties.columns = Columns.parse(columns_grid)
|
70
|
-
end
|
71
|
-
sect_pr.xpath('w:headerReference', 'w:footerReference').each do |doc_edge_reference|
|
72
|
-
target = OOXMLDocumentObject.get_link_from_rels(doc_edge_reference.attribute('id').value)
|
73
|
-
OOXMLDocumentObject.add_to_xmls_stack("word/#{target}")
|
74
|
-
note = Note.parse(default_paragraph, default_character, target, doc_edge_reference.attribute('type').value, File.basename(target).sub('.xml', ''))
|
75
|
-
page_properties.notes << note
|
76
|
-
OOXMLDocumentObject.xmls_stack.pop
|
77
74
|
end
|
78
|
-
|
75
|
+
self
|
79
76
|
end
|
80
77
|
end
|
81
78
|
end
|