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,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Stuff for help working with paragraph
|
5
|
+
module DocxParagraphHelper
|
6
|
+
# @return [Nil, CommentExtended] extended data for this comment
|
7
|
+
def comment_extend_data
|
8
|
+
return if @paragraph_id.nil?
|
9
|
+
|
10
|
+
root_object.comments_extended.by_id(@paragraph_id)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Temp method to return background color
|
14
|
+
# Need to be compatible with older versions
|
15
|
+
# @return [OoxmlParser::Color]
|
16
|
+
def background_color
|
17
|
+
paragraph_properties.shade.to_background_color
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Module for some helpers for ParagraphRun
|
5
|
+
module DocxParagraphRunHelpers
|
6
|
+
# Parse other properties
|
7
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
8
|
+
# @return [DocxParagraphRun] result of parse
|
9
|
+
def parse_properties(node)
|
10
|
+
self.font_style = FontStyle.new
|
11
|
+
node.xpath('*').each do |node_child|
|
12
|
+
case node_child.name
|
13
|
+
when 'rFonts'
|
14
|
+
node_child.attributes.each do |font_attribute, value|
|
15
|
+
case font_attribute
|
16
|
+
when 'asciiTheme'
|
17
|
+
theme = node_child.attribute('asciiTheme').value
|
18
|
+
next unless root_object.theme
|
19
|
+
|
20
|
+
self.font = root_object.theme.font_scheme.major_font.latin.typeface if theme.include?('major')
|
21
|
+
self.font = root_object.theme.font_scheme.minor_font.latin.typeface if theme.include?('minor')
|
22
|
+
when 'ascii'
|
23
|
+
self.font = value.value
|
24
|
+
break
|
25
|
+
end
|
26
|
+
end
|
27
|
+
when 'sz'
|
28
|
+
self.size = node_child.attribute('val').value.to_i / 2.0
|
29
|
+
when 'highlight'
|
30
|
+
self.highlight = node_child.attribute('val').value
|
31
|
+
when 'vertAlign'
|
32
|
+
self.vertical_align = node_child.attribute('val').value.to_sym
|
33
|
+
when 'effect'
|
34
|
+
self.effect = node_child.attribute('val').value
|
35
|
+
when 'position'
|
36
|
+
self.position = (node_child.attribute('val').value.to_f / (28.0 + 1.0 / 3.0) / 2.0).round(1)
|
37
|
+
when 'em'
|
38
|
+
self.em = node_child.attribute('val').value
|
39
|
+
when 'spacing'
|
40
|
+
self.spacing = (node_child.attribute('val').value.to_f / 566.9).round(1)
|
41
|
+
when 'textFill'
|
42
|
+
self.text_fill = TextFill.new(parent: self).parse(node_child)
|
43
|
+
when 'textOutline'
|
44
|
+
self.text_outline = TextOutline.new(parent: self).parse(node_child)
|
45
|
+
when 'bCs', 'b'
|
46
|
+
font_style.bold = option_enabled?(node_child)
|
47
|
+
when 'iCs', 'i'
|
48
|
+
font_style.italic = option_enabled?(node_child)
|
49
|
+
when 'caps'
|
50
|
+
self.caps = :caps
|
51
|
+
when 'smallCaps'
|
52
|
+
self.caps = :small_caps if option_enabled?(node_child)
|
53
|
+
when 'color'
|
54
|
+
parse_color_tag(node_child)
|
55
|
+
when 'shd'
|
56
|
+
@shade = Shade.new(parent: self).parse(node_child)
|
57
|
+
when 'u', 'uCs'
|
58
|
+
parse_underline(node_child)
|
59
|
+
when 'strike'
|
60
|
+
font_style.strike = :single if option_enabled?(node_child)
|
61
|
+
when 'dstrike'
|
62
|
+
font_style.strike = :double if option_enabled?(node_child)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
self
|
66
|
+
end
|
67
|
+
|
68
|
+
# Temp method to return background color
|
69
|
+
# Need to be compatible with older versions
|
70
|
+
# @return [OoxmlParser::Color]
|
71
|
+
def background_color
|
72
|
+
shade.to_background_color
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
76
|
+
|
77
|
+
# Parse `color` tag
|
78
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
79
|
+
# @return [nil]
|
80
|
+
def parse_color_tag(node)
|
81
|
+
node.attributes.each do |key, value|
|
82
|
+
case key
|
83
|
+
when 'val'
|
84
|
+
self.font_color = Color.new(parent: self).parse_hex_string(value.value)
|
85
|
+
when 'themeColor'
|
86
|
+
if root_object.theme && root_object.theme.color_scheme[value.value.to_sym]
|
87
|
+
break if value.value == 'text2' || value.value == 'background2' || value.value.include?('accent') # Don't know why. Just works
|
88
|
+
|
89
|
+
self.font_color = root_object.theme.color_scheme[value.value.to_sym].color.dup
|
90
|
+
end
|
91
|
+
when 'themeShade'
|
92
|
+
font_color.calculate_with_shade!(value.value.hex.to_f / 255.0)
|
93
|
+
when 'themeTint'
|
94
|
+
font_color.calculate_with_tint!(1.0 - (value.value.hex.to_f / 255.0))
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Parse `u` or `uCs` tag
|
100
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
101
|
+
# @return [nil]
|
102
|
+
def parse_underline(node)
|
103
|
+
font_style.underlined = Underline.new
|
104
|
+
|
105
|
+
return unless option_enabled?(node)
|
106
|
+
|
107
|
+
font_style.underlined.style = node.attribute('val').value
|
108
|
+
font_style.underlined.color = Color.new(parent: font_style.underlined).parse_hex_string(node.attribute('color').value) unless node.attribute('color').nil?
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `o:OLEObject` tags
|
5
|
+
class OleObject < OOXMLDocumentObject
|
6
|
+
# @return [String] id of ole_object
|
7
|
+
attr_accessor :id
|
8
|
+
# @return [FileReference] data referenced in object
|
9
|
+
attr_accessor :file_reference
|
10
|
+
|
11
|
+
# Parse OleObject object
|
12
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
13
|
+
# @return [OleObject] result of parsing
|
14
|
+
def parse(node)
|
15
|
+
node.attributes.each do |key, value|
|
16
|
+
case key
|
17
|
+
when 'id'
|
18
|
+
@id = value.value
|
19
|
+
end
|
20
|
+
end
|
21
|
+
@file_reference = FileReference.new(parent: self).parse(node)
|
22
|
+
self
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'object/ole_object'
|
4
|
+
module OoxmlParser
|
5
|
+
# Class for parsing `w:object`
|
6
|
+
class RunObject < OOXMLDocumentObject
|
7
|
+
# @return [OleObject] ole object of object
|
8
|
+
attr_accessor :ole_object
|
9
|
+
|
10
|
+
# Parse RunObject object
|
11
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
12
|
+
# @return [RunObject] result of parsing
|
13
|
+
def parse(node)
|
14
|
+
node.xpath('*').each do |node_child|
|
15
|
+
case node_child.name
|
16
|
+
when 'OLEObject'
|
17
|
+
@ole_object = OleObject.new(parent: self).parse(node_child)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
self
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for working with Shape Margins
|
5
|
+
class ShapeMargins
|
6
|
+
attr_accessor :left, :right, :top
|
7
|
+
|
8
|
+
def initialize(left = nil, right = nil, top = nil)
|
9
|
+
@left = left
|
10
|
+
@right = right
|
11
|
+
@top = top
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'shape_properties/shape_margins'
|
4
|
+
require_relative 'shape_properties/shape_size'
|
5
|
+
require_relative 'shape_properties/stroke'
|
6
|
+
module OoxmlParser
|
7
|
+
# Class for working with Shape Properties
|
8
|
+
class ShapeProperties
|
9
|
+
attr_accessor :fill_color, :anchor_x, :anchor_y, :shadow, :margins, :size, :opacity, :position, :z_index, :stroke
|
10
|
+
|
11
|
+
def initialize(position = nil, margins = ShapeMargins.new, size = ShapeSize.new, z_index = nil, stroke = Stroke.new)
|
12
|
+
@position = position
|
13
|
+
@margins = margins
|
14
|
+
@size = size
|
15
|
+
@z_index = z_index
|
16
|
+
@stroke = stroke
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'shape/shape_properties'
|
4
|
+
module OoxmlParser
|
5
|
+
# Class for parsing `shape`, `rect`, `oval` tags
|
6
|
+
class Shape < OOXMLDocumentObject
|
7
|
+
attr_accessor :type, :properties, :elements
|
8
|
+
|
9
|
+
def initialize(type = nil,
|
10
|
+
properties = ShapeProperties.new,
|
11
|
+
elements = [],
|
12
|
+
parent: nil)
|
13
|
+
@type = type
|
14
|
+
@properties = properties
|
15
|
+
@elements = elements
|
16
|
+
super(parent: parent)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Parse Shape object
|
20
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
21
|
+
# @return [Shape] result of parsing
|
22
|
+
def parse(node, type)
|
23
|
+
@type = type
|
24
|
+
node.attributes.each do |key, value|
|
25
|
+
case key
|
26
|
+
when 'fillcolor'
|
27
|
+
@properties.fill_color = Color.new(parent: self)
|
28
|
+
.parse_hex_string(value_to_hex(value))
|
29
|
+
when 'strokecolor'
|
30
|
+
@properties.stroke.color = Color.new(parent: self)
|
31
|
+
.parse_hex_string(value_to_hex(value))
|
32
|
+
when 'strokeweight'
|
33
|
+
@properties.stroke.weight = value.value
|
34
|
+
when 'style'
|
35
|
+
parse_style(value.value)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
node.xpath('*').each do |node_child|
|
39
|
+
case node_child.name
|
40
|
+
when 'textbox'
|
41
|
+
@elements = TextBox.parse_list(node_child, parent: self)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
self
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
# @param style [String] value to parse
|
50
|
+
def parse_style(style)
|
51
|
+
style.split(';').each do |property|
|
52
|
+
if property.include?('margin-top')
|
53
|
+
@properties.margins.top = property.split(':').last
|
54
|
+
elsif property.include?('margin-left')
|
55
|
+
@properties.margins.left = property.split(':').last
|
56
|
+
elsif property.include?('width')
|
57
|
+
@properties.size.width = property.split(':').last
|
58
|
+
elsif property.include?('height')
|
59
|
+
@properties.size.height = property.split(':').last
|
60
|
+
elsif property.include?('z-index')
|
61
|
+
@properties.z_index = property.split(':').last
|
62
|
+
elsif property.include?('position')
|
63
|
+
@properties.position = property.split(':').last
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# @param value [String] value to extract hex string
|
69
|
+
# @return [String] hex string value
|
70
|
+
def value_to_hex(value)
|
71
|
+
value.to_s
|
72
|
+
.sub('#', '')
|
73
|
+
.split
|
74
|
+
.first
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Data about `textFill` object
|
5
|
+
class TextFill < OOXMLDocumentObject
|
6
|
+
attr_accessor :color_scheme
|
7
|
+
|
8
|
+
# Parse TextFill object
|
9
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
10
|
+
# @return [TextFill] result of parsing
|
11
|
+
def parse(node)
|
12
|
+
@color_scheme = DocxColorScheme.new(parent: self).parse(node)
|
13
|
+
self
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Class for parsing text outline and its properties
|
4
|
+
module OoxmlParser
|
5
|
+
# Class for parsing `w:textOutline`
|
6
|
+
class TextOutline < OOXMLDocumentObject
|
7
|
+
attr_accessor :width, :color_scheme
|
8
|
+
|
9
|
+
def initialize(parent: nil)
|
10
|
+
@width = OoxmlSize.new(0)
|
11
|
+
@color_scheme = :none
|
12
|
+
super
|
13
|
+
end
|
14
|
+
|
15
|
+
# Parse TextOutline object
|
16
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
17
|
+
# @return [TextOutline] result of parsing
|
18
|
+
def parse(node)
|
19
|
+
node.attributes.each do |key, value|
|
20
|
+
case key
|
21
|
+
when 'w'
|
22
|
+
@width = OoxmlSize.new(value.value.to_f, :emu)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
@color_scheme = DocxColorScheme.new(parent: self).parse(node)
|
26
|
+
self
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# noinspection RubyTooManyInstanceVariablesInspection
|
4
|
+
require_relative 'docx_paragraph_run/docx_paragraph_run_helpers'
|
5
|
+
require_relative 'docx_paragraph_run/object'
|
6
|
+
require_relative 'docx_paragraph_run/text_outline'
|
7
|
+
require_relative 'docx_paragraph_run/text_fill'
|
8
|
+
require_relative 'docx_paragraph_run/shape'
|
9
|
+
|
10
|
+
module OoxmlParser
|
11
|
+
# Class for working with DocxParagraphRun
|
12
|
+
class DocxParagraphRun < OOXMLDocumentObject
|
13
|
+
include DocxParagraphRunHelpers
|
14
|
+
attr_accessor :number, :font, :vertical_align, :size, :font_color, :font_style, :text, :drawings,
|
15
|
+
:link, :highlight, :effect, :caps, :w,
|
16
|
+
:position, :em, :spacing, :break, :touch, :shape, :footnote, :endnote, :fld_char, :style,
|
17
|
+
:comments, :alternate_content, :page_number, :text_outline, :text_fill
|
18
|
+
# @return [String] type of instruction used for upper level of run
|
19
|
+
# http://officeopenxml.com/WPfieldInstructions.php
|
20
|
+
attr_accessor :instruction
|
21
|
+
# @return [RunProperties] properties of run
|
22
|
+
attr_accessor :run_properties
|
23
|
+
# @return [RunObject] object of run
|
24
|
+
attr_accessor :object
|
25
|
+
# @return [Shade] shade properties
|
26
|
+
attr_accessor :shade
|
27
|
+
|
28
|
+
def initialize(parent: nil)
|
29
|
+
@number = 0
|
30
|
+
@font = 'Arial'
|
31
|
+
@vertical_align = :baseline
|
32
|
+
@size = 11
|
33
|
+
@font_color = Color.new
|
34
|
+
@font_style = FontStyle.new
|
35
|
+
@text = ''
|
36
|
+
@drawings = []
|
37
|
+
@w = false
|
38
|
+
@position = 0.0
|
39
|
+
@spacing = 0.0
|
40
|
+
@break = false
|
41
|
+
@comments = []
|
42
|
+
@page_number = false
|
43
|
+
super
|
44
|
+
end
|
45
|
+
|
46
|
+
# Constructor for copy of object
|
47
|
+
# @param source [DocxParagraphRun] original object
|
48
|
+
# @return [void]
|
49
|
+
def initialize_copy(source)
|
50
|
+
super
|
51
|
+
@drawings = source.drawings.clone
|
52
|
+
@comments = source.comments.clone
|
53
|
+
end
|
54
|
+
|
55
|
+
# @return [Array, nil] Drawings of Run
|
56
|
+
def drawing
|
57
|
+
# TODO: Rewrite all tests without this methos
|
58
|
+
@drawings.empty? ? nil : drawings.first
|
59
|
+
end
|
60
|
+
|
61
|
+
# @return [True, False] is current run empty
|
62
|
+
def empty?
|
63
|
+
text.empty? &&
|
64
|
+
!alternate_content &&
|
65
|
+
!drawing &&
|
66
|
+
!object &&
|
67
|
+
!shape &&
|
68
|
+
!footnote &&
|
69
|
+
!endnote &&
|
70
|
+
!@break
|
71
|
+
end
|
72
|
+
|
73
|
+
# Compare this object to other
|
74
|
+
# @param other [Object] any other object
|
75
|
+
# @return [True, False] result of comparision
|
76
|
+
def ==(other)
|
77
|
+
ignored_attributes = %i[@number @parent]
|
78
|
+
all_instance_variables = instance_variables
|
79
|
+
significan_attribues = all_instance_variables - ignored_attributes
|
80
|
+
significan_attribues.each do |current_attributes|
|
81
|
+
return false unless instance_variable_get(current_attributes) == other.instance_variable_get(current_attributes)
|
82
|
+
end
|
83
|
+
true
|
84
|
+
end
|
85
|
+
|
86
|
+
# Parse object
|
87
|
+
# @param r_tag [Nokogiri::XML:Node] node with DocxParagraphRun
|
88
|
+
# @param char_number [Integer] number of run
|
89
|
+
# @param parent [OOXMLDocumentObject] parent of run
|
90
|
+
# @return [void]
|
91
|
+
def parse(r_tag, char_number, parent: nil)
|
92
|
+
@parent = parent
|
93
|
+
r_tag.xpath('*').each do |node_child|
|
94
|
+
case node_child.name
|
95
|
+
when 'rPr'
|
96
|
+
parse_properties(node_child)
|
97
|
+
@run_properties = RunProperties.new(parent: self).parse(node_child)
|
98
|
+
when 'instrText'
|
99
|
+
if node_child.text.include?('HYPERLINK')
|
100
|
+
hyperlink = Hyperlink.new(node_child.text.sub('HYPERLINK ', '').split(' \\o ').first, node_child.text.sub('HYPERLINK', '').split(' \\o ').last)
|
101
|
+
@link = hyperlink
|
102
|
+
elsif node_child.text[/PAGE\s+\\\*/]
|
103
|
+
@text = '*PAGE NUMBER*'
|
104
|
+
end
|
105
|
+
when 'fldChar'
|
106
|
+
@fld_char = node_child.attribute('fldCharType').value.to_sym
|
107
|
+
when 't'
|
108
|
+
@text += node_child.text
|
109
|
+
when 'noBreakHyphen'
|
110
|
+
@text += '–'
|
111
|
+
when 'tab'
|
112
|
+
@text += "\t"
|
113
|
+
when 'drawing'
|
114
|
+
@drawings << DocxDrawing.new(parent: self).parse(node_child)
|
115
|
+
when 'AlternateContent'
|
116
|
+
@alternate_content = AlternateContent.new(parent: self).parse(node_child)
|
117
|
+
when 'br'
|
118
|
+
if node_child.attribute('type').nil?
|
119
|
+
@break = :line
|
120
|
+
@text += "\r"
|
121
|
+
else
|
122
|
+
case node_child.attribute('type').value
|
123
|
+
when 'page', 'column'
|
124
|
+
@break = node_child.attribute('type').value.to_sym
|
125
|
+
end
|
126
|
+
end
|
127
|
+
when 'footnoteReference'
|
128
|
+
@footnote = HeaderFooter.new(parent: self).parse(node_child)
|
129
|
+
when 'endnoteReference'
|
130
|
+
@endnote = HeaderFooter.new(parent: self).parse(node_child)
|
131
|
+
when 'pict'
|
132
|
+
node_child.xpath('*').each do |pict_node_child|
|
133
|
+
case pict_node_child.name
|
134
|
+
when 'shape'
|
135
|
+
@shape = Shape.new(parent: self).parse(pict_node_child, :shape)
|
136
|
+
when 'rect'
|
137
|
+
@shape = Shape.new(parent: self).parse(pict_node_child, :rectangle)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
when 'object'
|
141
|
+
@object = RunObject.new(parent: self).parse(node_child)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
@number = char_number
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|