ooxml_parser 0.14.1-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +42 -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/pivot_formats.rb +33 -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/plot_area.rb +67 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/number_string_reference.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/number_string_cache.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point/text_value.rb +17 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/x_y_values.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb +52 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/view_3d.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +174 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis/scaling.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +48 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_point.rb +13 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +43 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing/doc_properties.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +46 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +63 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +44 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +46 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +116 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative/picture_dimension.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_vertical.rb +32 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +37 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +43 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +31 -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 +40 -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 +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/effect_reference.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/fill_reference.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/font_reference.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/line_reference.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +28 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +49 -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 +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +49 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +43 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +24 -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 +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +63 -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 +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill.rb +26 -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 +26 -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 +33 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +59 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +52 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_element.rb +12 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_properties.rb +8 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +28 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +32 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +73 -0
- data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +59 -0
- data/lib/ooxml_parser/common_parser/common_data/color/color_indexes.list +66 -0
- data/lib/ooxml_parser/common_parser/common_data/color/ooxml_color.rb +66 -0
- data/lib/ooxml_parser/common_parser/common_data/color.rb +308 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/color_alpha_channel.rb +17 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +67 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +41 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/scheme_color.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +27 -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/content_types.rb +45 -0
- data/lib/ooxml_parser/common_parser/common_data/coordinates.rb +155 -0
- data/lib/ooxml_parser/common_parser/common_data/font_style.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +89 -0
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_document_object_helper.rb +117 -0
- 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/ooxml_document_object.rb +144 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +109 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/position.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_spacing.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_style.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +60 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/size.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +148 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/text.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +63 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +41 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +57 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_stlye_ref.rb +27 -0
- 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/spacing.rb +100 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs/tab.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +46 -0
- data/lib/ooxml_parser/common_parser/common_data/relationships/relationship.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/relationships.rb +68 -0
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +54 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +48 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +50 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +61 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_column_band_size.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +45 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +57 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_row_band_size.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +52 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +89 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/grid_span.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +96 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line/line_join.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +43 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties/table_row_height.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +40 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid/grid_column.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +104 -0
- data/lib/ooxml_parser/common_parser/common_data/table.rb +52 -0
- data/lib/ooxml_parser/common_parser/common_data/underline.rb +50 -0
- data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_document_structure.rb +25 -0
- data/lib/ooxml_parser/common_parser/parser.rb +49 -0
- data/lib/ooxml_parser/configuration.rb +13 -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.rb +36 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended/comment_extended.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended.rb +42 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +35 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +33 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb +19 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style/document_style_helper.rb +39 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +98 -0
- 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/accent.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties/argument_size.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +35 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +24 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +28 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +13 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +45 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_grow.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_limit_location.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties.rb +28 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb +33 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +75 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_helper.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +111 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object/ole_object.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_margins.rb +14 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_size.rb +13 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/stroke.rb +13 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties.rb +19 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +77 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +16 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +29 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +147 -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 +51 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +51 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/inserted.rb +57 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_content.rb +46 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_properties.rb +30 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/structured_document_tag.rb +28 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +30 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +273 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +63 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/multilevel_type.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_justification.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_text.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/numbering_format.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +33 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +66 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +44 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +56 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +56 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/footnote_properties.rb +34 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +52 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +45 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +83 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +62 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/paragraph_properties_default.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/run_properties_default.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults.rb +28 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +290 -0
- data/lib/ooxml_parser/docx_parser/docx_parser.rb +19 -0
- data/lib/ooxml_parser/helpers/string_helper.rb +24 -0
- data/lib/ooxml_parser/name.rb +9 -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/comment_authors.rb +39 -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_comments.rb +33 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_helpers.rb +16 -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/font_scheme/font_collection.rb +31 -0
- 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/theme_color.rb +47 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +54 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties/stretch.rb +13 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties.rb +23 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +35 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data/shape_tree.rb +35 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data.rb +28 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/connection_shape.rb +7 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +50 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +27 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_notes.rb +23 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +38 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +30 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +33 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +28 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +23 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/codition_list/condition.rb +23 -0
- 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/timing/time_node/common_timing.rb +44 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +59 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +29 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +68 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +25 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action.rb +22 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +36 -0
- 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/transition/transition_properties/transition_properties.rb +30 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +85 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb +25 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/table_styles.rb +38 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +62 -0
- data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +17 -0
- data/lib/ooxml_parser/version.rb +9 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb +42 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb +43 -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/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.rb +43 -0
- 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_table_definition/column_row_items/column_row_item.rb +22 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb +34 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items/item.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_table_style_info.rb +42 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition.rb +114 -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/shared_string_table.rb +46 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/cell_style/alignment.rb +35 -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/cell_xfs.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +35 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +49 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +40 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +44 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +40 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +44 -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/style_sheet/xlsx_borders.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +50 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_helpers.rb +14 -0
- 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 +31 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +44 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/ole_objects.rb +20 -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 +23 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +27 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +41 -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/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.rb +40 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter.rb +36 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/data_validations/data_validation/data_validation_formula.rb +22 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/data_validations/data_validation.rb +88 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/data_validations.rb +47 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb +115 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/x14_table.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +32 -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_columns.rb +42 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part.rb +50 -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 +54 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb +27 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +40 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_header_footer/header_footer_child.rb +56 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_header_footer.rb +64 -0
- 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_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +84 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +152 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +165 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_parser.rb +17 -0
- data/lib/ooxml_parser.rb +40 -0
- metadata +572 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing header or footer
|
5
|
+
class HeaderFooterChild < OOXMLDocumentObject
|
6
|
+
# @return [Symbol] type of header
|
7
|
+
attr_reader :type
|
8
|
+
# @return [String] raw text of header
|
9
|
+
attr_reader :raw_string
|
10
|
+
|
11
|
+
def initialize(type: nil, raw_string: nil, parent: nil)
|
12
|
+
@type = type
|
13
|
+
@raw_string = raw_string
|
14
|
+
super(parent: parent)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Parse HeaderFooterChild data
|
18
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
19
|
+
# @return [HeaderFooterChild] result of parsing
|
20
|
+
def parse(node)
|
21
|
+
@raw_string = node.text
|
22
|
+
self
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [String] right part of header
|
26
|
+
def right
|
27
|
+
return @right if @right
|
28
|
+
|
29
|
+
right = @raw_string.match(/&R(.+)/)
|
30
|
+
return nil unless right
|
31
|
+
|
32
|
+
@right = right[1]
|
33
|
+
end
|
34
|
+
|
35
|
+
# @return [String] center part of header
|
36
|
+
def center
|
37
|
+
return @center if @center
|
38
|
+
|
39
|
+
center = @raw_string.split('&R').first.match(/&C(.+)/)
|
40
|
+
return nil unless center
|
41
|
+
|
42
|
+
@center = center[1]
|
43
|
+
end
|
44
|
+
|
45
|
+
# @return [String] left part of header
|
46
|
+
def left
|
47
|
+
return @left if @left
|
48
|
+
|
49
|
+
left = @raw_string.gsub("&R#{right}", '')
|
50
|
+
left = left.gsub("&C#{center}", '')
|
51
|
+
return nil if left == ''
|
52
|
+
|
53
|
+
left.gsub('&L', '')
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_header_footer.rb
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'xlsx_header_footer/header_footer_child'
|
4
|
+
module OoxmlParser
|
5
|
+
# Class for parsing <headerFooter> tag
|
6
|
+
class XlsxHeaderFooter < OOXMLDocumentObject
|
7
|
+
# @return [Symbol] Specifies whether to align header with margins
|
8
|
+
attr_reader :align_with_margins
|
9
|
+
# @return [Symbol] Specifies whether first header is different
|
10
|
+
attr_reader :different_first
|
11
|
+
# @return [Symbol] Specifies whether odd and even headers are different
|
12
|
+
attr_reader :different_odd_even
|
13
|
+
# @return [Symbol] Specifies whether to scale header with document
|
14
|
+
attr_reader :scale_with_document
|
15
|
+
# @return [String] odd header
|
16
|
+
attr_reader :odd_header
|
17
|
+
# @return [String] odd footer
|
18
|
+
attr_reader :odd_footer
|
19
|
+
# @return [String] even header
|
20
|
+
attr_reader :even_header
|
21
|
+
# @return [String] even footer
|
22
|
+
attr_reader :even_footer
|
23
|
+
# @return [String] first header
|
24
|
+
attr_reader :first_header
|
25
|
+
# @return [String] first footer
|
26
|
+
attr_reader :first_footer
|
27
|
+
|
28
|
+
# Parse Header Footer data
|
29
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
30
|
+
# @return [XlsxHeaderFooter] result of parsing
|
31
|
+
def parse(node)
|
32
|
+
node.attributes.each do |key, value|
|
33
|
+
case key
|
34
|
+
when 'alignWithMargins'
|
35
|
+
@align_with_margins = attribute_enabled?(value)
|
36
|
+
when 'differentFirst'
|
37
|
+
@different_first = attribute_enabled?(value)
|
38
|
+
when 'differentOddEven'
|
39
|
+
@different_odd_even = attribute_enabled?(value)
|
40
|
+
when 'scaleWithDoc'
|
41
|
+
@scale_with_document = attribute_enabled?(value)
|
42
|
+
end
|
43
|
+
|
44
|
+
node.xpath('*').each do |node_child|
|
45
|
+
case node_child.name
|
46
|
+
when 'oddHeader'
|
47
|
+
@odd_header = HeaderFooterChild.new(parent: parent, type: odd_header).parse(node_child)
|
48
|
+
when 'oddFooter'
|
49
|
+
@odd_footer = HeaderFooterChild.new(parent: parent, type: odd_footer).parse(node_child)
|
50
|
+
when 'evenHeader'
|
51
|
+
@even_header = HeaderFooterChild.new(parent: parent, type: even_header).parse(node_child)
|
52
|
+
when 'evenFooter'
|
53
|
+
@even_footer = HeaderFooterChild.new(parent: parent, type: even_footer).parse(node_child)
|
54
|
+
when 'firstHeader'
|
55
|
+
@first_header = HeaderFooterChild.new(parent: parent, type: first_header).parse(node_child)
|
56
|
+
when 'firstFooter'
|
57
|
+
@first_footer = HeaderFooterChild.new(parent: parent, type: first_footer).parse(node_child)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
self
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `formulas` <f>
|
5
|
+
class Formula < OOXMLDocumentObject
|
6
|
+
# @return [Coordinates] reference coordinates
|
7
|
+
attr_reader :reference
|
8
|
+
# @return [StringIndex] string index
|
9
|
+
attr_reader :string_index
|
10
|
+
# @return [String] type
|
11
|
+
attr_reader :type
|
12
|
+
# @return [String] value
|
13
|
+
attr_reader :value
|
14
|
+
|
15
|
+
# Parse Formula object
|
16
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
17
|
+
# @return [Formula] parsed object
|
18
|
+
def parse(node)
|
19
|
+
node.attributes.each do |key, value|
|
20
|
+
case key
|
21
|
+
when 'ref'
|
22
|
+
@reference = Coordinates.parser_coordinates_range(value.value.to_s)
|
23
|
+
when 'si'
|
24
|
+
@string_index = value.value.to_i
|
25
|
+
when 't'
|
26
|
+
@type = value.value.to_s
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
@value = node.text unless node.text.empty?
|
31
|
+
self
|
32
|
+
end
|
33
|
+
|
34
|
+
# @return [True, False] check if formula empty
|
35
|
+
def empty?
|
36
|
+
!(reference || string_index || type || value)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'xlsx_cell/formula'
|
4
|
+
module OoxmlParser
|
5
|
+
# Single Cell of XLSX
|
6
|
+
class XlsxCell < OOXMLDocumentObject
|
7
|
+
attr_accessor :formula, :character
|
8
|
+
|
9
|
+
# @return [String] text without applying any style modificators, like quote_prefix
|
10
|
+
attr_accessor :raw_text
|
11
|
+
# @return [Integer] index of style
|
12
|
+
attr_reader :style_index
|
13
|
+
# @return [String] value of cell
|
14
|
+
attr_reader :value
|
15
|
+
# @return [String] type of string
|
16
|
+
attr_reader :type
|
17
|
+
|
18
|
+
def initialize(parent: nil)
|
19
|
+
@style_index = 0 # default style is zero
|
20
|
+
@raw_text = ''
|
21
|
+
super
|
22
|
+
end
|
23
|
+
|
24
|
+
# Parse XlsxCell object
|
25
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
26
|
+
# @return [XlsxCell] result of parsing
|
27
|
+
def parse(node)
|
28
|
+
node.attributes.each do |key, value|
|
29
|
+
case key
|
30
|
+
when 's'
|
31
|
+
@style_index = value.value.to_i
|
32
|
+
when 't'
|
33
|
+
@type = value.value.to_s
|
34
|
+
end
|
35
|
+
end
|
36
|
+
node.xpath('*').each do |node_child|
|
37
|
+
case node_child.name
|
38
|
+
when 'f'
|
39
|
+
@formula = Formula.new(parent: self).parse(node_child)
|
40
|
+
when 'v'
|
41
|
+
@value = TextValue.new(parent: self).parse(node_child)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
parse_text_data
|
45
|
+
self
|
46
|
+
end
|
47
|
+
|
48
|
+
# @return [Xf] style of cell
|
49
|
+
def style
|
50
|
+
return nil unless @style_index
|
51
|
+
|
52
|
+
root_object.style_sheet.cell_xfs.xf_array[@style_index]
|
53
|
+
end
|
54
|
+
|
55
|
+
# @return [String] text with modifiers
|
56
|
+
def text
|
57
|
+
return '' unless @raw_text
|
58
|
+
return @raw_text.dup.insert(0, "'") if style.quote_prefix
|
59
|
+
|
60
|
+
@raw_text
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
# @return [Nothing] parse text data
|
66
|
+
def parse_text_data
|
67
|
+
if @type && @value
|
68
|
+
type == 's' ? get_shared_string(value.value) : @raw_text = value.value
|
69
|
+
elsif @value
|
70
|
+
@raw_text = value.value if @value
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Get shared string by it's number
|
75
|
+
# @return [Nothing]
|
76
|
+
def get_shared_string(value)
|
77
|
+
return '' if value == ''
|
78
|
+
|
79
|
+
string = root_object.shared_strings_table.string_indexes[value.to_i]
|
80
|
+
@character = string.run
|
81
|
+
@raw_text = string.text
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'xlsx_row/xlsx_cell'
|
4
|
+
module OoxmlParser
|
5
|
+
# Single Row of XLSX
|
6
|
+
class XlsxRow < OOXMLDocumentObject
|
7
|
+
attr_accessor :cells, :height, :style, :hidden
|
8
|
+
# @return [True, False] true if the row height has been manually set.
|
9
|
+
attr_accessor :custom_height
|
10
|
+
# @return [Integer] Indicates to which row in the sheet this <row> definition corresponds.
|
11
|
+
attr_accessor :index
|
12
|
+
|
13
|
+
def initialize(parent: nil)
|
14
|
+
@cells = []
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
# Parse XlsxRow object
|
19
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
20
|
+
# @return [XlsxRow] result of parsing
|
21
|
+
def parse(node)
|
22
|
+
node.attributes.each do |key, value|
|
23
|
+
case key
|
24
|
+
when 'customHeight'
|
25
|
+
@custom_height = option_enabled?(node, 'customHeight')
|
26
|
+
when 'ht'
|
27
|
+
@height = OoxmlSize.new(value.value.to_f, :point)
|
28
|
+
when 'hidden'
|
29
|
+
@hidden = option_enabled?(node, 'hidden')
|
30
|
+
when 'r'
|
31
|
+
@index = value.value.to_i
|
32
|
+
end
|
33
|
+
end
|
34
|
+
node.xpath('*').each do |node_child|
|
35
|
+
case node_child.name
|
36
|
+
when 'c'
|
37
|
+
@cells[Coordinates.parse_coordinates_from_string(node_child.attribute('r').value.to_s).column_number.to_i - 1] = XlsxCell.new(parent: self).parse(node_child)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
self
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'worksheet/excel_comments'
|
4
|
+
require_relative 'worksheet/ole_objects'
|
5
|
+
require_relative 'worksheet/page_setup'
|
6
|
+
require_relative 'worksheet/sheet_format_properties'
|
7
|
+
require_relative 'worksheet/sheet_view'
|
8
|
+
require_relative 'worksheet/table_part'
|
9
|
+
require_relative 'worksheet/worksheet_helper'
|
10
|
+
require_relative 'worksheet/xlsx_column_properties'
|
11
|
+
require_relative 'worksheet/xlsx_drawing'
|
12
|
+
require_relative 'worksheet/xlsx_row'
|
13
|
+
require_relative 'worksheet/xlsx_header_footer'
|
14
|
+
module OoxmlParser
|
15
|
+
# Properties of worksheet
|
16
|
+
class Worksheet < OOXMLDocumentObject
|
17
|
+
include WorksheetHelper
|
18
|
+
attr_accessor :name, :rows, :merge, :charts, :hyperlinks, :drawings, :comments, :columns, :sheet_format_properties,
|
19
|
+
:autofilter, :table_parts, :sheet_views
|
20
|
+
# @return [String] xml name of sheet
|
21
|
+
attr_accessor :xml_name
|
22
|
+
# @return [Relationships] array of relationships
|
23
|
+
attr_accessor :relationships
|
24
|
+
# @return [Relationships] array of ole objects
|
25
|
+
attr_accessor :ole_objects
|
26
|
+
# @return [PageMargins] page margins settings
|
27
|
+
attr_reader :page_margins
|
28
|
+
# @return [PageSetup] page setup settings
|
29
|
+
attr_reader :page_setup
|
30
|
+
# @return [ExtensionList] list of extensions
|
31
|
+
attr_accessor :extension_list
|
32
|
+
# @return [XlsxHeaderFooter] header and footer
|
33
|
+
attr_reader :header_footer
|
34
|
+
|
35
|
+
def initialize(parent: nil)
|
36
|
+
@columns = []
|
37
|
+
@name = ''
|
38
|
+
@rows = []
|
39
|
+
@merge = []
|
40
|
+
@charts = []
|
41
|
+
@hyperlinks = []
|
42
|
+
@drawings = []
|
43
|
+
@sheet_views = []
|
44
|
+
@table_parts = []
|
45
|
+
super
|
46
|
+
end
|
47
|
+
|
48
|
+
# Perform parsing of relationships
|
49
|
+
# @return [nil]
|
50
|
+
def parse_relationships
|
51
|
+
OOXMLDocumentObject.add_to_xmls_stack("#{OOXMLDocumentObject.root_subfolder}/worksheets/_rels/#{@xml_name}.rels")
|
52
|
+
@relationships = Relationships.new(parent: self).parse_file(OOXMLDocumentObject.current_xml) if File.exist?(OOXMLDocumentObject.current_xml)
|
53
|
+
OOXMLDocumentObject.xmls_stack.pop
|
54
|
+
end
|
55
|
+
|
56
|
+
# @return [True, false] if structure contain any user data
|
57
|
+
def with_data?
|
58
|
+
return true unless @rows.empty?
|
59
|
+
return true unless default_columns?
|
60
|
+
return true unless @drawings.empty?
|
61
|
+
return true unless @charts.empty?
|
62
|
+
return true unless @hyperlinks.empty?
|
63
|
+
|
64
|
+
false
|
65
|
+
end
|
66
|
+
|
67
|
+
# Parse list of drawings in file
|
68
|
+
def parse_drawing
|
69
|
+
drawing_node = parse_xml(OOXMLDocumentObject.current_xml)
|
70
|
+
drawing_node.xpath('xdr:wsDr/*').each do |drawing_node_child|
|
71
|
+
@drawings << XlsxDrawing.new(parent: self).parse(drawing_node_child)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Parse data of Worksheet
|
76
|
+
# @param path_to_xml_file [String] path to file to parse
|
77
|
+
# @return [Worksheet] parsed worksheet
|
78
|
+
def parse(path_to_xml_file)
|
79
|
+
@xml_name = File.basename path_to_xml_file
|
80
|
+
parse_relationships
|
81
|
+
OOXMLDocumentObject.add_to_xmls_stack("#{OOXMLDocumentObject.root_subfolder}/worksheets/#{File.basename(path_to_xml_file)}")
|
82
|
+
doc = parse_xml(OOXMLDocumentObject.current_xml)
|
83
|
+
sheet = doc.search('//xmlns:worksheet').first
|
84
|
+
sheet.xpath('*').each do |worksheet_node_child|
|
85
|
+
case worksheet_node_child.name
|
86
|
+
when 'sheetData'
|
87
|
+
worksheet_node_child.xpath('xmlns:row').each do |row_node|
|
88
|
+
@rows[row_node.attribute('r').value.to_i - 1] = XlsxRow.new(parent: self).parse(row_node)
|
89
|
+
@rows[row_node.attribute('r').value.to_i - 1].style = root_object.style_sheet.cell_xfs.xf_array[row_node.attribute('s').value.to_i] if row_node.attribute('s')
|
90
|
+
end
|
91
|
+
when 'sheetFormatPr'
|
92
|
+
if !worksheet_node_child.attribute('defaultColWidth').nil? && !worksheet_node_child.attribute('defaultRowHeight').nil?
|
93
|
+
@sheet_format_properties = SheetFormatProperties.new(parent: self).parse(worksheet_node_child)
|
94
|
+
end
|
95
|
+
when 'mergeCells'
|
96
|
+
worksheet_node_child.xpath('xmlns:mergeCell').each do |merge_node|
|
97
|
+
@merge << merge_node.attribute('ref').value.to_s
|
98
|
+
end
|
99
|
+
when 'drawing'
|
100
|
+
path_to_drawing = OOXMLDocumentObject.get_link_from_rels(worksheet_node_child.attribute('id').value)
|
101
|
+
unless path_to_drawing.nil?
|
102
|
+
OOXMLDocumentObject.add_to_xmls_stack(path_to_drawing)
|
103
|
+
parse_drawing
|
104
|
+
OOXMLDocumentObject.xmls_stack.pop
|
105
|
+
end
|
106
|
+
when 'hyperlinks'
|
107
|
+
worksheet_node_child.xpath('xmlns:hyperlink').each do |hyperlink_node|
|
108
|
+
@hyperlinks << Hyperlink.new(parent: self).parse(hyperlink_node).dup
|
109
|
+
end
|
110
|
+
when 'cols'
|
111
|
+
@columns = XlsxColumnProperties.parse_list(worksheet_node_child, parent: self)
|
112
|
+
when 'autoFilter'
|
113
|
+
@autofilter = Autofilter.new(parent: self).parse(worksheet_node_child)
|
114
|
+
when 'tableParts'
|
115
|
+
worksheet_node_child.xpath('*').each do |part_node|
|
116
|
+
@table_parts << TablePart.new(parent: self).parse(part_node)
|
117
|
+
end
|
118
|
+
when 'sheetViews'
|
119
|
+
worksheet_node_child.xpath('*').each do |view_child|
|
120
|
+
@sheet_views << SheetView.new(parent: self).parse(view_child)
|
121
|
+
end
|
122
|
+
when 'oleObjects'
|
123
|
+
@ole_objects = OleObjects.new(parent: self).parse(worksheet_node_child)
|
124
|
+
when 'pageMargins'
|
125
|
+
@page_margins = PageMargins.new(parent: self).parse(worksheet_node_child, :inch)
|
126
|
+
when 'pageSetup'
|
127
|
+
@page_setup = PageSetup.new(parent: self).parse(worksheet_node_child)
|
128
|
+
when 'extLst'
|
129
|
+
@extension_list = ExtensionList.new(parent: self).parse(worksheet_node_child)
|
130
|
+
when 'headerFooter'
|
131
|
+
@header_footer = XlsxHeaderFooter.new(parent: self).parse(worksheet_node_child)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
parse_comments
|
135
|
+
OOXMLDocumentObject.xmls_stack.pop
|
136
|
+
self
|
137
|
+
end
|
138
|
+
|
139
|
+
private
|
140
|
+
|
141
|
+
# Do work for parsing shared comments file
|
142
|
+
def parse_comments
|
143
|
+
return unless relationships
|
144
|
+
|
145
|
+
comments_target = relationships.target_by_type('comment')
|
146
|
+
return if comments_target.empty?
|
147
|
+
|
148
|
+
comments_file = "#{OOXMLDocumentObject.path_to_folder}/#{OOXMLDocumentObject.root_subfolder}/#{comments_target.first.gsub('..', '')}"
|
149
|
+
@comments = ExcelComments.new(parent: self).parse(comments_file)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
@@ -0,0 +1,165 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'workbook/chartsheet'
|
4
|
+
require_relative 'workbook/pivot_cache'
|
5
|
+
require_relative 'workbook/pivot_table_definition'
|
6
|
+
require_relative 'workbook/defined_name'
|
7
|
+
require_relative 'workbook/shared_string_table'
|
8
|
+
require_relative 'workbook/style_sheet'
|
9
|
+
require_relative 'workbook/worksheet'
|
10
|
+
require_relative 'workbook/workbook_helpers'
|
11
|
+
module OoxmlParser
|
12
|
+
# Class for storing XLSX Workbook
|
13
|
+
class XLSXWorkbook < CommonDocumentStructure
|
14
|
+
include WorkbookHelpers
|
15
|
+
attr_accessor :worksheets
|
16
|
+
# @return [PresentationTheme] theme of Workbook
|
17
|
+
attr_accessor :theme
|
18
|
+
# @return [Relationships] rels of book
|
19
|
+
attr_accessor :relationships
|
20
|
+
# @return [StyleSheet] styles of book
|
21
|
+
attr_accessor :style_sheet
|
22
|
+
# @return [SharedStringTable] styles of book
|
23
|
+
attr_accessor :shared_strings_table
|
24
|
+
# @return [Array<PivotCache>] list of pivot caches
|
25
|
+
attr_accessor :pivot_caches
|
26
|
+
# @return [Array<PivotTableDefintion>] list of pivot table defitions
|
27
|
+
attr_accessor :pivot_table_definitions
|
28
|
+
# @return [Array<DefinedName>] list of defined names
|
29
|
+
attr_reader :defined_names
|
30
|
+
|
31
|
+
def initialize(params = {})
|
32
|
+
@worksheets = []
|
33
|
+
@pivot_caches = []
|
34
|
+
@pivot_table_definitions = []
|
35
|
+
@defined_names = []
|
36
|
+
super
|
37
|
+
end
|
38
|
+
|
39
|
+
# Return cell by coordinates
|
40
|
+
# @param column [String, Integer] number or numeric digit of column
|
41
|
+
# @param row [Integer] row to find
|
42
|
+
# @param sheet [Integer] number of sheet
|
43
|
+
# @return [XlsxCell] result
|
44
|
+
def cell(column, row, sheet = 0)
|
45
|
+
column = Coordinates.new(row, column).column_number unless StringHelper.numeric?(column.to_s)
|
46
|
+
|
47
|
+
if StringHelper.numeric?(sheet.to_s)
|
48
|
+
row = @worksheets[sheet].rows[row.to_i - 1]
|
49
|
+
return nil if row.nil?
|
50
|
+
|
51
|
+
return row.cells[column.to_i - 1]
|
52
|
+
elsif sheet.is_a?(String)
|
53
|
+
@worksheets.each do |worksheet|
|
54
|
+
next unless worksheet.name == sheet
|
55
|
+
next unless worksheet.rows[row.to_i - 1]
|
56
|
+
|
57
|
+
return worksheet.rows[row.to_i - 1].cells[column.to_i - 1]
|
58
|
+
end
|
59
|
+
return nil
|
60
|
+
end
|
61
|
+
raise "Error. Wrong sheet value: #{sheet}"
|
62
|
+
end
|
63
|
+
|
64
|
+
# Get all values of formulas.
|
65
|
+
# @param [Fixnum] precision of formulas counting
|
66
|
+
# @return [Array, String] all formulas
|
67
|
+
def all_formula_values(precision = 14)
|
68
|
+
formulas = []
|
69
|
+
worksheets.each do |c_sheet|
|
70
|
+
next unless c_sheet
|
71
|
+
|
72
|
+
c_sheet.rows.each do |c_row|
|
73
|
+
next unless c_row
|
74
|
+
|
75
|
+
c_row.cells.each do |c_cell|
|
76
|
+
next unless c_cell
|
77
|
+
next unless c_cell.formula
|
78
|
+
next if c_cell.formula.empty?
|
79
|
+
|
80
|
+
text = c_cell.raw_text
|
81
|
+
if StringHelper.numeric?(text)
|
82
|
+
text = text.to_f.round(10).to_s[0..precision]
|
83
|
+
elsif StringHelper.complex?(text)
|
84
|
+
complex_number = Complex(text.tr(',', '.'))
|
85
|
+
real_part = complex_number.real
|
86
|
+
real_rounded = real_part.to_f.round(10).to_s[0..precision].to_f
|
87
|
+
|
88
|
+
imag_part = complex_number.imag
|
89
|
+
imag_rounded = imag_part.to_f.round(10).to_s[0..precision].to_f
|
90
|
+
complex_rounded = Complex(real_rounded, imag_rounded)
|
91
|
+
text = complex_rounded.to_s
|
92
|
+
end
|
93
|
+
formulas << text
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
formulas
|
98
|
+
end
|
99
|
+
|
100
|
+
# Do work for parsing shared strings file
|
101
|
+
def parse_shared_strings
|
102
|
+
shared_strings_target = relationships.target_by_type('sharedString')
|
103
|
+
return if shared_strings_target.empty?
|
104
|
+
|
105
|
+
shared_string_file = "#{OOXMLDocumentObject.path_to_folder}/xl/#{shared_strings_target.first}"
|
106
|
+
@shared_strings_table = SharedStringTable.new(parent: self).parse(shared_string_file)
|
107
|
+
end
|
108
|
+
|
109
|
+
# Parse content of Workbook
|
110
|
+
# @return [XLSXWorkbook]
|
111
|
+
def parse
|
112
|
+
@content_types = ContentTypes.new(parent: self).parse
|
113
|
+
@relationships = Relationships.new(parent: self).parse_file("#{OOXMLDocumentObject.path_to_folder}xl/_rels/workbook.xml.rels")
|
114
|
+
parse_shared_strings
|
115
|
+
OOXMLDocumentObject.xmls_stack = []
|
116
|
+
OOXMLDocumentObject.root_subfolder = 'xl/'
|
117
|
+
OOXMLDocumentObject.add_to_xmls_stack('xl/workbook.xml')
|
118
|
+
@doc = Nokogiri::XML.parse(File.open(OOXMLDocumentObject.current_xml))
|
119
|
+
@theme = PresentationTheme.parse("xl/#{link_to_theme_xml}") if link_to_theme_xml
|
120
|
+
@style_sheet = StyleSheet.new(parent: self).parse
|
121
|
+
@doc.xpath('xmlns:workbook/xmlns:sheets/xmlns:sheet').each do |sheet|
|
122
|
+
file = @relationships.target_by_id(sheet.attribute('id').value)
|
123
|
+
if file.start_with?('worksheets')
|
124
|
+
@worksheets << Worksheet.new(parent: self).parse(file)
|
125
|
+
@worksheets.last.name = sheet.attribute('name').value
|
126
|
+
elsif file.start_with?('chartsheets')
|
127
|
+
@worksheets << Chartsheet.new(parent: self).parse(file)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
parse_pivot_cache
|
131
|
+
parse_pivot_table
|
132
|
+
parse_defined_names
|
133
|
+
OOXMLDocumentObject.xmls_stack.pop
|
134
|
+
self
|
135
|
+
end
|
136
|
+
|
137
|
+
private
|
138
|
+
|
139
|
+
def link_to_theme_xml
|
140
|
+
relationships.target_by_type('theme').first
|
141
|
+
end
|
142
|
+
|
143
|
+
# Perform parsing of pivot cache
|
144
|
+
def parse_pivot_cache
|
145
|
+
@doc.xpath('xmlns:workbook/xmlns:pivotCaches/xmlns:pivotCache').each do |pivot_cache|
|
146
|
+
@pivot_caches << PivotCache.new(parent: self).parse(pivot_cache)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# Perform parsing of pivot table
|
151
|
+
def parse_pivot_table
|
152
|
+
files = @content_types.by_type('application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml')
|
153
|
+
files.each do |file|
|
154
|
+
@pivot_table_definitions << PivotTableDefinition.new(parent: self).parse(file.part_name)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
# Perform parsing of defined names
|
159
|
+
def parse_defined_names
|
160
|
+
@doc.xpath('xmlns:workbook/xmlns:definedNames/xmlns:definedName').each do |defined_name|
|
161
|
+
@defined_names << DefinedName.new(parent: self).parse(defined_name)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|