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,7 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
2
4
|
# Single Comment of XLSX
|
3
5
|
class ExcelComment < OOXMLDocumentObject
|
4
6
|
attr_accessor :characters
|
7
|
+
# @return [String] text of comment
|
8
|
+
attr_reader :text
|
5
9
|
|
6
10
|
def initialize(parent: nil)
|
7
11
|
@characters = []
|
@@ -15,6 +19,12 @@ module OoxmlParser
|
|
15
19
|
node.xpath('xmlns:text/xmlns:r').each do |node_child|
|
16
20
|
@characters << ParagraphRun.new(parent: self).parse(node_child)
|
17
21
|
end
|
22
|
+
node.xpath('xmlns:text/*').each do |node_child|
|
23
|
+
case node_child.name
|
24
|
+
when 't'
|
25
|
+
@text = Text.new(parent: self).parse(node_child)
|
26
|
+
end
|
27
|
+
end
|
18
28
|
self
|
19
29
|
end
|
20
30
|
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `pageSetup` tag
|
5
|
+
class PageSetup < OOXMLDocumentObject
|
6
|
+
# @return [Integer] id of paper size
|
7
|
+
attr_reader :paper_size
|
8
|
+
# @return [Symbol] orientation of page
|
9
|
+
attr_reader :orientation
|
10
|
+
|
11
|
+
# Parse PageSetup object
|
12
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
13
|
+
# @return [PageSetup] result of parsing
|
14
|
+
def parse(node)
|
15
|
+
node.attributes.each do |key, value|
|
16
|
+
case key
|
17
|
+
when 'paperSize'
|
18
|
+
@paper_size = value.value.to_i
|
19
|
+
when 'orientation'
|
20
|
+
@orientation = value_to_symbol(value)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
self
|
24
|
+
end
|
25
|
+
|
26
|
+
# @return [String] name of paper size
|
27
|
+
def paper_size_name
|
28
|
+
paper_size_names_list[@paper_size]
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
# @return [Array <String>] list of paper size names
|
34
|
+
# https://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.pagesetup.aspx
|
35
|
+
def paper_size_names_list
|
36
|
+
['Default',
|
37
|
+
'US Letter',
|
38
|
+
'US Letter small',
|
39
|
+
'Tabloid',
|
40
|
+
'Ledger',
|
41
|
+
'US Legal',
|
42
|
+
'Statement',
|
43
|
+
'Executive',
|
44
|
+
'A3',
|
45
|
+
'A4',
|
46
|
+
'A4 small',
|
47
|
+
'A5',
|
48
|
+
'B4',
|
49
|
+
'B5',
|
50
|
+
'Folio',
|
51
|
+
'Quarto',
|
52
|
+
'Standard',
|
53
|
+
'Standard',
|
54
|
+
'Note',
|
55
|
+
'Envelope #9',
|
56
|
+
'Envelope #10',
|
57
|
+
'Envelope #11',
|
58
|
+
'Envelope #12',
|
59
|
+
'Envelope #14',
|
60
|
+
'C paper',
|
61
|
+
'D paper',
|
62
|
+
'E paper',
|
63
|
+
'Envelope DL',
|
64
|
+
'Envelope C5',
|
65
|
+
'Envelope C3',
|
66
|
+
'Envelope C4',
|
67
|
+
'Envelope C6',
|
68
|
+
'Envelope C65',
|
69
|
+
'Envelope B4',
|
70
|
+
'Envelope B5',
|
71
|
+
'Envelope B6',
|
72
|
+
'Italy envelope',
|
73
|
+
'Monarch envelope',
|
74
|
+
'6 3/4 envelope',
|
75
|
+
'US standard fanfold',
|
76
|
+
'German standard fanfold',
|
77
|
+
'German legal fanfold',
|
78
|
+
'B4',
|
79
|
+
'Japanese double postcard ',
|
80
|
+
'Standard',
|
81
|
+
'Standard',
|
82
|
+
'Standard',
|
83
|
+
'Invite envelope',
|
84
|
+
'Letter oversize',
|
85
|
+
'Legal oversize',
|
86
|
+
'Tabloid oversize',
|
87
|
+
'A4 oversize',
|
88
|
+
'Letter transverse paper',
|
89
|
+
'A4 transverse paper',
|
90
|
+
'Letter extra transverse paper',
|
91
|
+
'SuperA/SuperA/A4 paper',
|
92
|
+
'SuperB/SuperB/A3 paper',
|
93
|
+
'Letter plus paper',
|
94
|
+
'A4 plus paper',
|
95
|
+
'A5 transverse paper',
|
96
|
+
'JIS B5 transverse paper',
|
97
|
+
'A3 oversize',
|
98
|
+
'A5 oversize ',
|
99
|
+
'B5 oversize',
|
100
|
+
'A2 paper',
|
101
|
+
'A3 transverse paper',
|
102
|
+
'A3 extra transverse paper']
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -1,12 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'table_part/autofilter'
|
2
4
|
require_relative 'table_part/extension_list'
|
3
5
|
require_relative 'table_part/table_style_info'
|
6
|
+
require_relative 'table_part/table_columns'
|
4
7
|
module OoxmlParser
|
5
8
|
# Class for `tablePart` data
|
6
9
|
class TablePart < OOXMLDocumentObject
|
7
10
|
attr_accessor :name, :display_name, :reference, :autofilter, :columns
|
8
11
|
# @return [ExtensionList] list of extensions
|
9
12
|
attr_accessor :extension_list
|
13
|
+
# @return [TableColumns] list of table columns
|
14
|
+
attr_reader :table_columns
|
10
15
|
# @return [TableStyleInfo] describe style of table
|
11
16
|
attr_accessor :table_style_info
|
12
17
|
|
@@ -15,7 +20,7 @@ module OoxmlParser
|
|
15
20
|
# @return [TablePart] result of parsing
|
16
21
|
def parse(node)
|
17
22
|
link_to_table_part_xml = OOXMLDocumentObject.get_link_from_rels(node.attribute('id').value)
|
18
|
-
doc =
|
23
|
+
doc = parse_xml(OOXMLDocumentObject.path_to_folder + link_to_table_part_xml.gsub('..', 'xl'))
|
19
24
|
table_node = doc.xpath('xmlns:table').first
|
20
25
|
table_node.attributes.each do |key, value|
|
21
26
|
case key
|
@@ -33,6 +38,8 @@ module OoxmlParser
|
|
33
38
|
@autofilter = Autofilter.new(parent: self).parse(node_child)
|
34
39
|
when 'extLst'
|
35
40
|
@extension_list = ExtensionList.new(parent: self).parse(node_child)
|
41
|
+
when 'tableColumns'
|
42
|
+
@table_columns = TableColumns.new(parent: self).parse(node_child)
|
36
43
|
when 'tableStyleInfo'
|
37
44
|
@table_style_info = TableStyleInfo.new(parent: self).parse(node_child)
|
38
45
|
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'filter_column/custom_filters'
|
1
4
|
module OoxmlParser
|
2
5
|
# Class for `filterColumn` data
|
3
6
|
# The filterColumn collection identifies a particular
|
@@ -6,6 +9,8 @@ module OoxmlParser
|
|
6
9
|
class FilterColumn < OOXMLDocumentObject
|
7
10
|
# @return [True, False] Flag indicating whether the filter button is visible.
|
8
11
|
attr_accessor :show_button
|
12
|
+
# @return [CustomFilters] list of filters
|
13
|
+
attr_reader :custom_filters
|
9
14
|
|
10
15
|
def initialize(parent: nil)
|
11
16
|
@show_button = true
|
@@ -22,6 +27,13 @@ module OoxmlParser
|
|
22
27
|
@show_button = attribute_enabled?(value)
|
23
28
|
end
|
24
29
|
end
|
30
|
+
|
31
|
+
node.xpath('*').each do |node_child|
|
32
|
+
case node_child.name
|
33
|
+
when 'customFilters'
|
34
|
+
@custom_filters = CustomFilters.new(parent: self).parse(node_child)
|
35
|
+
end
|
36
|
+
end
|
25
37
|
self
|
26
38
|
end
|
27
39
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'custom_filters/custom_filter'
|
4
|
+
module OoxmlParser
|
5
|
+
# Class for `CustomFilters` data
|
6
|
+
class CustomFilters < OOXMLDocumentObject
|
7
|
+
# @return [Integer] and value
|
8
|
+
attr_reader :and
|
9
|
+
# @return [Array<CustomFilter>] list of filters array
|
10
|
+
attr_reader :filters_array
|
11
|
+
|
12
|
+
def initialize(parent: nil)
|
13
|
+
@filters_array = []
|
14
|
+
@parent = parent
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [Array, CustomFilter] accessor
|
18
|
+
def [](key)
|
19
|
+
@filters_array[key]
|
20
|
+
end
|
21
|
+
|
22
|
+
# Parse CustomFilters data
|
23
|
+
# @param [Nokogiri::XML:Element] node with CustomFilters data
|
24
|
+
# @return [CustomFilters] value of CustomFilters data
|
25
|
+
def parse(node)
|
26
|
+
node.attributes.each do |key, value|
|
27
|
+
case key
|
28
|
+
when 'and'
|
29
|
+
@and = value.value.to_i
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
node.xpath('*').each do |node_child|
|
34
|
+
case node_child.name
|
35
|
+
when 'customFilter'
|
36
|
+
@filters_array << CustomFilter.new(parent: self).parse(node_child)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
self
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for `CustomFilter` data
|
5
|
+
class CustomFilter < OOXMLDocumentObject
|
6
|
+
# @return [Symbol] operator for filter
|
7
|
+
attr_reader :operator
|
8
|
+
# @return [Integer] value of filter
|
9
|
+
attr_reader :value
|
10
|
+
|
11
|
+
# Parse CustomFilter data
|
12
|
+
# @param [Nokogiri::XML:Element] node with CustomFilter data
|
13
|
+
# @return [CustomFilter] value of CustomFilter data
|
14
|
+
def parse(node)
|
15
|
+
node.attributes.each do |key, value|
|
16
|
+
case key
|
17
|
+
when 'operator'
|
18
|
+
@operator = value_to_symbol(value)
|
19
|
+
when 'val'
|
20
|
+
@value = value.value.to_i
|
21
|
+
end
|
22
|
+
end
|
23
|
+
self
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'sparkline_groups/sparkline_group'
|
2
4
|
module OoxmlParser
|
3
5
|
# Class for `sparklineGroups` data
|
@@ -10,7 +12,7 @@ module OoxmlParser
|
|
10
12
|
@parent = parent
|
11
13
|
end
|
12
14
|
|
13
|
-
# @return [
|
15
|
+
# @return [SparklineGroup] accessor
|
14
16
|
def [](key)
|
15
17
|
sparklines_groups[key]
|
16
18
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'table_columns/table_column'
|
4
|
+
module OoxmlParser
|
5
|
+
# Class for `tableColumns` tag data
|
6
|
+
class TableColumns < OOXMLDocumentObject
|
7
|
+
# @return [Integer] count of columns
|
8
|
+
attr_reader :count
|
9
|
+
# @return [Array<TableColumn>] array of columns
|
10
|
+
attr_reader :table_column_array
|
11
|
+
|
12
|
+
def initialize(parent: nil)
|
13
|
+
@table_column_array = []
|
14
|
+
@parent = parent
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [Array, TableColumn] accessor
|
18
|
+
def [](key)
|
19
|
+
@table_column_array[key]
|
20
|
+
end
|
21
|
+
|
22
|
+
# Parse Table Columns data
|
23
|
+
# @param [Nokogiri::XML:Element] node with TableColumns data
|
24
|
+
# @return [TableColumns] value of TableColumns data
|
25
|
+
def parse(node)
|
26
|
+
node.attributes.each do |key, value|
|
27
|
+
case key
|
28
|
+
when 'count'
|
29
|
+
@count = value.value.to_i
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
node.xpath('*').each do |node_child|
|
34
|
+
case node_child.name
|
35
|
+
when 'tableColumn'
|
36
|
+
@table_column_array << TableColumn.new(parent: self).parse(node_child)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
self
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for `tableColumn` tag data
|
5
|
+
class TableColumn < OOXMLDocumentObject
|
6
|
+
# @return [Integer] id of table column
|
7
|
+
attr_reader :id
|
8
|
+
# @return [String] name
|
9
|
+
attr_reader :name
|
10
|
+
# @return [String] total row label
|
11
|
+
attr_reader :totals_row_label
|
12
|
+
# @return [String] total row function
|
13
|
+
attr_reader :totals_row_function
|
14
|
+
|
15
|
+
# Parse Table Column data
|
16
|
+
# @param [Nokogiri::XML:Element] node with TableColumn data
|
17
|
+
# @return [TableColumn] value of TableColumn data
|
18
|
+
def parse(node)
|
19
|
+
node.attributes.each do |key, value|
|
20
|
+
case key
|
21
|
+
when 'id'
|
22
|
+
@id = value.value.to_i
|
23
|
+
when 'name'
|
24
|
+
@name = value.value.to_s
|
25
|
+
when 'totalsRowLabel'
|
26
|
+
@totals_row_label = value.value.to_s
|
27
|
+
when 'totalsRowFunction'
|
28
|
+
@totals_row_function = value.value.to_s
|
29
|
+
end
|
30
|
+
end
|
31
|
+
self
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Module with helper methods for worksheet
|
5
|
+
module WorksheetHelper
|
6
|
+
# @return [True, False] is columns are with default rules
|
7
|
+
def default_columns?
|
8
|
+
return true if @columns.empty?
|
9
|
+
return true unless @columns.first.custom_width
|
10
|
+
|
11
|
+
false
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
2
4
|
# Properties of XLSX column
|
3
5
|
class XlsxColumnProperties < OOXMLDocumentObject
|
@@ -7,6 +9,9 @@ module OoxmlParser
|
|
7
9
|
# @return [True, False] Flag indicating if the
|
8
10
|
# specified column(s) is set to 'best fit'
|
9
11
|
attr_accessor :best_fit
|
12
|
+
# @return [True, False] Flag indicating if the
|
13
|
+
# specified column(s) is hidden
|
14
|
+
attr_reader :hidden
|
10
15
|
|
11
16
|
# Parse XlsxColumnProperties object
|
12
17
|
# @param node [Nokogiri::XML:Element] node to parse
|
@@ -19,18 +24,24 @@ module OoxmlParser
|
|
19
24
|
when 'max'
|
20
25
|
@to = value.value.to_i
|
21
26
|
when 'style'
|
22
|
-
@style =
|
27
|
+
@style = root_object.style_sheet.cell_xfs.xf_array[value.value.to_i]
|
23
28
|
when 'width'
|
24
29
|
@width = value.value.to_f - 0.7109375
|
25
30
|
when 'customWidth'
|
26
31
|
@custom_width = option_enabled?(node, 'customWidth')
|
27
32
|
when 'bestFit'
|
28
33
|
@best_fit = attribute_enabled?(value)
|
34
|
+
when 'hidden'
|
35
|
+
@hidden = attribute_enabled?(value)
|
29
36
|
end
|
30
37
|
end
|
31
38
|
self
|
32
39
|
end
|
33
40
|
|
41
|
+
# Parse list of XlsxColumnProperties
|
42
|
+
# @param columns_width_node [Nokogiri::XML:Element] node to parse
|
43
|
+
# @param parent [OOXMLDocumentObject] parent of result objects
|
44
|
+
# @return [Array<XlsxColumnProperties>] list of XlsxColumnProperties
|
34
45
|
def self.parse_list(columns_width_node, parent: nil)
|
35
46
|
columns = []
|
36
47
|
columns_width_node.xpath('xmlns:col').each do |col_node|
|