ooxml_parser 0.4.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ooxml_parser.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +39 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats/pivot_format.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/plot_area.rb +67 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/plot_area/common_chart_data.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb +22 -9
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text.rb +5 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/{string_reference.rb → number_string_reference.rb} +9 -7
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/{string_cache.rb → number_string_cache.rb} +11 -6
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point.rb +9 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point/text_value.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/x_y_values.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/view_3d.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis/scaling.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +7 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_point.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +6 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing/doc_properties.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +5 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +12 -8
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +26 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative/picture_dimension.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_vertical.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +8 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +2 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +7 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb +2 -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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +3 -3
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/effect_reference.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/fill_reference.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/font_reference.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/line_reference.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties/preset_text_warp.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +5 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +4 -2
- 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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb +2 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +6 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +4 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip/alpha_mod_fix.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry.rb +2 -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 +2 -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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +12 -11
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +11 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_element.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_properties.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +3 -3
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +3 -3
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +25 -9
- data/lib/ooxml_parser/common_parser/common_data/color.rb +119 -71
- data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +25 -21
- data/lib/ooxml_parser/common_parser/common_data/color/ooxml_color.rb +12 -3
- data/lib/ooxml_parser/common_parser/common_data/colors/color_alpha_channel.rb +4 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +23 -8
- data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +6 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +5 -3
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +4 -2
- data/lib/ooxml_parser/common_parser/common_data/colors/scheme_color.rb +6 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb +18 -14
- data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/content_types.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/content_types/content_type_default.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/content_types/content_type_override.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/coordinates.rb +18 -6
- data/lib/ooxml_parser/common_parser/common_data/font_style.rb +3 -2
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +4 -2
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +42 -3
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_document_object_helper.rb +107 -116
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_object_attribute_helper.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +9 -16
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/position.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_spacing.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_style.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +9 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/size.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/text.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb +5 -3
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +25 -35
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing/line_spacing.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs/tab.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/relationships.rb +24 -19
- data/lib/ooxml_parser/common_parser/common_data/relationships/relationship.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table.rb +5 -0
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +6 -8
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +10 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +10 -2
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +19 -17
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_column_band_size.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +8 -5
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_row_band_size.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +11 -11
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/grid_span.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +27 -39
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line/line_join.rb +4 -4
- data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +5 -2
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties/table_row_height.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +5 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid/grid_column.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +26 -4
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/underline.rb +6 -0
- data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_document_structure.rb +17 -0
- data/lib/ooxml_parser/common_parser/parser.rb +6 -2
- data/lib/ooxml_parser/configuration.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +100 -41
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments.rb +36 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments/comment.rb +37 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended.rb +4 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended/comment_extended.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +3 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +6 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb +2 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +11 -12
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style/document_style_helper.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +93 -82
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark_end.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark_start.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/comment_range_end.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/comment_range_start.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/accent.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties/argument_size.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +4 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_grow.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_limit_location.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb +5 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +4 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_helper.rb +11 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +30 -23
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +15 -4
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object/ole_object.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +39 -8
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_margins.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_size.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/stroke.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/field_simple.rb +41 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb +6 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +5 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/inserted.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_content.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_properties.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/structured_document_tag.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +3 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +4 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +12 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/multilevel_type.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +3 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_justification.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_text.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/numbering_format.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb +4 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +7 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/footnote_properties.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +16 -14
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +10 -8
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +5 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +14 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/paragraph_properties_default.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/run_properties_default.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_parser.rb +6 -0
- data/lib/ooxml_parser/helpers/string_helper.rb +3 -1
- data/lib/ooxml_parser/name.rb +9 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +32 -37
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/comment_authors.rb +39 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/comment_authors/comment_author.rb +38 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comments.rb +33 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comments/presentation_comment.rb +39 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_helpers.rb +3 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +12 -3
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/font_scheme.rb +36 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/font_scheme/font_collection.rb +31 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/font_scheme/font_collection/text_font.rb +22 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +14 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +11 -4
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +4 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties/stretch.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data/shape_tree.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/connection_shape.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +5 -2
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +2 -4
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_notes.rb +3 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +3 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +3 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +3 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +3 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +7 -4
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing.rb +6 -3
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/{condition.rb → codition_list/condition.rb} +3 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition_list.rb +27 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +19 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +6 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action.rb +5 -5
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb +8 -2
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties/wheel.rb +22 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/table_styles.rb +38 -0
- data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +7 -1
- data/lib/ooxml_parser/version.rb +4 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +57 -38
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +6 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache.rb +41 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_source.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_source/worksheet_source.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table.rb +46 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table/string_index.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +15 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/{worksheet/xlsx_row/xlsx_cell → style_sheet/cell_xfs}/cell_style/alignment.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/xf.rb +150 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +4 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +5 -3
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +5 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +2 -5
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb +34 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_helpers.rb +3 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +56 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +32 -29
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/author.rb +16 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/comment_list.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +10 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/ole_objects.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/page_setup.rb +105 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part.rb +8 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column.rb +12 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb +42 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column/custom_filters/custom_filter.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb +3 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/x14_table.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_columns.rb +42 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_columns/table_column.rb +34 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/worksheet_helper.rb +14 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb +12 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +3 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +3 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +60 -27
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/formula.rb +39 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_parser.rb +7 -1
- metadata +147 -29
- data/LICENSE.txt +0 -661
- data/README.md +0 -43
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/order.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_index.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point_count.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop/preset_color.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/language.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties/vertical_merge.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb +0 -30
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comment.rb +0 -28
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark.rb +0 -21
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/start.rb +0 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition/abstract_numbering_id.rb +0 -20
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb +0 -31
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment/presentation_comment_author.rb +0 -26
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style.rb +0 -128
@@ -1,33 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'border'
|
2
4
|
module OoxmlParser
|
5
|
+
# Borders data
|
3
6
|
class Borders < ParagraphBorders
|
4
7
|
attr_accessor :left, :right, :top, :bottom, :inner_vertical, :inner_horizontal, :display, :between, :bar,
|
5
8
|
:top_left_to_bottom_right, :top_right_to_bottom_left, :offset_from
|
6
9
|
|
7
|
-
def initialize(
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
@
|
14
|
-
@
|
15
|
-
@top = top
|
16
|
-
@bottom = bottom
|
17
|
-
@between = between
|
10
|
+
def initialize(parent: nil)
|
11
|
+
@left = BordersProperties.new
|
12
|
+
@right = BordersProperties.new
|
13
|
+
@top = BordersProperties.new
|
14
|
+
@bottom = BordersProperties.new
|
15
|
+
@between = BordersProperties.new
|
16
|
+
@inner_horizontal = BordersProperties.new
|
17
|
+
@inner_vertical = BordersProperties.new
|
18
18
|
@parent = parent
|
19
19
|
end
|
20
20
|
|
21
|
+
# Method to copy object
|
22
|
+
# @return [Borders] copied object
|
21
23
|
def copy
|
22
|
-
new_borders = Borders.new
|
23
|
-
new_borders.
|
24
|
-
new_borders.
|
25
|
-
new_borders.
|
26
|
-
new_borders.
|
27
|
-
new_borders.
|
24
|
+
new_borders = Borders.new
|
25
|
+
new_borders.left = @left if @left
|
26
|
+
new_borders.right = @right if @right
|
27
|
+
new_borders.top = @top if @top
|
28
|
+
new_borders.bottom = @bottom if @bottom
|
29
|
+
new_borders.inner_vertical = @inner_vertical if @inner_vertical
|
30
|
+
new_borders.inner_horizontal = @inner_horizontal if @inner_horizontal
|
31
|
+
new_borders.between = @between if @between
|
32
|
+
new_borders.display = @display if @display
|
33
|
+
new_borders.bar = @bar if @bar
|
28
34
|
new_borders
|
29
35
|
end
|
30
36
|
|
37
|
+
# Compare this object to other
|
38
|
+
# @param other [Object] any other object
|
39
|
+
# @return [True, False] result of comparision
|
31
40
|
def ==(other)
|
32
41
|
@left == other.left && @right == other.right && @top == other.top && @bottom == other.bottom if other.is_a?(Borders)
|
33
42
|
end
|
@@ -48,6 +57,7 @@ module OoxmlParser
|
|
48
57
|
yield(top)
|
49
58
|
end
|
50
59
|
|
60
|
+
# @return [String] result of convert of object to string
|
51
61
|
def to_s
|
52
62
|
"Left border: #{left}, Right: #{right}, Top: #{top}, Bottom: #{bottom}"
|
53
63
|
end
|
@@ -74,10 +84,6 @@ module OoxmlParser
|
|
74
84
|
@top = TableCellLine.new(parent: self).parse(node_child)
|
75
85
|
when 'lnB', 'bottom'
|
76
86
|
@bottom = TableCellLine.new(parent: self).parse(node_child)
|
77
|
-
when 'lnTlToBr', 'tl2br'
|
78
|
-
@top_left_to_bottom_right = TableCellLine.new(parent: self).parse(node_child)
|
79
|
-
when 'lnBlToTr', 'tr2bl'
|
80
|
-
@top_right_to_bottom_left = TableCellLine.new(parent: self).parse(node_child)
|
81
87
|
when 'insideV'
|
82
88
|
@inner_vertical = TableCellLine.new(parent: self).parse(node_child)
|
83
89
|
when 'insideH'
|
@@ -86,23 +92,5 @@ module OoxmlParser
|
|
86
92
|
end
|
87
93
|
self
|
88
94
|
end
|
89
|
-
|
90
|
-
def self.parse_from_style(style_number)
|
91
|
-
node = XLSXWorkbook.styles_node.xpath('//xmlns:border')[style_number.to_i]
|
92
|
-
cell_borders = Borders.new
|
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
|
104
|
-
end
|
105
|
-
cell_borders
|
106
|
-
end
|
107
95
|
end
|
108
96
|
end
|
@@ -1,6 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
4
|
+
# LineJoin data
|
2
5
|
class LineJoin < OOXMLDocumentObject
|
3
|
-
attr_accessor :type
|
6
|
+
attr_accessor :type
|
4
7
|
|
5
8
|
# Parse LineJoin object
|
6
9
|
# @param node [Nokogiri::XML:Element] node to parse
|
@@ -10,9 +13,6 @@ module OoxmlParser
|
|
10
13
|
case node_child.name
|
11
14
|
when 'round', 'bevel'
|
12
15
|
@type = node_child.name.to_sym
|
13
|
-
when 'miter'
|
14
|
-
@type = :miter
|
15
|
-
@limit = node_child.attribute('lim').value.to_f
|
16
16
|
end
|
17
17
|
end
|
18
18
|
self
|
@@ -1,6 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'cell/cell'
|
2
4
|
require_relative 'row/table_row_properties'
|
3
5
|
module OoxmlParser
|
6
|
+
# Class for data of TableRow
|
4
7
|
class TableRow < OOXMLDocumentObject
|
5
8
|
attr_accessor :height, :cells, :table_row_properties
|
6
9
|
|
@@ -15,7 +18,7 @@ module OoxmlParser
|
|
15
18
|
# @param node [Nokogiri::XML:Element] node to parse
|
16
19
|
# @return [TableRow] result of parsing
|
17
20
|
def parse(node)
|
18
|
-
|
21
|
+
root_object.default_font_style = FontStyle.new(true) # TODO: Add correct parsing of TableStyle.xml file and use it
|
19
22
|
node.attributes.each do |key, value|
|
20
23
|
case key
|
21
24
|
when 'h'
|
@@ -30,7 +33,7 @@ module OoxmlParser
|
|
30
33
|
@cells << TableCell.new(parent: self).parse(node_child)
|
31
34
|
end
|
32
35
|
end
|
33
|
-
|
36
|
+
root_object.default_font_style = FontStyle.new
|
34
37
|
self
|
35
38
|
end
|
36
39
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'table_grid/grid_column'
|
2
4
|
module OoxmlParser
|
3
5
|
# Class for parsing `w:tblGrid` object
|
@@ -10,6 +12,9 @@ module OoxmlParser
|
|
10
12
|
@parent = parent
|
11
13
|
end
|
12
14
|
|
15
|
+
# Compare this object to other
|
16
|
+
# @param other [Object] any other object
|
17
|
+
# @return [True, False] result of comparision
|
13
18
|
def ==(other)
|
14
19
|
@columns.each_with_index do |cur_column, index|
|
15
20
|
return false unless cur_column == other.columns[index]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
2
4
|
# Class for parsing `w:gridCol` object
|
3
5
|
class GridColumn < OOXMLDocumentObject
|
@@ -11,7 +13,7 @@ module OoxmlParser
|
|
11
13
|
node.attributes.each do |key, value|
|
12
14
|
case key
|
13
15
|
when 'w'
|
14
|
-
@width = OoxmlSize.new(value.value.to_f)
|
16
|
+
@width = OoxmlSize.new(value.value.to_f, :emu)
|
15
17
|
end
|
16
18
|
end
|
17
19
|
self
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Table Properties Data
|
2
4
|
require_relative 'properties/table_layout'
|
3
5
|
require_relative 'properties/table_look'
|
@@ -10,8 +12,10 @@ require_relative 'table_properties/table_borders'
|
|
10
12
|
module OoxmlParser
|
11
13
|
# Class for parsing `w:tblPr` tags
|
12
14
|
class TableProperties < OOXMLDocumentObject
|
13
|
-
attr_accessor :jc, :table_width, :table_borders, :table_positon, :table_cell_margin, :table_indent, :stretching, :
|
14
|
-
:column_banding_size, :table_look, :grid_column
|
15
|
+
attr_accessor :jc, :table_width, :table_borders, :table_positon, :table_cell_margin, :table_indent, :stretching, :row_banding_size,
|
16
|
+
:column_banding_size, :table_look, :grid_column
|
17
|
+
# @return [String] id of table style
|
18
|
+
attr_reader :table_style_id
|
15
19
|
# @return [TableStyleColumnBandSize] table style column band size
|
16
20
|
attr_accessor :table_style_column_band_size
|
17
21
|
# @return [TableStyleRowBandSize] table style row band size
|
@@ -26,6 +30,10 @@ module OoxmlParser
|
|
26
30
|
attr_accessor :caption
|
27
31
|
# @return [ValuedChild] description of table
|
28
32
|
attr_accessor :description
|
33
|
+
# @return [Color] fill type
|
34
|
+
attr_reader :fill
|
35
|
+
# @return [TableStyle] element of table style
|
36
|
+
attr_reader :table_style_element
|
29
37
|
|
30
38
|
alias table_properties table_positon
|
31
39
|
|
@@ -42,17 +50,20 @@ module OoxmlParser
|
|
42
50
|
node.xpath('*').each do |node_child|
|
43
51
|
case node_child.name
|
44
52
|
when 'tableStyleId'
|
45
|
-
@
|
53
|
+
@table_style_id = node_child.text
|
46
54
|
when 'tblBorders'
|
47
55
|
@table_borders = TableBorders.new(parent: self).parse(node_child)
|
48
56
|
when 'tblStyle'
|
49
|
-
|
57
|
+
# TODO: Incorrect but to keep compatibility
|
58
|
+
@table_style_element = TableStyle.new(parent: self).parse(node_child)
|
50
59
|
when 'tblW'
|
51
60
|
@table_width = OoxmlSize.new.parse(node_child)
|
52
61
|
when 'jc'
|
53
62
|
@jc = node_child.attribute('val').text.to_sym
|
54
63
|
when 'shd'
|
55
64
|
@shade = Shade.new(parent: self).parse(node_child)
|
65
|
+
when 'solidFill'
|
66
|
+
@fill = PresentationFill.new(parent: self).parse(node)
|
56
67
|
when 'tblLook'
|
57
68
|
@table_look = TableLook.new(parent: self).parse(node_child)
|
58
69
|
when 'tblInd'
|
@@ -78,5 +89,16 @@ module OoxmlParser
|
|
78
89
|
@table_look = TableLook.new(parent: self).parse(node) if @table_look.nil?
|
79
90
|
self
|
80
91
|
end
|
92
|
+
|
93
|
+
# @return [TableStyle] style of table
|
94
|
+
def style
|
95
|
+
root_object.table_styles.style_by_id(table_style_id)
|
96
|
+
end
|
97
|
+
|
98
|
+
# For compatibility reasons
|
99
|
+
# @return [DocumentStyle] table style of table
|
100
|
+
def table_style
|
101
|
+
root_object.document_style_by_id(table_style_element.value)
|
102
|
+
end
|
81
103
|
end
|
82
104
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
2
4
|
# Class for parsing `u` tags
|
3
5
|
class Underline < OOXMLDocumentObject
|
@@ -9,6 +11,9 @@ module OoxmlParser
|
|
9
11
|
@parent = parent
|
10
12
|
end
|
11
13
|
|
14
|
+
# Compare this object to other
|
15
|
+
# @param other [Object] any other object
|
16
|
+
# @return [True, False] result of comparision
|
12
17
|
def ==(other)
|
13
18
|
if other.is_a? Underline
|
14
19
|
@style.to_sym == other.style.to_sym && @color == other.color
|
@@ -19,6 +24,7 @@ module OoxmlParser
|
|
19
24
|
end
|
20
25
|
end
|
21
26
|
|
27
|
+
# @return [String] result of convert of object to string
|
22
28
|
def to_s
|
23
29
|
if @color.nil?
|
24
30
|
@style.to_s
|
@@ -1,7 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'common_data/content_types'
|
1
4
|
module OoxmlParser
|
2
5
|
# Common document structure for DOCX, XLSX, PPTX file
|
3
6
|
class CommonDocumentStructure < OOXMLDocumentObject
|
4
7
|
# @return [String] path to original file
|
5
8
|
attr_accessor :file_path
|
9
|
+
# @return [Integer] default font size
|
10
|
+
attr_reader :default_font_size
|
11
|
+
# @return [Integer] default font typeface
|
12
|
+
attr_reader :default_font_typeface
|
13
|
+
# @return [FontStyle] Default font style of presentation
|
14
|
+
attr_accessor :default_font_style
|
15
|
+
# @return [ContentTypes] data about content types
|
16
|
+
attr_accessor :content_types
|
17
|
+
|
18
|
+
def initialize(params = {})
|
19
|
+
@default_font_size = params.fetch(:default_font_size, 18)
|
20
|
+
@default_font_typeface = params.fetch(:default_font_typeface, 'Arial')
|
21
|
+
@default_font_style = FontStyle.new
|
22
|
+
end
|
6
23
|
end
|
7
24
|
end
|
@@ -1,10 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
4
|
+
# Basic class for OoxmlParser
|
2
5
|
class Parser
|
3
6
|
# Base method to yield parse document of any type
|
4
7
|
# @param path_to_file [String] file
|
5
8
|
# @return [CommonDocumentStructure] structure of doc
|
6
9
|
def self.parse_format(path_to_file)
|
7
10
|
return nil if OOXMLDocumentObject.encrypted_file?(path_to_file)
|
11
|
+
|
8
12
|
path_to_zip_file = OOXMLDocumentObject.copy_file_and_rename_to_zip(path_to_file)
|
9
13
|
OOXMLDocumentObject.path_to_folder = path_to_zip_file.sub(File.basename(path_to_zip_file), '')
|
10
14
|
OOXMLDocumentObject.unzip_file(path_to_zip_file, OOXMLDocumentObject.path_to_folder)
|
@@ -24,9 +28,9 @@ module OoxmlParser
|
|
24
28
|
when :docx
|
25
29
|
DocumentStructure.parse
|
26
30
|
when :xlsx
|
27
|
-
XLSXWorkbook.parse
|
31
|
+
XLSXWorkbook.new.parse
|
28
32
|
when :pptx
|
29
|
-
Presentation.parse
|
33
|
+
Presentation.new.parse
|
30
34
|
else
|
31
35
|
warn "#{path_to_file} is a simple zip file without OOXML content"
|
32
36
|
end
|
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# noinspection RubyInstanceMethodNamingConvention
|
2
|
-
require_relative 'document_structure/
|
4
|
+
require_relative 'document_structure/comments'
|
3
5
|
require_relative 'document_structure/comments_extended'
|
4
6
|
require_relative 'document_structure/docx_paragraph'
|
5
7
|
require_relative 'document_structure/document_background'
|
@@ -12,20 +14,23 @@ require_relative 'document_structure/page_properties/page_properties'
|
|
12
14
|
require_relative 'document_structure/document_settings'
|
13
15
|
require_relative 'document_structure/styles'
|
14
16
|
module OoxmlParser
|
17
|
+
# Basic class for DocumentStructure
|
15
18
|
class DocumentStructure < CommonDocumentStructure
|
16
19
|
include DocumentStyleHelper
|
17
20
|
include DocumentStructureHelpers
|
18
21
|
attr_accessor :elements, :page_properties, :notes, :background, :document_properties, :comments
|
19
22
|
|
20
|
-
# @return [Array, DocumentStyle] array of document styles in current document
|
21
|
-
attr_accessor :document_styles
|
22
23
|
# @return [Numbering] store numbering data
|
23
24
|
attr_accessor :numbering
|
24
25
|
# @return [Styles] styles of document
|
25
26
|
attr_accessor :styles
|
26
|
-
attr_accessor :
|
27
|
+
attr_accessor :theme
|
28
|
+
# @return [Relationships] relationships
|
29
|
+
attr_accessor :relationships
|
27
30
|
# @return [DocumentSettings] settings
|
28
31
|
attr_accessor :settings
|
32
|
+
# @return [CommentsDocument] comments of whole document
|
33
|
+
attr_accessor :comments_document
|
29
34
|
# @return [CommentsExtended] extended comments
|
30
35
|
attr_accessor :comments_extended
|
31
36
|
|
@@ -34,9 +39,14 @@ module OoxmlParser
|
|
34
39
|
@notes = []
|
35
40
|
@document_properties = DocumentProperties.new
|
36
41
|
@comments = []
|
37
|
-
|
42
|
+
super
|
38
43
|
end
|
39
44
|
|
45
|
+
alias theme_colors theme
|
46
|
+
|
47
|
+
# Compare this object to other
|
48
|
+
# @param other [Object] any other object
|
49
|
+
# @return [True, False] result of comparision
|
40
50
|
def ==(other)
|
41
51
|
@elements == other.elements &&
|
42
52
|
@page_properties == other.page_properties &&
|
@@ -46,10 +56,10 @@ module OoxmlParser
|
|
46
56
|
@comments == other.comments
|
47
57
|
end
|
48
58
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
59
|
+
# Get element by it's type
|
60
|
+
# @param location [Symbol] location of object
|
61
|
+
# @param type [Symbol] type of object
|
62
|
+
# @return [OOXMLDocumentObject]
|
53
63
|
def element_by_description(location: :canvas, type: :docx_paragraph)
|
54
64
|
case location
|
55
65
|
when :canvas
|
@@ -66,7 +76,7 @@ module OoxmlParser
|
|
66
76
|
when :footer
|
67
77
|
case type
|
68
78
|
when :table
|
69
|
-
note_by_description(:footer1).elements[
|
79
|
+
note_by_description(:footer1).elements[0].rows[0].cells[0].elements
|
70
80
|
when :docx_paragraph, :simple, :paragraph
|
71
81
|
note_by_description(:footer1).elements
|
72
82
|
when :shape
|
@@ -77,7 +87,7 @@ module OoxmlParser
|
|
77
87
|
when :header
|
78
88
|
case type
|
79
89
|
when :table
|
80
|
-
note_by_description(:header1).elements[
|
90
|
+
note_by_description(:header1).elements[0].rows[0].cells[0].elements
|
81
91
|
when :docx_paragraph, :simple, :paragraph
|
82
92
|
note_by_description(:header1).elements
|
83
93
|
when :shape
|
@@ -92,6 +102,9 @@ module OoxmlParser
|
|
92
102
|
end
|
93
103
|
end
|
94
104
|
|
105
|
+
# Get note by it's description
|
106
|
+
# @param type [Symbol] note type
|
107
|
+
# @return [Note]
|
95
108
|
def note_by_description(type)
|
96
109
|
notes.each do |note|
|
97
110
|
return note if note.type.to_sym == type
|
@@ -99,6 +112,11 @@ module OoxmlParser
|
|
99
112
|
raise 'There isn\'t this type of the note'
|
100
113
|
end
|
101
114
|
|
115
|
+
# Detect numbering type
|
116
|
+
# @param location [Symbol] location of object
|
117
|
+
# @param type [Symbol] type of object
|
118
|
+
# @param paragraph_number [Integer] number of object
|
119
|
+
# @return [Array<String,String>] type of numbering
|
102
120
|
def recognize_numbering(location: :canvas, type: :simple, paragraph_number: 0)
|
103
121
|
elements = element_by_description(location: location, type: type)
|
104
122
|
lvl_text = elements[paragraph_number].numbering.abstruct_numbering.level_list[0].text.value
|
@@ -106,6 +124,11 @@ module OoxmlParser
|
|
106
124
|
[num_format, lvl_text]
|
107
125
|
end
|
108
126
|
|
127
|
+
# Return outline type
|
128
|
+
# @param location [Symbol] location of object
|
129
|
+
# @param type [Symbol] type of object
|
130
|
+
# @param levels_count [Integer] count of levels to detect
|
131
|
+
# @return [Array<String,String>] type of outline
|
109
132
|
def outline(location: :canvas, type: :simple, levels_count: 1)
|
110
133
|
elements = element_by_description(location: location, type: type)
|
111
134
|
set = []
|
@@ -116,34 +139,27 @@ module OoxmlParser
|
|
116
139
|
set
|
117
140
|
end
|
118
141
|
|
142
|
+
# @return [Array<DocumentStyle>] style of documents
|
143
|
+
def document_styles
|
144
|
+
styles.styles
|
145
|
+
end
|
146
|
+
|
147
|
+
# Parse docx file
|
148
|
+
# @return [DocumentStructure] parsed structure
|
119
149
|
def self.parse
|
120
150
|
doc_structure = DocumentStructure.new
|
151
|
+
doc_structure.content_types = ContentTypes.new(parent: doc_structure).parse
|
121
152
|
OOXMLDocumentObject.root_subfolder = 'word/'
|
122
153
|
OOXMLDocumentObject.xmls_stack = []
|
123
154
|
@comments = []
|
124
155
|
DocumentStructure.default_paragraph_style = DocxParagraph.new
|
125
|
-
DocumentStructure.default_run_style = DocxParagraphRun.new
|
126
|
-
doc_structure.
|
127
|
-
OOXMLDocumentObject.
|
128
|
-
|
129
|
-
# TODO: Remove this old way parsing in favor of doc_structure.styles.document_defaults
|
130
|
-
doc.search('//w:docDefaults').each do |doc_defaults|
|
131
|
-
doc_defaults.xpath('w:pPrDefault').each do |p_pr_defaults|
|
132
|
-
DocumentStructure.default_paragraph_style = DocxParagraph.new.parse(p_pr_defaults, 0)
|
133
|
-
end
|
134
|
-
doc_defaults.xpath('w:rPrDefault').each do |r_pr_defaults|
|
135
|
-
r_pr_defaults.xpath('w:rPr').each do |r_pr|
|
136
|
-
DocumentStructure.default_run_style = DocxParagraphRun.new.parse_properties(r_pr)
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
140
|
-
parse_default_style
|
141
|
-
doc_structure.numbering = Numbering.new(parent: doc_structure).parse
|
142
|
-
doc_structure.document_styles = DocumentStyle.parse_list(doc_structure)
|
143
|
-
doc_structure.styles = Styles.new(parent: doc_structure).parse
|
156
|
+
DocumentStructure.default_run_style = DocxParagraphRun.new(parent: doc_structure)
|
157
|
+
doc_structure.theme = PresentationTheme.parse('word/theme/theme1.xml')
|
158
|
+
doc_structure.relationships = Relationships.new(parent: self).parse_file("#{OOXMLDocumentObject.path_to_folder}word/_rels/document.xml.rels")
|
159
|
+
doc_structure.parse_styles
|
144
160
|
number = 0
|
145
161
|
OOXMLDocumentObject.add_to_xmls_stack('word/document.xml')
|
146
|
-
doc =
|
162
|
+
doc = doc_structure.parse_xml(OOXMLDocumentObject.current_xml)
|
147
163
|
doc.search('//w:document').each do |document|
|
148
164
|
document.xpath('w:background').each do |background|
|
149
165
|
doc_structure.background = DocumentBackground.new(parent: doc_structure).parse(background)
|
@@ -165,7 +181,7 @@ module OoxmlParser
|
|
165
181
|
number += 1
|
166
182
|
doc_structure.elements << table
|
167
183
|
when 'sdt'
|
168
|
-
doc_structure.elements << StructuredDocumentTag.new(parent:
|
184
|
+
doc_structure.elements << StructuredDocumentTag.new(parent: doc_structure).parse(element)
|
169
185
|
end
|
170
186
|
end
|
171
187
|
body.xpath('w:sectPr').each do |sect_pr|
|
@@ -178,26 +194,38 @@ module OoxmlParser
|
|
178
194
|
end
|
179
195
|
OOXMLDocumentObject.xmls_stack.pop
|
180
196
|
doc_structure.document_properties = DocumentProperties.new(parent: doc_structure).parse
|
181
|
-
doc_structure.comments =
|
197
|
+
doc_structure.comments = Comments.new(parent: doc_structure).parse
|
182
198
|
doc_structure.comments_extended = CommentsExtended.new(parent: doc_structure).parse
|
199
|
+
doc_structure.comments_document = Comments.new(parent: doc_structure,
|
200
|
+
file: "#{OOXMLDocumentObject.path_to_folder}word/#{doc_structure.relationships.target_by_type('commentsDocument').first}")
|
201
|
+
.parse
|
183
202
|
doc_structure.settings = DocumentSettings.new(parent: doc_structure).parse
|
184
203
|
doc_structure
|
185
204
|
end
|
186
205
|
|
187
|
-
|
188
|
-
|
206
|
+
# Parse default style
|
207
|
+
# @return [void]
|
208
|
+
def parse_default_style
|
209
|
+
doc = parse_xml(OOXMLDocumentObject.path_to_folder + 'word/styles.xml')
|
189
210
|
doc.search('//w:style').each do |style|
|
190
211
|
next if style.attribute('default').nil?
|
191
|
-
|
212
|
+
|
213
|
+
if (style.attribute('default').value == '1' ||
|
214
|
+
style.attribute('default').value == 'on' ||
|
215
|
+
style.attribute('default').value == 'true') &&
|
216
|
+
style.attribute('type').value == 'paragraph'
|
192
217
|
style.xpath('w:pPr').each do |paragraph_pr_tag|
|
193
218
|
DocumentStructure.default_paragraph_style = DocxParagraph.new.parse_paragraph_style(paragraph_pr_tag, DocumentStructure.default_run_style)
|
194
219
|
end
|
195
220
|
style.xpath('w:rPr').each do |character_pr_tag|
|
196
|
-
DocumentStructure.default_run_style.parse_properties(character_pr_tag
|
221
|
+
DocumentStructure.default_run_style.parse_properties(character_pr_tag)
|
197
222
|
end
|
198
|
-
elsif (style.attribute('default').value == '1' ||
|
223
|
+
elsif (style.attribute('default').value == '1' ||
|
224
|
+
style.attribute('default').value == 'on' ||
|
225
|
+
style.attribute('default').value == 'true') &&
|
226
|
+
style.attribute('type').value == 'character'
|
199
227
|
style.xpath('w:rPr').each do |character_pr_tag|
|
200
|
-
DocumentStructure.default_run_style.parse_properties(character_pr_tag
|
228
|
+
DocumentStructure.default_run_style.parse_properties(character_pr_tag)
|
201
229
|
end
|
202
230
|
end
|
203
231
|
end
|
@@ -206,11 +234,42 @@ module OoxmlParser
|
|
206
234
|
DocumentStructure.default_table_run_style = DocumentStructure.default_run_style.dup
|
207
235
|
doc.search('//w:style').each do |style|
|
208
236
|
next if style.attribute('default').nil?
|
209
|
-
next unless (style.attribute('default').value == '1' ||
|
237
|
+
next unless (style.attribute('default').value == '1' ||
|
238
|
+
style.attribute('default').value == 'on' ||
|
239
|
+
style.attribute('default').value == 'true') &&
|
240
|
+
style.attribute('type').value == 'table'
|
241
|
+
|
210
242
|
style.xpath('w:rPr').each do |table_character_pr_tag|
|
211
|
-
DocumentStructure.default_table_run_style.parse_properties(table_character_pr_tag
|
243
|
+
DocumentStructure.default_table_run_style.parse_properties(table_character_pr_tag)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
# Perform parsing styles.xml
|
249
|
+
def parse_styles
|
250
|
+
file = "#{OOXMLDocumentObject.path_to_folder}/word/styles.xml"
|
251
|
+
DocumentStructure.default_paragraph_style = DocxParagraph.new(parent: self)
|
252
|
+
DocumentStructure.default_table_paragraph_style = DocxParagraph.new(parent: self)
|
253
|
+
DocumentStructure.default_run_style = DocxParagraphRun.new(parent: self)
|
254
|
+
DocumentStructure.default_table_run_style = DocxParagraphRun.new(parent: self)
|
255
|
+
|
256
|
+
return unless File.exist?(file)
|
257
|
+
|
258
|
+
doc = parse_xml(file)
|
259
|
+
# TODO: Remove this old way parsing in favor of doc_structure.styles.document_defaults
|
260
|
+
doc.search('//w:docDefaults').each do |doc_defaults|
|
261
|
+
doc_defaults.xpath('w:pPrDefault').each do |p_pr_defaults|
|
262
|
+
DocumentStructure.default_paragraph_style = DocxParagraph.new(parent: self).parse(p_pr_defaults, 0)
|
263
|
+
end
|
264
|
+
doc_defaults.xpath('w:rPrDefault').each do |r_pr_defaults|
|
265
|
+
r_pr_defaults.xpath('w:rPr').each do |r_pr|
|
266
|
+
DocumentStructure.default_run_style = DocxParagraphRun.new(parent: self).parse_properties(r_pr)
|
267
|
+
end
|
212
268
|
end
|
213
269
|
end
|
270
|
+
parse_default_style
|
271
|
+
@numbering = Numbering.new(parent: self).parse
|
272
|
+
@styles = Styles.new(parent: self).parse
|
214
273
|
end
|
215
274
|
|
216
275
|
class << self
|