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
@@ -0,0 +1,77 @@
|
|
1
|
+
# Table Properties Data
|
2
|
+
require_relative 'properties/table_cell_margin'
|
3
|
+
require_relative 'properties/table_look'
|
4
|
+
require_relative 'properties/table_style'
|
5
|
+
require_relative 'properties/table_position'
|
6
|
+
module OoxmlParser
|
7
|
+
class TableProperties < OOXMLDocumentObject
|
8
|
+
attr_accessor :jc, :table_width, :shd, :table_borders, :table_properties, :table_positon, :table_cell_margin, :table_indent, :stretching, :table_style, :row_banding_size,
|
9
|
+
:column_banding_size, :table_look, :grid_column, :right_to_left, :style
|
10
|
+
|
11
|
+
alias table_properties table_positon
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
@table_indent = nil
|
15
|
+
@table_cell_margin = nil
|
16
|
+
@jc = :left
|
17
|
+
@shd = nil
|
18
|
+
@stretching = true
|
19
|
+
@table_borders = Borders.new
|
20
|
+
@table_properties = nil
|
21
|
+
@table_width = nil
|
22
|
+
@grid_column = nil
|
23
|
+
@right_to_left = nil
|
24
|
+
@style = nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def copy
|
28
|
+
table = TableProperties.new
|
29
|
+
table.jc = @jc
|
30
|
+
table.table_width = @table_width
|
31
|
+
table.shd = @shd
|
32
|
+
table.stretching = @stretching
|
33
|
+
table.table_borders = @table_borders.copy
|
34
|
+
table.table_properties = @table_properties
|
35
|
+
table.table_cell_margin = @table_cell_margin
|
36
|
+
table.table_indent = @table_indent
|
37
|
+
table.grid_column = @grid_column
|
38
|
+
table.right_to_left = @right_to_left
|
39
|
+
table.style = style
|
40
|
+
table
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.parse(table_properties_node)
|
44
|
+
table_properties = TableProperties.new
|
45
|
+
table_properties_node.xpath('*').each do |table_props_node_child|
|
46
|
+
case table_props_node_child.name
|
47
|
+
when 'tableStyleId'
|
48
|
+
table_properties.style = TableStyle.parse(style_id: table_props_node_child.text)
|
49
|
+
when 'tblStyle'
|
50
|
+
style = DocxParagraphRun.get_style_by_id(table_props_node_child.attribute('val').value)
|
51
|
+
next if style.nil?
|
52
|
+
table_properties.table_style = TableStyle.parse(table_style_node: style)
|
53
|
+
when 'tblW'
|
54
|
+
table_properties.table_width = table_props_node_child.attribute('w').text.to_f / 567.0
|
55
|
+
when 'jc'
|
56
|
+
table_properties.jc = table_props_node_child.attribute('val').text.to_sym
|
57
|
+
when 'shd'
|
58
|
+
unless table_props_node_child.attribute('fill').nil?
|
59
|
+
background_color = Color.from_int16(table_props_node_child.attribute('fill').value)
|
60
|
+
table_properties.shd = background_color
|
61
|
+
end
|
62
|
+
when 'tblLook'
|
63
|
+
table_properties.table_look = TableLook.parse(table_props_node_child)
|
64
|
+
when 'tblInd'
|
65
|
+
table_properties.table_indent = table_props_node_child.attribute('w').text.to_f / 567.0
|
66
|
+
when 'tblpPr'
|
67
|
+
table_properties.table_positon = TablePosition.parse(table_props_node_child)
|
68
|
+
when 'tblCellMar'
|
69
|
+
table_properties.table_cell_margin = TableMargins.parse(table_props_node_child)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
table_properties.table_look = TableLook.parse(table_properties_node) if table_properties.table_look.nil?
|
73
|
+
table_properties.right_to_left = OOXMLDocumentObject.option_enabled?(table_properties_node, 'rtl')
|
74
|
+
table_properties
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require_relative 'table/row/row'
|
2
|
+
require_relative 'table/table_properties'
|
3
|
+
require_relative 'table/table_grid'
|
4
|
+
require_relative 'table/margins/table_margins'
|
5
|
+
require_relative 'table/margins/paragraph_margins'
|
6
|
+
module OoxmlParser
|
7
|
+
class Table
|
8
|
+
attr_accessor :grid, :rows, :properties, :number
|
9
|
+
|
10
|
+
def initialize(rows = [])
|
11
|
+
@rows = rows
|
12
|
+
end
|
13
|
+
|
14
|
+
alias table_properties properties
|
15
|
+
|
16
|
+
def self.parse(table_node, number = 0, default_table_properties = TableProperties.new, default_paragraph = DocxParagraph.new, default_run = DocxParagraphRun.new)
|
17
|
+
table_properties = default_table_properties.copy
|
18
|
+
table_properties.jc = :left
|
19
|
+
table_paragraph = default_paragraph.copy
|
20
|
+
table_character = default_run.copy
|
21
|
+
table = Table.new
|
22
|
+
table_node.xpath('*').each do |table_node_child|
|
23
|
+
case table_node_child.name
|
24
|
+
when 'tblGrid'
|
25
|
+
table.grid = TableGrid.new
|
26
|
+
table_node_child.xpath('gridCol').each do |grid_col_node|
|
27
|
+
table.grid.columns << (grid_col_node.attribute('w').value.to_f / 360_000.0).round(2)
|
28
|
+
end
|
29
|
+
when 'tr'
|
30
|
+
table.rows << TableRow.parse(table_node_child)
|
31
|
+
when 'tblPr'
|
32
|
+
table.properties = TableProperties.parse(table_node_child)
|
33
|
+
when ''
|
34
|
+
DocxParagraph.parse_paragraph_style(table_node_child, table_paragraph, table_character)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
table.number = number
|
38
|
+
table
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Class for working Underline style parameter
|
2
|
+
module OoxmlParser
|
3
|
+
class Underline
|
4
|
+
attr_accessor :style, :color
|
5
|
+
|
6
|
+
def initialize(style = :none, color = nil)
|
7
|
+
@style = (style == 'single') ? :single : style
|
8
|
+
@color = color
|
9
|
+
end
|
10
|
+
|
11
|
+
def ==(other)
|
12
|
+
if other.is_a? Underline
|
13
|
+
@style.to_sym == other.style.to_sym && @color == other.color
|
14
|
+
elsif other.is_a? Symbol
|
15
|
+
@style.to_sym == other
|
16
|
+
else
|
17
|
+
false
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_s
|
22
|
+
if @color.nil?
|
23
|
+
@style.to_s
|
24
|
+
else
|
25
|
+
"#{@style} #{@color}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.parse(attribute_value)
|
30
|
+
underline = Underline.new
|
31
|
+
case attribute_value
|
32
|
+
when 'sng'
|
33
|
+
underline.style = :single
|
34
|
+
when 'none'
|
35
|
+
underline.style = :none
|
36
|
+
end
|
37
|
+
underline
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
class Configuration
|
3
|
+
attr_accessor :units
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@units = :centimeters
|
7
|
+
end
|
8
|
+
|
9
|
+
# @return [Float] by which divide units values
|
10
|
+
def units_delimiter
|
11
|
+
return (20 * 635.0) if @units == :points
|
12
|
+
return (566.929 * 635.0) if @units == :centimeters
|
13
|
+
return 1 if @units == :dxa
|
14
|
+
return 1440 if @units == :inches
|
15
|
+
return (1.0 / 635.0) if @units == :emu
|
16
|
+
warn "Cannot recognize #{@units} unit. Will use dxa by default"
|
17
|
+
1
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Comment Data
|
2
|
+
module OoxmlParser
|
3
|
+
class Comment < OOXMLDocumentObject
|
4
|
+
attr_accessor :id, :paragraphs
|
5
|
+
|
6
|
+
def initialize(id = nil, paragraphs = [])
|
7
|
+
@id = id
|
8
|
+
@paragraphs = paragraphs
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.parse_list
|
12
|
+
comments = []
|
13
|
+
comments_filename = "#{OOXMLDocumentObject.path_to_folder}/#{OOXMLDocumentObject.root_subfolder}/comments.xml"
|
14
|
+
return [] unless File.exist?(comments_filename)
|
15
|
+
doc = Nokogiri::XML(File.open(comments_filename))
|
16
|
+
doc.search('//w:comments').each do |document|
|
17
|
+
document.xpath('w:comment').each do |comment_tag|
|
18
|
+
comment = Comment.new(comment_tag.attribute('id').value)
|
19
|
+
comment_tag.xpath('w:p').each_with_index do |p, index|
|
20
|
+
comment.paragraphs << DocxParagraph.parse(p, index)
|
21
|
+
end
|
22
|
+
comments << comment.dup
|
23
|
+
end
|
24
|
+
end
|
25
|
+
comments
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Document Properties
|
2
|
+
module OoxmlParser
|
3
|
+
class DocumentProperties < OOXMLDocumentObject
|
4
|
+
attr_accessor :pages, :words
|
5
|
+
|
6
|
+
def initialize(pages = nil, words = nil)
|
7
|
+
@pages = pages
|
8
|
+
@words = words
|
9
|
+
end
|
10
|
+
|
11
|
+
# Parse Document properties
|
12
|
+
# @return [DocumentProperties]
|
13
|
+
def self.parse
|
14
|
+
properties = DocumentProperties.new
|
15
|
+
doc_props = XmlSimple.xml_in(File.open("#{OOXMLDocumentObject.path_to_folder}docProps/app.xml"))
|
16
|
+
properties.pages = doc_props['Pages'].first.to_i unless doc_props['Pages'].nil?
|
17
|
+
properties.words = doc_props['Words'].first.to_i unless doc_props['Words'].nil?
|
18
|
+
properties
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for describing styles containing in +styles.xml+
|
3
|
+
class DocumentStyle < OOXMLDocumentObject
|
4
|
+
# @return [Symbol] Type of style (+:paragraph+ or +:table+)
|
5
|
+
attr_accessor :type
|
6
|
+
# @return [FixNum] number of style
|
7
|
+
attr_accessor :style_id
|
8
|
+
# @return [String] name of style
|
9
|
+
attr_accessor :name
|
10
|
+
# @return [FixNum] id of style on which this style is based
|
11
|
+
attr_accessor :based_on
|
12
|
+
# @return [FixNum] id of next style
|
13
|
+
attr_accessor :next_style
|
14
|
+
# @return [DocxParagraphRun] run properties
|
15
|
+
attr_accessor :run_properties
|
16
|
+
# @return [DocxParagraph] run properties
|
17
|
+
attr_accessor :paragraph_properties
|
18
|
+
# @return [True, False] Latent Style Primary Style Setting
|
19
|
+
# Used to determine if current style is visible in style list in editors
|
20
|
+
# According to http://www.wordarticles.com/Articles/WordStyles/LatentStyles.php
|
21
|
+
attr_accessor :q_format
|
22
|
+
alias visible? q_format
|
23
|
+
|
24
|
+
def initialize
|
25
|
+
@q_format = false
|
26
|
+
end
|
27
|
+
|
28
|
+
# Parse single document style
|
29
|
+
# @return [DocumentStyle]
|
30
|
+
def self.parse(node)
|
31
|
+
document_style = DocumentStyle.new
|
32
|
+
node.attributes.each do |key, value|
|
33
|
+
case key
|
34
|
+
when 'type'
|
35
|
+
document_style.type = value.value.to_sym
|
36
|
+
when 'styleId'
|
37
|
+
document_style.style_id = value.value.to_i
|
38
|
+
end
|
39
|
+
end
|
40
|
+
node.xpath('*').each do |subnode|
|
41
|
+
case subnode.name
|
42
|
+
when 'name'
|
43
|
+
document_style.name = subnode.attribute('val').value
|
44
|
+
when 'basedOn'
|
45
|
+
document_style.based_on = subnode.attribute('val').value.to_i
|
46
|
+
when 'next'
|
47
|
+
document_style.next_style = subnode.attribute('val').value.to_i
|
48
|
+
when 'rPr'
|
49
|
+
document_style.run_properties = DocxParagraphRun.parse(subnode)
|
50
|
+
when 'pPr'
|
51
|
+
document_style.paragraph_properties = DocxParagraph.parse_paragraph_style(subnode)
|
52
|
+
when 'qFormat'
|
53
|
+
document_style.q_format = true
|
54
|
+
end
|
55
|
+
end
|
56
|
+
document_style
|
57
|
+
end
|
58
|
+
|
59
|
+
# Parse all document style list
|
60
|
+
# @return [Array, DocumentStyle]
|
61
|
+
def self.parse_list
|
62
|
+
styles_array = []
|
63
|
+
doc = Nokogiri::XML(File.open(OOXMLDocumentObject.path_to_folder + 'word/styles.xml'))
|
64
|
+
doc.search('//w:style').each do |style|
|
65
|
+
styles_array << DocumentStyle.parse(style)
|
66
|
+
end
|
67
|
+
styles_array
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Delimiter Data
|
2
|
+
module OoxmlParser
|
3
|
+
class Delimiter
|
4
|
+
attr_accessor :begin_character, :value, :end_character
|
5
|
+
|
6
|
+
def initialize(begin_character = '(', value = nil, end_character = ')')
|
7
|
+
@begin_character = begin_character
|
8
|
+
@value = value
|
9
|
+
@end_character = end_character
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Group Char Data
|
2
|
+
module OoxmlParser
|
3
|
+
class GroupChar
|
4
|
+
attr_accessor :symbol, :position, :vertical_align, :element
|
5
|
+
|
6
|
+
def initialize(symbol = nil, position = nil, vertical_align = nil, element = nil)
|
7
|
+
@symbol = symbol
|
8
|
+
@position = position
|
9
|
+
@vertical_align = vertical_align
|
10
|
+
@element = element
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Index data
|
2
|
+
module OoxmlParser
|
3
|
+
class Index
|
4
|
+
attr_accessor :value, :top_index, :bottom_index
|
5
|
+
|
6
|
+
def initialize(value = nil, bottom_index = nil, top_index = nil)
|
7
|
+
@value = value
|
8
|
+
@bottom_index = bottom_index
|
9
|
+
@top_index = top_index
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Operator Data
|
2
|
+
module OoxmlParser
|
3
|
+
class Operator
|
4
|
+
attr_accessor :operator, :bottom_value, :top_value, :value
|
5
|
+
|
6
|
+
def initialize(operator = nil, bottom_value = nil, top_value = nil, value = nil)
|
7
|
+
@operator = operator
|
8
|
+
@bottom_value = bottom_value
|
9
|
+
@top_value = top_value
|
10
|
+
@value = value
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|