ooxml_parser 0.4.1 → 0.5.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 +3 -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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +33 -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 +20 -7
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text.rb +5 -3
- 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 +2 -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 +11 -8
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +23 -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 +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +4 -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 +2 -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 +4 -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 -0
- 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 +5 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +3 -1
- 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 +2 -0
- 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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +22 -9
- data/lib/ooxml_parser/common_parser/common_data/color.rb +83 -67
- 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 +7 -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 +12 -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 +5 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb +14 -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 +36 -0
- data/lib/ooxml_parser/common_parser/common_data/content_types/content_type_default.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/content_types/content_type_override.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/coordinates.rb +11 -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 +19 -2
- 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 +24 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +9 -8
- 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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +3 -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 +12 -25
- 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 +3 -0
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +3 -8
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +3 -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 +9 -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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +4 -1
- 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 +7 -4
- 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 +21 -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 +2 -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 +2 -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 +72 -37
- 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 +34 -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 +8 -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 +71 -81
- 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 +26 -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 +2 -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 +17 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +11 -3
- 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 -6
- 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 +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +3 -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 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +7 -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 +6 -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 +13 -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 +4 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +12 -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 +3 -0
- data/lib/ooxml_parser/helpers/string_helper.rb +3 -1
- data/lib/ooxml_parser/name.rb +8 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +30 -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 +9 -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 +11 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +8 -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 +4 -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 +4 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +3 -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 +4 -1
- data/lib/ooxml_parser/version.rb +3 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +38 -38
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +3 -1
- 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 +13 -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 +145 -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 +2 -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 +2 -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 +51 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +28 -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 +8 -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 +4 -1
- metadata +82 -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
data/README.md
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
# ooxml_parser
|
2
|
-
|
3
|
-
_ooxml_parser_ is a Ooxml files (docx, xlsx, pptx) parser written in Ruby.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
1. Install `magic` lib, required by `ruby-filemagic`
|
8
|
-
Mac OS:
|
9
|
-
```
|
10
|
-
brew install libmagic
|
11
|
-
```
|
12
|
-
Debian-Based Linux:
|
13
|
-
```
|
14
|
-
sudo apt-get install libmagic-dev
|
15
|
-
```
|
16
|
-
Centos-Based Linux:
|
17
|
-
```
|
18
|
-
sudo yum install file-devel
|
19
|
-
```
|
20
|
-
2. Install gem by command:
|
21
|
-
```
|
22
|
-
gem install ooxml_parser
|
23
|
-
```
|
24
|
-
|
25
|
-
## Usage
|
26
|
-
|
27
|
-
Parse a docx file
|
28
|
-
|
29
|
-
require 'ooxml_parser'
|
30
|
-
docx = OoxmlParser::Parser.parse('spec/document/document_properties/page_count.docx')
|
31
|
-
p docx.document_properties.pages # 2
|
32
|
-
|
33
|
-
|
34
|
-
## Configuration
|
35
|
-
|
36
|
-
### Accuracy
|
37
|
-
|
38
|
-
Accuracy of digits in fraction part
|
39
|
-
Default is 2 digits in fraction part
|
40
|
-
|
41
|
-
OoxmlParser.configure do |config|
|
42
|
-
config.accuracy = 3
|
43
|
-
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/order.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
# Class for parsing `c:order` object
|
3
|
-
class Order < OOXMLDocumentObject
|
4
|
-
# @return [Integer] value of order
|
5
|
-
attr_accessor :value
|
6
|
-
|
7
|
-
# Parse Order
|
8
|
-
# @param [Nokogiri::XML:Node] node with Order
|
9
|
-
# @return [Order] 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_f
|
15
|
-
end
|
16
|
-
end
|
17
|
-
self
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_index.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
# Class for parsing `c:idx` object
|
3
|
-
class SeriesIndex < OOXMLDocumentObject
|
4
|
-
# @return [Integer] value of index
|
5
|
-
attr_accessor :value
|
6
|
-
|
7
|
-
# Parse SeriesIndex
|
8
|
-
# @param [Nokogiri::XML:Node] node with Index
|
9
|
-
# @return [SeriesIndex] 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_f
|
15
|
-
end
|
16
|
-
end
|
17
|
-
self
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
# Class for parsing `c:ptCount` object
|
3
|
-
class PointCount < OOXMLDocumentObject
|
4
|
-
# @return [Integer] value of point count
|
5
|
-
attr_accessor :value
|
6
|
-
|
7
|
-
# Parse PointCount
|
8
|
-
# @param [Nokogiri::XML:Node] node with PointCount
|
9
|
-
# @return [PointCount] 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_f
|
15
|
-
end
|
16
|
-
end
|
17
|
-
self
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
# Class for working with `a:prstClr` tag
|
3
|
-
class PresetColor < OOXMLDocumentObject
|
4
|
-
# @return [String] value of preset color
|
5
|
-
attr_accessor :value
|
6
|
-
|
7
|
-
# Parse PresetColor object
|
8
|
-
# @param node [Nokogiri::XML:Element] node to parse
|
9
|
-
# @return [PresetColor] 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_s
|
15
|
-
end
|
16
|
-
end
|
17
|
-
self
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/language.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
# Class for parsing `w:lang` object
|
3
|
-
class Language < OOXMLDocumentObject
|
4
|
-
# @return [String] value of language
|
5
|
-
attr_accessor :value
|
6
|
-
|
7
|
-
# Parse Language
|
8
|
-
# @param [Nokogiri::XML:Node] node with Language
|
9
|
-
# @return [Language] 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_s
|
15
|
-
end
|
16
|
-
end
|
17
|
-
self
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties/vertical_merge.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
# Class for parsing `w:vMerge` object
|
3
|
-
class VerticalMerge < OOXMLDocumentObject
|
4
|
-
# @return [String] value of vertical merge
|
5
|
-
attr_accessor :value
|
6
|
-
|
7
|
-
# Parse vMerge
|
8
|
-
# @param [Nokogiri::XML:Node] node with vMerge
|
9
|
-
# @return [vMerge] result of parsing
|
10
|
-
def parse(node)
|
11
|
-
node.attributes.each do |key, value|
|
12
|
-
case key
|
13
|
-
when 'val'
|
14
|
-
@value = value.value.to_sym
|
15
|
-
end
|
16
|
-
end
|
17
|
-
self
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
class GridSpan
|
3
|
-
attr_accessor :type, :count_of_merged_cells, :value
|
4
|
-
|
5
|
-
def initialize(type = 'horizontal', value = nil, count_of_merged_cells = 2)
|
6
|
-
@type = type
|
7
|
-
@count_of_merged_cells = count_of_merged_cells
|
8
|
-
@value = value
|
9
|
-
end
|
10
|
-
|
11
|
-
alias count_rows_in_span count_of_merged_cells
|
12
|
-
|
13
|
-
# Parse Grid Span data
|
14
|
-
# @param [Nokogiri::XML:Element] node with GridSpan data
|
15
|
-
# @return [GridSpan] value of GridSpan
|
16
|
-
def parse(node)
|
17
|
-
node.attributes.each do |key, value|
|
18
|
-
case key
|
19
|
-
when 'count_rows_in_span'
|
20
|
-
@count_of_merged_cells = value.value
|
21
|
-
when 'val'
|
22
|
-
@value = value.value.to_i
|
23
|
-
when 'type'
|
24
|
-
@type = value.value.to_sym
|
25
|
-
end
|
26
|
-
end
|
27
|
-
self
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# Comment Data
|
2
|
-
module OoxmlParser
|
3
|
-
class Comment < OOXMLDocumentObject
|
4
|
-
attr_accessor :id, :paragraphs
|
5
|
-
|
6
|
-
def initialize(id = nil, paragraphs = [])
|
7
|
-
@id = id
|
8
|
-
@paragraphs = paragraphs
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.parse_list(parent: nil)
|
12
|
-
comments = []
|
13
|
-
comments_filename = "#{OOXMLDocumentObject.path_to_folder}/#{OOXMLDocumentObject.root_subfolder}/comments.xml"
|
14
|
-
return [] unless File.exist?(comments_filename)
|
15
|
-
doc = Nokogiri::XML(File.open(comments_filename))
|
16
|
-
doc.search('//w:comments').each do |document|
|
17
|
-
document.xpath('w:comment').each do |comment_tag|
|
18
|
-
comment = Comment.new(comment_tag.attribute('id').value)
|
19
|
-
comment_tag.xpath('w:p').each_with_index do |p, index|
|
20
|
-
comment.paragraphs << DocxParagraph.new.parse(p, index, parent: parent)
|
21
|
-
end
|
22
|
-
comments << comment.dup
|
23
|
-
end
|
24
|
-
end
|
25
|
-
comments
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
# Class for parsing `w:bookmarkStart`, `w:bookmarkEnd` tags
|
3
|
-
class Bookmark < OOXMLDocumentObject
|
4
|
-
attr_accessor :id, :name
|
5
|
-
|
6
|
-
# Parse Bookmark object
|
7
|
-
# @param node [Nokogiri::XML:Element] node to parse
|
8
|
-
# @return [Bookmark] result of parsing
|
9
|
-
def parse(node)
|
10
|
-
node.attributes.each do |key, value|
|
11
|
-
case key
|
12
|
-
when 'id'
|
13
|
-
@id = value.value
|
14
|
-
when 'name'
|
15
|
-
@name = value.value
|
16
|
-
end
|
17
|
-
end
|
18
|
-
self
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
# Class for storing Start data, `start` tag
|
3
|
-
class Start < OOXMLDocumentObject
|
4
|
-
# @return [Integer] value of start
|
5
|
-
attr_accessor :value
|
6
|
-
|
7
|
-
# Parse Start
|
8
|
-
# @param [Nokogiri::XML:Node] node with Start
|
9
|
-
# @return [Start] 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_f
|
15
|
-
end
|
16
|
-
end
|
17
|
-
self
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,20 +0,0 @@
|
|
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
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require_relative 'presentation_comment/presentation_comment_author'
|
2
|
-
module OoxmlParser
|
3
|
-
class PresentationComment < OOXMLDocumentObject
|
4
|
-
attr_accessor :author, :position, :text
|
5
|
-
|
6
|
-
def initialize(author)
|
7
|
-
@author = author
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.parse(comment_node, comment_authors)
|
11
|
-
comment = PresentationComment.new(comment_authors[comment_node.attribute('authorId').value])
|
12
|
-
comment_node.xpath('*').each do |comment_node_child|
|
13
|
-
case comment_node_child.name
|
14
|
-
when 'pos'
|
15
|
-
comment.position = OOXMLCoordinates.parse(comment_node_child, x_attr: 'x', y_attr: 'y')
|
16
|
-
when 'text'
|
17
|
-
comment.text = comment_node_child.text.to_s
|
18
|
-
end
|
19
|
-
end
|
20
|
-
comment
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.parse_list
|
24
|
-
File.exist?(OOXMLDocumentObject.path_to_folder + 'ppt/comments/comment1.xml') ? doc = Nokogiri::XML(File.open(OOXMLDocumentObject.path_to_folder + '/ppt/comments/comment1.xml')) : (return [])
|
25
|
-
comment_authors = PresentationCommentAuthor.parse
|
26
|
-
comments = []
|
27
|
-
doc.xpath('p:cmLst/p:cm').each { |comment_node| comments << PresentationComment.parse(comment_node, comment_authors) }
|
28
|
-
comments
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module OoxmlParser
|
2
|
-
class PresentationCommentAuthor < OOXMLDocumentObject
|
3
|
-
attr_accessor :id, :name, :initials
|
4
|
-
|
5
|
-
def initialize(id, name, initials)
|
6
|
-
@id = id
|
7
|
-
@name = name
|
8
|
-
@initials = initials
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.parse
|
12
|
-
comment_authors = {}
|
13
|
-
begin
|
14
|
-
doc = Nokogiri::XML(File.open(OOXMLDocumentObject.path_to_folder + 'ppt/commentAuthors.xml'))
|
15
|
-
rescue StandardError
|
16
|
-
raise "Can't find commentAuthors.xml in #{OOXMLDocumentObject.path_to_folder}/ppt folder"
|
17
|
-
end
|
18
|
-
doc.xpath('p:cmAuthorLst/p:cmAuthor').each do |author_node|
|
19
|
-
comment_authors[author_node.attribute('id').value] = PresentationCommentAuthor.new(
|
20
|
-
author_node.attribute('id').value, author_node.attribute('name').value, author_node.attribute('initials').value
|
21
|
-
)
|
22
|
-
end
|
23
|
-
comment_authors
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,128 +0,0 @@
|
|
1
|
-
require_relative 'cell_style/alignment'
|
2
|
-
module OoxmlParser
|
3
|
-
# Class for parsing cell style
|
4
|
-
class CellStyle < OOXMLDocumentObject
|
5
|
-
ALL_FORMAT_VALUE = %w|0 0.00 #,##0 #,##0.00 $#,##0_);($#,##0) $#,##0_);[Red]($#,##0) $#,##0.00_);($#,##0.00)
|
6
|
-
$#,##0.00_);[Red]($#,##0.00)
|
7
|
-
0.00% 0.00%
|
8
|
-
0.00E+00
|
9
|
-
#\ ?/?
|
10
|
-
#\ ??/??
|
11
|
-
m/d/yyyy
|
12
|
-
d-mmm-yy
|
13
|
-
d-mmm
|
14
|
-
mmm-yy
|
15
|
-
h:mm AM/PM
|
16
|
-
h:mm:ss AM/PM
|
17
|
-
h:mm
|
18
|
-
h:mm:ss
|
19
|
-
m/d/yyyy h:mm
|
20
|
-
0
|
21
|
-
0
|
22
|
-
0
|
23
|
-
0
|
24
|
-
0
|
25
|
-
0
|
26
|
-
0
|
27
|
-
0
|
28
|
-
0
|
29
|
-
0
|
30
|
-
0
|
31
|
-
0
|
32
|
-
0
|
33
|
-
0
|
34
|
-
#,##0_);(#,##0)
|
35
|
-
#,##0_);[Red](#,##0)
|
36
|
-
#,##0.00_);(#,##0.00)
|
37
|
-
#,##0.00_);[Red](#,##0.00)
|
38
|
-
0
|
39
|
-
0
|
40
|
-
0
|
41
|
-
0
|
42
|
-
mm:ss
|
43
|
-
General
|
44
|
-
mm:ss.0
|
45
|
-
##0.0E+0
|
46
|
-
@|.freeze
|
47
|
-
|
48
|
-
attr_accessor :font, :borders, :fill_color, :numerical_format, :alignment
|
49
|
-
# @return [True, False] check if style should add QuotePrefix (' symbol) to start of the string
|
50
|
-
attr_accessor :quote_prefix
|
51
|
-
# @return [True, False] is font applied
|
52
|
-
attr_accessor :apply_font
|
53
|
-
# @return [True, False] is border applied
|
54
|
-
attr_accessor :apply_border
|
55
|
-
# @return [True, False] is fill applied
|
56
|
-
attr_accessor :apply_fill
|
57
|
-
# @return [True, False] is number format applied
|
58
|
-
attr_accessor :apply_number_format
|
59
|
-
# @return [True, False] is alignment applied
|
60
|
-
attr_accessor :apply_alignment
|
61
|
-
# @return [Integer] id of font
|
62
|
-
attr_accessor :font_id
|
63
|
-
# @return [Integer] id of border
|
64
|
-
attr_accessor :border_id
|
65
|
-
# @return [Integer] id of fill
|
66
|
-
attr_accessor :fill_id
|
67
|
-
# @return [Integer] id of number format
|
68
|
-
attr_accessor :number_format_id
|
69
|
-
|
70
|
-
def initialize(parent: nil)
|
71
|
-
@numerical_format = 'General'
|
72
|
-
@alignment = XlsxAlignment.new
|
73
|
-
@parent = parent
|
74
|
-
end
|
75
|
-
|
76
|
-
# Parse CellStyle object
|
77
|
-
# @param node [Nokogiri::XML:Element] node to parse
|
78
|
-
# @return [CellStyle] result of parsing
|
79
|
-
def parse(node)
|
80
|
-
style_node = XLSXWorkbook.styles_node.xpath('//xmlns:cellXfs/xmlns:xf')[node.to_i]
|
81
|
-
style_node.attributes.each do |key, value|
|
82
|
-
case key
|
83
|
-
when 'applyFont'
|
84
|
-
@apply_font = attribute_enabled?(value)
|
85
|
-
when 'applyBorder'
|
86
|
-
@apply_border = attribute_enabled?(value)
|
87
|
-
when 'applyFill'
|
88
|
-
@apply_fill = attribute_enabled?(value)
|
89
|
-
when 'applyNumberFormat'
|
90
|
-
@apply_number_format = attribute_enabled?(value)
|
91
|
-
when 'applyAlignment'
|
92
|
-
@apply_alignment = attribute_enabled?(value)
|
93
|
-
when 'fontId'
|
94
|
-
@font_id = value.value.to_i
|
95
|
-
when 'borderId'
|
96
|
-
@border_id = value.value.to_i
|
97
|
-
when 'fillId'
|
98
|
-
@fill_id = value.value.to_i
|
99
|
-
when 'numFmtId'
|
100
|
-
@number_format_id = value.value.to_i
|
101
|
-
when 'quotePrefix'
|
102
|
-
@quote_prefix = attribute_enabled?(value)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
style_node.xpath('*').each do |node_child|
|
106
|
-
case node_child.name
|
107
|
-
when 'alignment'
|
108
|
-
@alignment.parse(node_child) if @apply_alignment
|
109
|
-
end
|
110
|
-
end
|
111
|
-
calculate_values
|
112
|
-
self
|
113
|
-
end
|
114
|
-
|
115
|
-
def calculate_values
|
116
|
-
@font = root_object.style_sheet.fonts[@font_id]
|
117
|
-
@borders = Borders.parse_from_style(@border_id) if @apply_border
|
118
|
-
@fill_color = root_object.style_sheet.fills[@fill_id] if @apply_fill
|
119
|
-
return unless @apply_number_format
|
120
|
-
format = root_object.style_sheet.number_formats.format_by_id(@number_format_id)
|
121
|
-
@numerical_format = if format
|
122
|
-
format.format_code
|
123
|
-
else
|
124
|
-
CellStyle::ALL_FORMAT_VALUE[@number_format_id - 1]
|
125
|
-
end
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|