ooxml_parser 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.overcommit.yml +35 -0
- data/Changelog.md +25 -0
- data/LICENSE.txt +661 -0
- data/README.md +26 -0
- data/circle.yml +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alingment.rb +56 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +123 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_point.rb +11 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2007_chart_style.rb +17 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2010_chart_style.rb +17 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +49 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +11 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +32 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_group_element.rb +10 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_grouped_drawing.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +25 -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 +16 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +37 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_gradient_color.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_single_gradient_color.rb +6 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/solid_color/docx_solid_color.rb +10 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_element.rb +10 -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 +44 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +43 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +54 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +40 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end/line_size.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_style/docx_shape_style.rb +5 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_element.rb +10 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_properties.rb +6 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/common_non_visual_properties.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_properties.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_shape_properties.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape.rb +28 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_placeholder.rb +18 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/ooxml_shift.rb +15 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/transform_effect.rb +28 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties.rb +13 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/ooxml_text_box.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +58 -0
- data/lib/ooxml_parser/common_parser/common_data/color.rb +473 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/color_alpha_channel.rb +14 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +150 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/image/fill_rectangle.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching.rb +11 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +32 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/image_properties.rb +16 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +15 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +10 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/scheme_color.rb +14 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/coordinates.rb +127 -0
- data/lib/ooxml_parser/common_parser/common_data/font_style.rb +101 -0
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +53 -0
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +87 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +48 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/strikeout.rb +16 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +79 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties/numbering_level.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties.rb +69 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering.rb +18 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +115 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +47 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_cell_margin.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +43 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +49 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +83 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_elements.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/line_join.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/table_cell_style.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +43 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +142 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb +18 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +125 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +22 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +33 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +9 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +77 -0
- data/lib/ooxml_parser/common_parser/common_data/table.rb +41 -0
- data/lib/ooxml_parser/common_parser/common_data/underline.rb +40 -0
- data/lib/ooxml_parser/common_parser/common_document_structure.rb +7 -0
- data/lib/ooxml_parser/configuration.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comment.rb +28 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +10 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +70 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/accent.rb +11 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +10 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +11 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +12 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +11 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +11 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +13 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +12 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +12 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +10 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +10 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/operator.rb +13 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +11 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +203 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/offset.rb +10 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shadow.rb +10 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_margins.rb +11 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_size.rb +10 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/stroke.rb +10 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties.rb +16 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +40 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +13 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +22 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +388 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb +46 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +87 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/bookmark.rb +10 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/paragraph_tab.rb +19 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/style_parametres.rb +35 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style.rb +56 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +324 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +37 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/image.rb +15 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +10 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +37 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +29 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +49 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +42 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +88 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/size.rb +84 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +232 -0
- data/lib/ooxml_parser/docx_parser/docx_parser.rb +16 -0
- data/lib/ooxml_parser/helpers/string_helper.rb +22 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment/presentation_comment_author.rb +25 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb +31 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +40 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +44 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +19 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +34 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +25 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +23 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/shape_properties/extents.rb +10 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/shape_properties/offset.rb +10 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/text_body/paragraph.rb +10 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/text_body/text_field.rb +18 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shapes_grouping/shapes_grouping.rb +9 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping/grouping_properties.rb +16 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +30 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +22 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +28 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +31 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +20 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition.rb +26 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing.rb +33 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +52 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +23 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/sound_action/sound/sound.rb +18 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/sound_action/sound_action.rb +18 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +43 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb +9 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +110 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb +20 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +62 -0
- data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +15 -0
- data/lib/ooxml_parser/version.rb +6 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character/excel_comment_character_properties.rb +27 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character.rb +25 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +20 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb +21 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +23 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +18 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb +24 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position/xlsx_drawing_position_parameters.rb +22 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position.rb +22 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_shape_grouping.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +49 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/alignment.rb +30 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/foreground_color.rb +25 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/ooxml_font.rb +38 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style.rb +95 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +47 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +19 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_table.rb +30 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +74 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +108 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_parser.rb +15 -0
- data/lib/ooxml_parser.rb +35 -0
- data/ooxml_parser.gemspec +30 -0
- metadata +310 -0
data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'old_docx_group_properties'
|
2
|
+
require_relative 'old_docx_group_element'
|
3
|
+
# Fallback DOCX group data
|
4
|
+
module OoxmlParser
|
5
|
+
class OldDocxGroup
|
6
|
+
attr_accessor :elements, :properties
|
7
|
+
|
8
|
+
def initialize(properties = OldDocxGroupProperties.new, elements = [])
|
9
|
+
@properties = properties
|
10
|
+
@elements = elements
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.parse(group_node)
|
14
|
+
group = OldDocxGroup.new
|
15
|
+
group_node.xpath('*').each do |group_node_child|
|
16
|
+
case group_node_child.name
|
17
|
+
when 'shape'
|
18
|
+
element = OldDocxGroupElement.new(:shape)
|
19
|
+
element.object = OldDocxShape.parse(group_node_child)
|
20
|
+
group.elements << element
|
21
|
+
when 'wrap'
|
22
|
+
group.properties.wrap = group_node_child.attribute('type').value.to_sym if group_node_child.attribute('type').value
|
23
|
+
when 'group'
|
24
|
+
element = parse(group_node_child)
|
25
|
+
group.elements << element
|
26
|
+
end
|
27
|
+
end
|
28
|
+
group
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative 'shape/old_docx_shape'
|
2
|
+
require_relative 'shape/old_docx_shape_fill'
|
3
|
+
require_relative 'group/old_docx_group'
|
4
|
+
# Fallback DOCX Picture
|
5
|
+
module OoxmlParser
|
6
|
+
class OldDocxPicture
|
7
|
+
attr_accessor :data, :type, :style_number
|
8
|
+
|
9
|
+
def self.parse(picture_node)
|
10
|
+
picture = OldDocxPicture.new
|
11
|
+
picture_node.xpath('*').each do |picture_node_child|
|
12
|
+
case picture_node_child.name
|
13
|
+
when 'shape'
|
14
|
+
picture.type = :shape
|
15
|
+
picture.data = OldDocxShape.parse(picture_node_child)
|
16
|
+
when 'group'
|
17
|
+
picture.type = :group
|
18
|
+
picture.data = OldDocxGroup.parse(picture_node_child)
|
19
|
+
when 'style'
|
20
|
+
picture.style_number = picture_node_child.attribute('val').value.to_i
|
21
|
+
end
|
22
|
+
end
|
23
|
+
picture
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative 'old_docx_shape_properties'
|
2
|
+
# Fallback DOCX shape data
|
3
|
+
module OoxmlParser
|
4
|
+
class OldDocxShape < OOXMLDocumentObject
|
5
|
+
attr_accessor :properties, :text_box, :image, :fill
|
6
|
+
|
7
|
+
def self.parse(shape_node)
|
8
|
+
shape = OldDocxShape.new
|
9
|
+
shape.properties = OldDocxShapeProperties.parse(shape_node)
|
10
|
+
shape_node.xpath('*').each do |shape_node_child|
|
11
|
+
case shape_node_child.name
|
12
|
+
when 'textbox'
|
13
|
+
shape.text_box = TextBox.parse_list(shape_node_child)
|
14
|
+
when 'imagedata'
|
15
|
+
path_to_image = OOXMLDocumentObject.copy_media_file("#{OOXMLDocumentObject.root_subfolder}/#{get_link_from_rels(shape_node_child.attribute('id').value, OOXMLDocumentObject.path_to_folder)}")
|
16
|
+
shape.image = path_to_image
|
17
|
+
when 'fill'
|
18
|
+
shape.fill = OldDocxShapeFill.parse(shape_node_child)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
shape
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Fallback DOCX shape fill properties
|
2
|
+
module OoxmlParser
|
3
|
+
class OldDocxShapeFill < OOXMLDocumentObject
|
4
|
+
attr_accessor :path_to_image, :stretching_type, :opacity, :title
|
5
|
+
|
6
|
+
def self.parse(fill_node)
|
7
|
+
fill = OldDocxShapeFill.new
|
8
|
+
fill_node.attributes.each do |key, value|
|
9
|
+
case key
|
10
|
+
when 'id'
|
11
|
+
fill.path_to_image = OOXMLDocumentObject.copy_media_file(OOXMLDocumentObject.root_subfolder + get_link_from_rels(value.value))
|
12
|
+
when 'type'
|
13
|
+
fill.stretching_type = case value.value
|
14
|
+
when 'frame'
|
15
|
+
:stretch
|
16
|
+
else
|
17
|
+
value.value.to_sym
|
18
|
+
end
|
19
|
+
when 'title'
|
20
|
+
fill.title = value.value.to_s
|
21
|
+
end
|
22
|
+
end
|
23
|
+
fill
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Fallback DOCX Shape Properties
|
2
|
+
module OoxmlParser
|
3
|
+
class OldDocxShapeProperties
|
4
|
+
attr_accessor :fill_color, :opacity, :stroke_color, :stroke_weight
|
5
|
+
|
6
|
+
def self.parse(shape_node)
|
7
|
+
properties = OldDocxShapeProperties.new
|
8
|
+
shape_node.attributes.each do |key, value|
|
9
|
+
case key
|
10
|
+
when 'fillcolor'
|
11
|
+
properties.fill_color = Color.from_int16(value.value.delete('#'))
|
12
|
+
when 'opacity'
|
13
|
+
properties.opacity = value.value.to_f
|
14
|
+
when 'strokecolor'
|
15
|
+
properties.stroke_color = Color.from_int16(value.value.delete('#'))
|
16
|
+
when 'strokeweight'
|
17
|
+
properties.stroke_weight = value.value.to_f
|
18
|
+
when ''
|
19
|
+
end
|
20
|
+
end
|
21
|
+
properties
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
class CommonNonVisualProperties
|
3
|
+
attr_accessor :name, :id, :description, :on_click_hyperlink, :hyperlink_for_hover
|
4
|
+
|
5
|
+
def initialize(id = '', name = '')
|
6
|
+
@id = id
|
7
|
+
@name = name
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.parse(common_non_visual_properties_node)
|
11
|
+
non_visual_properties = CommonNonVisualProperties.new
|
12
|
+
non_visual_properties.name = common_non_visual_properties_node.attribute('name').value
|
13
|
+
non_visual_properties.id = common_non_visual_properties_node.attribute('id').value
|
14
|
+
common_non_visual_properties_node.xpath('*').each do |cnv_props_node_child|
|
15
|
+
case cnv_props_node_child.name
|
16
|
+
when 'hlinkClick'
|
17
|
+
non_visual_properties.on_click_hyperlink = Hyperlink.parse(cnv_props_node_child)
|
18
|
+
when 'hlinkHover'
|
19
|
+
non_visual_properties.hyperlink_for_hover = HyperlinkForHover.parse(cnv_props_node_child)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
non_visual_properties
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_properties.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative 'shape_placeholder'
|
2
|
+
module OoxmlParser
|
3
|
+
class NonVisualProperties < OOXMLDocumentObject
|
4
|
+
attr_accessor :placeholder, :is_photo, :user_drawn
|
5
|
+
|
6
|
+
def self.parse(non_visual_properties_node)
|
7
|
+
non_visual_properties = NonVisualProperties.new
|
8
|
+
non_visual_properties_node.xpath('*').each do |non_visual_properties_node_child|
|
9
|
+
case non_visual_properties_node_child.name
|
10
|
+
when 'ph'
|
11
|
+
non_visual_properties.placeholder = ShapePlaceholder.parse(non_visual_properties_node_child)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
non_visual_properties.is_photo = OOXMLDocumentObject.option_enabled?(non_visual_properties_node, 'isPhoto')
|
15
|
+
non_visual_properties.user_drawn = OOXMLDocumentObject.option_enabled?(non_visual_properties_node, 'userDrawn')
|
16
|
+
non_visual_properties
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'common_non_visual_properties'
|
2
|
+
require_relative 'non_visual_properties'
|
3
|
+
module OoxmlParser
|
4
|
+
class NonVisualShapeProperties
|
5
|
+
attr_accessor :common_properties, :non_visual_properties
|
6
|
+
|
7
|
+
def self.parse(nv_shape_props_node)
|
8
|
+
non_visual_properties = NonVisualShapeProperties.new
|
9
|
+
nv_shape_props_node.xpath('*').each do |nv_props_node_child|
|
10
|
+
case nv_props_node_child.name
|
11
|
+
when 'cNvPr'
|
12
|
+
non_visual_properties.common_properties = CommonNonVisualProperties.parse(nv_props_node_child)
|
13
|
+
when 'nvPr'
|
14
|
+
non_visual_properties.non_visual_properties = NonVisualProperties.parse(nv_props_node_child)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
non_visual_properties
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_relative 'shape_properties'
|
2
|
+
require_relative 'non_visual_shape_properties'
|
3
|
+
module OoxmlParser
|
4
|
+
class PresentationShape
|
5
|
+
attr_accessor :non_visual_properties, :shape_properties, :text_body
|
6
|
+
|
7
|
+
def initialize(non_visual_properties = nil, shape_properties = nil, text_body = nil)
|
8
|
+
@non_visual_properties = non_visual_properties
|
9
|
+
@shape_properties = shape_properties
|
10
|
+
@text_body = text_body
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.parse(shape_node)
|
14
|
+
shape = PresentationShape.new
|
15
|
+
shape_node.xpath('*').each do |shape_node_child|
|
16
|
+
case shape_node_child.name
|
17
|
+
when 'nvSpPr'
|
18
|
+
shape.non_visual_properties = NonVisualShapeProperties.parse(shape_node_child)
|
19
|
+
when 'spPr'
|
20
|
+
shape.shape_properties = DocxShapeProperties.parse(shape_node_child)
|
21
|
+
when 'txBody'
|
22
|
+
shape.text_body = TextBody.parse(shape_node_child)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
shape
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
class ShapePlaceholder < OOXMLDocumentObject
|
3
|
+
attr_accessor :type, :has_custom_prompt
|
4
|
+
|
5
|
+
def self.parse(placeholder_node)
|
6
|
+
placeholder = ShapePlaceholder.new
|
7
|
+
placeholder_node.attributes.each do |key, value|
|
8
|
+
case key
|
9
|
+
when 'type'
|
10
|
+
placeholder.type = value.value.to_sym
|
11
|
+
when 'hasCustomPrompt'
|
12
|
+
placeholder.has_custom_prompt = OOXMLDocumentObject.option_enabled?(placeholder_node, 'hasCustomPrompt')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
placeholder
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
class OOXMLShift
|
3
|
+
attr_accessor :x, :y
|
4
|
+
|
5
|
+
def initialize(x = nil, y = nil)
|
6
|
+
@x = x
|
7
|
+
@y = y
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.parse(shift_node, x_name = 'x', y_name = 'y', divider = 360_000)
|
11
|
+
return if shift_node.nil? || shift_node.attribute(x_name).nil? || shift_node.attribute(y_name).nil?
|
12
|
+
OOXMLShift.new((shift_node.attribute(x_name).value.to_f / divider.to_f).round(2), (shift_node.attribute(y_name).value.to_f / divider.to_f).round(2))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_relative 'ooxml_shift'
|
2
|
+
module OoxmlParser
|
3
|
+
class TransformEffect
|
4
|
+
attr_accessor :offset, :extents, :child_offset, :child_extent
|
5
|
+
|
6
|
+
def initialize(offset = nil, extents = nil)
|
7
|
+
@offset = offset
|
8
|
+
@extents = extents
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.parse(transform_effect_node)
|
12
|
+
transform_effect = TransformEffect.new
|
13
|
+
transform_effect_node.xpath('*').each do |transform_effect_node_child|
|
14
|
+
case transform_effect_node_child.name
|
15
|
+
when 'ext'
|
16
|
+
transform_effect.extents = OOXMLShift.parse(transform_effect_node_child, 'cx', 'cy')
|
17
|
+
when 'off'
|
18
|
+
transform_effect.offset = OOXMLShift.parse(transform_effect_node_child)
|
19
|
+
when 'chOff'
|
20
|
+
transform_effect.child_offset = OOXMLShift.parse(transform_effect_node_child)
|
21
|
+
when 'chExt'
|
22
|
+
transform_effect.child_extent = OOXMLShift.parse(transform_effect_node_child, 'cx', 'cy')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
transform_effect
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require_relative 'shape_properties/transform_effect'
|
2
|
+
require_relative 'text_body/ooxml_text_box'
|
3
|
+
require_relative 'text_body/text_body'
|
4
|
+
module OoxmlParser
|
5
|
+
class PresentationShapeProperties < OOXMLDocumentObject
|
6
|
+
attr_accessor :transform, :preset, :custom, :fill, :line
|
7
|
+
|
8
|
+
def initialize(transform = TransformEffect.new, preset = nil)
|
9
|
+
@transform = transform
|
10
|
+
@preset = preset
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/ooxml_text_box.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
class OOXMLTextBox < OOXMLDocumentObject
|
3
|
+
attr_accessor :properties, :elements
|
4
|
+
|
5
|
+
def initialize(properties = nil, elements = [])
|
6
|
+
@properties = properties
|
7
|
+
@elements = elements
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.parse(text_body_node)
|
11
|
+
text_body = OOXMLTextBox.new
|
12
|
+
text_box_content_node = text_body_node.xpath('w:txbxContent').first
|
13
|
+
text_box_content_node.xpath('*').each_with_index do |text_body_node_child, index|
|
14
|
+
case text_body_node_child.name
|
15
|
+
when 'p'
|
16
|
+
text_body.elements << DocxParagraph.parse(text_body_node_child, index)
|
17
|
+
when 'tbl'
|
18
|
+
text_body.elements << Table.parse(text_body_node_child, index)
|
19
|
+
when 'bodyPr'
|
20
|
+
text_body.properties = OOXMLShapeBodyProperties.parse(text_body_node_child)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
text_body
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
class TextBody
|
3
|
+
attr_accessor :properties, :paragraphs
|
4
|
+
|
5
|
+
def initialize(properties = nil, paragraphs = [])
|
6
|
+
@properties = properties
|
7
|
+
@paragraphs = paragraphs
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.parse(text_body_node)
|
11
|
+
text_body = TextBody.new
|
12
|
+
text_body_node.xpath('*').each do |text_body_node_child|
|
13
|
+
case text_body_node_child.name
|
14
|
+
when 'p'
|
15
|
+
text_body.paragraphs << Paragraph.parse(text_body_node_child)
|
16
|
+
when 'bodyPr'
|
17
|
+
text_body.properties = OOXMLShapeBodyProperties.parse(text_body_node_child)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
text_body
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Border Properties Data
|
2
|
+
module OoxmlParser
|
3
|
+
class BordersProperties
|
4
|
+
attr_accessor :color, :space, :sz, :val, :space, :shadow, :frame, :side
|
5
|
+
|
6
|
+
def initialize(color = :auto, sz = 0, val = :none, space = 0)
|
7
|
+
@color = color
|
8
|
+
@sz = sz
|
9
|
+
@val = val
|
10
|
+
@space = space
|
11
|
+
end
|
12
|
+
|
13
|
+
def ==(other)
|
14
|
+
instance_variables.each do |current_attributes|
|
15
|
+
unless instance_variable_get(current_attributes) == other.instance_variable_get(current_attributes)
|
16
|
+
return false
|
17
|
+
end
|
18
|
+
end
|
19
|
+
true
|
20
|
+
end
|
21
|
+
|
22
|
+
def nil?
|
23
|
+
@sz == 0 && val == :none
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_s
|
27
|
+
return '' if nil?
|
28
|
+
"borders color: #{@color}, size: #{@sz}, space: #{@space}, value: #{@val}"
|
29
|
+
end
|
30
|
+
|
31
|
+
def copy
|
32
|
+
BordersProperties.new(@color, @sz, @val, @space)
|
33
|
+
end
|
34
|
+
|
35
|
+
def visible?
|
36
|
+
return false if nil?
|
37
|
+
!(val == 'none')
|
38
|
+
end
|
39
|
+
|
40
|
+
# Parse BordersProperties
|
41
|
+
# @param [Nokogiri::XML:Element] node with BordersProperties
|
42
|
+
# @return [BordersProperties] value of BordersProperties
|
43
|
+
def self.parse(node)
|
44
|
+
border_properties = BordersProperties.new
|
45
|
+
border_properties.val = node.attribute('val').value.to_sym
|
46
|
+
border_properties.sz = node.attribute('sz').value.to_f / 8.0
|
47
|
+
border_properties.space = (node.attribute('space').value.to_f / 28.34).round(3)
|
48
|
+
border_properties.color = node.attribute('color').value
|
49
|
+
unless node.attribute('shadow').nil?
|
50
|
+
border_properties.shadow = node.attribute('shadow').value
|
51
|
+
end
|
52
|
+
if border_properties.color != 'auto'
|
53
|
+
border_properties.color = Color.from_int16(border_properties.color)
|
54
|
+
end
|
55
|
+
border_properties
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|