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,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `w:fldSimple` tags
|
5
|
+
class FieldSimple < OOXMLDocumentObject
|
6
|
+
# @return [String] instruction value
|
7
|
+
attr_reader :instruction
|
8
|
+
# @return [Array<ParagraphRun>] instruction value
|
9
|
+
attr_reader :runs
|
10
|
+
|
11
|
+
def initialize(parent: nil)
|
12
|
+
@runs = []
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
# Parse FieldSimple object
|
17
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
18
|
+
# @return [FieldSimple] result of parsing
|
19
|
+
def parse(node)
|
20
|
+
node.attributes.each do |key, value|
|
21
|
+
case key
|
22
|
+
when 'instr'
|
23
|
+
@instruction = value.value.to_s
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
node.xpath('*').each do |node_child|
|
28
|
+
case node_child.name
|
29
|
+
when 'r'
|
30
|
+
@runs << ParagraphRun.new(parent: self).parse(node_child)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
self
|
34
|
+
end
|
35
|
+
|
36
|
+
# @return [True, False] is field simple page numbering
|
37
|
+
def page_numbering?
|
38
|
+
instruction.include?('PAGE')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for data with FrameProperties
|
5
|
+
class FrameProperties < OOXMLDocumentObject
|
6
|
+
attr_accessor :drop_cap, :lines, :wrap, :vertical_anchor, :horizontal_anchor, :width, :height, :height_rule,
|
7
|
+
:horizontal_align, :vertical_align, :anchor_lock, :vertical_space, :horizontal_space,
|
8
|
+
:horizontal_position, :vertical_position
|
9
|
+
|
10
|
+
# Parse FrameProperties
|
11
|
+
# @param node [Nokogiri::XML:Element] with FrameProperties
|
12
|
+
# @return [FrameProperties] parsed result
|
13
|
+
def parse(node)
|
14
|
+
node.attributes.each do |key, value|
|
15
|
+
case key
|
16
|
+
when 'dropCap'
|
17
|
+
@drop_cap = value.value.to_sym
|
18
|
+
when 'lines'
|
19
|
+
@lines = value.value.to_i
|
20
|
+
when 'wrap'
|
21
|
+
@lines = value.value.to_sym
|
22
|
+
when 'vAnchor'
|
23
|
+
@vertical_anchor = value.value.to_sym
|
24
|
+
when 'hAnchor'
|
25
|
+
@horizontal_anchor = value.value.to_sym
|
26
|
+
when 'w'
|
27
|
+
@width = OoxmlSize.new(value.value.to_f)
|
28
|
+
when 'h'
|
29
|
+
@height = OoxmlSize.new(value.value.to_f)
|
30
|
+
when 'hRule'
|
31
|
+
@height_rule = value.value.to_s.sub('atLeast', 'at_least').to_sym
|
32
|
+
when 'xAlign'
|
33
|
+
@horizontal_align = value.value.to_sym
|
34
|
+
when 'yAlign'
|
35
|
+
@vertical_align = value.value.to_sym
|
36
|
+
when 'anchorLock'
|
37
|
+
@anchor_lock = attribute_enabled?(value)
|
38
|
+
when 'vSpace'
|
39
|
+
@vertical_space = OoxmlSize.new(value.value.to_f)
|
40
|
+
when 'hSpace'
|
41
|
+
@horizontal_space = OoxmlSize.new(value.value.to_f)
|
42
|
+
when 'x'
|
43
|
+
@horizontal_position = OoxmlSize.new(value.value.to_f)
|
44
|
+
when 'y'
|
45
|
+
@vertical_position = OoxmlSize.new(value.value.to_f)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
self
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for working with Indents data
|
5
|
+
class Indents < OOXMLDocumentObject
|
6
|
+
attr_accessor :first_line_indent, :left_indent, :right_indent, :hanging_indent
|
7
|
+
|
8
|
+
def initialize(first_line_indent = OoxmlSize.new(0),
|
9
|
+
left_indent = OoxmlSize.new(0),
|
10
|
+
right_indent = OoxmlSize.new(0),
|
11
|
+
hanging_indent = OoxmlSize.new(0),
|
12
|
+
parent: nil)
|
13
|
+
@first_line_indent = first_line_indent
|
14
|
+
@left_indent = left_indent
|
15
|
+
@right_indent = right_indent
|
16
|
+
@hanging_indent = hanging_indent
|
17
|
+
super(parent: parent)
|
18
|
+
end
|
19
|
+
|
20
|
+
alias first_line first_line_indent
|
21
|
+
alias left left_indent
|
22
|
+
alias right right_indent
|
23
|
+
alias hanging hanging_indent
|
24
|
+
|
25
|
+
# Convert to string
|
26
|
+
# @return [String] result of conversion
|
27
|
+
def to_s
|
28
|
+
"first line indent: #{@first_line_indent}, left indent: #{@left_indent}, "\
|
29
|
+
"right indent: #{@right_indent}, hanging indent: #{@hanging_indent}"
|
30
|
+
end
|
31
|
+
|
32
|
+
# Parse Indents
|
33
|
+
# @param [Nokogiri::XML:Element] node with Indents
|
34
|
+
# @return [Indents] value of Indents
|
35
|
+
def parse(node)
|
36
|
+
node.attributes.each do |key, value|
|
37
|
+
case key
|
38
|
+
when 'firstLine'
|
39
|
+
@first_line_indent = OoxmlSize.new(value.value.to_f)
|
40
|
+
when 'left'
|
41
|
+
@left_indent = OoxmlSize.new(value.value.to_f)
|
42
|
+
when 'right'
|
43
|
+
@right_indent = OoxmlSize.new(value.value.to_f)
|
44
|
+
when 'hanging'
|
45
|
+
@hanging_indent = OoxmlSize.new(value.value.to_f)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
self
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OoxmlParser
|
6
|
+
# Class for parsing `w:ins` tag - Inserted Run Content
|
7
|
+
class Inserted < OOXMLDocumentObject
|
8
|
+
# @return [Integer] id of inserted
|
9
|
+
attr_accessor :id
|
10
|
+
# @return [String] author of insert
|
11
|
+
attr_accessor :author
|
12
|
+
# @return [Date] date of insert
|
13
|
+
attr_accessor :date
|
14
|
+
# @return [String] id of user
|
15
|
+
attr_accessor :user_id
|
16
|
+
# @return [ParagraphRun] inserted run
|
17
|
+
attr_accessor :run
|
18
|
+
|
19
|
+
# Parse Inserted object
|
20
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
21
|
+
# @return [Inserted] result of parsing
|
22
|
+
def parse(node)
|
23
|
+
node.attributes.each do |key, value|
|
24
|
+
case key
|
25
|
+
when 'id'
|
26
|
+
@id = value.value.to_i
|
27
|
+
when 'author'
|
28
|
+
@author = value.value.to_s
|
29
|
+
when 'date'
|
30
|
+
@date = parse_date(value.value.to_s)
|
31
|
+
when 'oouserid'
|
32
|
+
@user_id = value.value.to_s
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
node.xpath('*').each do |node_child|
|
37
|
+
case node_child.name
|
38
|
+
when 'r'
|
39
|
+
@run = ParagraphRun.new(parent: self).parse(node_child)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
self
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
# Parse date and handle incorrect dates
|
48
|
+
# @param value [Sting] value of date
|
49
|
+
# @return [DateTime, String] if date correct or incorrect
|
50
|
+
def parse_date(value)
|
51
|
+
DateTime.parse(value)
|
52
|
+
rescue ArgumentError
|
53
|
+
warn "Date #{value} is incorrect format"
|
54
|
+
value
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_content.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `w:w:sdtContent` tags
|
5
|
+
class SDTContent < OOXMLDocumentObject
|
6
|
+
# @return [Array <ParagraphRun, Table, ParagraphRun>] list of all elements in SDT
|
7
|
+
attr_reader :elements
|
8
|
+
|
9
|
+
def initialize(parent: nil)
|
10
|
+
@elements = []
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
# Parse SDTContent object
|
15
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
16
|
+
# @return [SDTContent] result of parsing
|
17
|
+
def parse(node)
|
18
|
+
node.xpath('*').each do |node_child|
|
19
|
+
case node_child.name
|
20
|
+
when 'p'
|
21
|
+
@elements << DocxParagraph.new(parent: self).parse(node_child)
|
22
|
+
when 'r'
|
23
|
+
@elements << ParagraphRun.new(parent: self).parse(node_child)
|
24
|
+
when 'tbl'
|
25
|
+
@elements << Table.new(parent: self).parse(node_child)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
self
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [Array<DocxParagraphs>] list of paragraphs
|
32
|
+
def paragraphs
|
33
|
+
@elements.select { |obj| obj.is_a?(OoxmlParser::DocxParagraph) }
|
34
|
+
end
|
35
|
+
|
36
|
+
# @return [Array<ParagraphRun>] list of runs
|
37
|
+
def runs
|
38
|
+
@elements.select { |obj| obj.is_a?(OoxmlParser::ParagraphRun) }
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [Array<Table>] list of tables
|
42
|
+
def tables
|
43
|
+
@elements.select { |obj| obj.is_a?(OoxmlParser::Table) }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_properties.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `w:sdtPr` tags
|
5
|
+
class SDTProperties < OOXMLDocumentObject
|
6
|
+
# @return [ValuedChild] alias value
|
7
|
+
attr_reader :alias
|
8
|
+
# @return [ValuedChild] tag value
|
9
|
+
attr_reader :tag
|
10
|
+
# @return [ValuedChild] Locking Setting
|
11
|
+
attr_reader :lock
|
12
|
+
|
13
|
+
# Parse SDTProperties object
|
14
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
15
|
+
# @return [SDTProperties] result of parsing
|
16
|
+
def parse(node)
|
17
|
+
node.xpath('*').each do |node_child|
|
18
|
+
case node_child.name
|
19
|
+
when 'alias'
|
20
|
+
@alias = ValuedChild.new(:string, parent: self).parse(node_child)
|
21
|
+
when 'tag'
|
22
|
+
@tag = ValuedChild.new(:string, parent: self).parse(node_child)
|
23
|
+
when 'lock'
|
24
|
+
@lock = ValuedChild.new(:symbol, parent: self).parse(node_child)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
self
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'sdt/sdt_content'
|
4
|
+
require_relative 'sdt/sdt_properties'
|
5
|
+
module OoxmlParser
|
6
|
+
# Class for parsing `w:std`
|
7
|
+
class StructuredDocumentTag < OOXMLDocumentObject
|
8
|
+
# @return [SDTContent] content of sdt
|
9
|
+
attr_reader :sdt_content
|
10
|
+
# @return [SDTProperties] properties of sdt
|
11
|
+
attr_reader :properties
|
12
|
+
|
13
|
+
# Parse StructuredDocumentTag object
|
14
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
15
|
+
# @return [StructuredDocumentTag] result of parsing
|
16
|
+
def parse(node)
|
17
|
+
node.xpath('*').each do |node_child|
|
18
|
+
case node_child.name
|
19
|
+
when 'sdtContent'
|
20
|
+
@sdt_content = SDTContent.new(parent: self).parse(node_child)
|
21
|
+
when 'sdtPr'
|
22
|
+
@properties = SDTProperties.new(parent: self).parse(node_child)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
self
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Style Parameter Data
|
5
|
+
class StyleParametres < OOXMLDocumentObject
|
6
|
+
attr_accessor :q_format, :hidden, :name
|
7
|
+
|
8
|
+
def initialize(params = {})
|
9
|
+
@name = params[:name]
|
10
|
+
@q_format = params.fetch(:q_format, false)
|
11
|
+
@hidden = params.fetch(:hidden, false)
|
12
|
+
super(parent: params[:parent])
|
13
|
+
end
|
14
|
+
|
15
|
+
# Parse StyleParametres data
|
16
|
+
# @param [Nokogiri::XML:Element] node with StyleParametres data
|
17
|
+
# @return [StyleParametres] value of Columns data
|
18
|
+
def parse(node)
|
19
|
+
node.xpath('*').each do |node_child|
|
20
|
+
case node_child.name
|
21
|
+
when 'name'
|
22
|
+
@name = node_child.attribute('val').value
|
23
|
+
when 'qFormat'
|
24
|
+
@q_format = option_enabled?(node_child)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
self
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,273 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# noinspection RubyTooManyInstanceVariablesInspection
|
4
|
+
require_relative 'docx_paragraph/bookmark_start'
|
5
|
+
require_relative 'docx_paragraph/bookmark_end'
|
6
|
+
require_relative 'docx_paragraph/comment_range_end'
|
7
|
+
require_relative 'docx_paragraph/comment_range_start'
|
8
|
+
require_relative 'docx_paragraph/docx_paragraph_helper'
|
9
|
+
require_relative 'docx_paragraph/docx_paragraph_run'
|
10
|
+
require_relative 'docx_paragraph/field_simple'
|
11
|
+
require_relative 'docx_paragraph/indents'
|
12
|
+
require_relative 'docx_paragraph/inserted'
|
13
|
+
require_relative 'docx_paragraph/structured_document_tag'
|
14
|
+
require_relative 'docx_paragraph/frame_properties'
|
15
|
+
require_relative 'docx_paragraph/docx_formula'
|
16
|
+
require_relative 'docx_paragraph/style_parametres'
|
17
|
+
module OoxmlParser
|
18
|
+
# Class for data of DocxParagraph
|
19
|
+
class DocxParagraph < OOXMLDocumentObject
|
20
|
+
include DocxParagraphHelper
|
21
|
+
attr_accessor :number, :bookmark_start, :bookmark_end, :align, :spacing, :ind, :numbering,
|
22
|
+
:character_style_array, :page_break, :borders, :keep_lines,
|
23
|
+
:contextual_spacing, :sector_properties, :page_numbering, :section_break, :style, :keep_next,
|
24
|
+
:orphan_control
|
25
|
+
# @return [Hyperlink] hyperlink in paragraph
|
26
|
+
attr_reader :hyperlink
|
27
|
+
# @return [ParagraphProperties] Properties of current paragraph
|
28
|
+
attr_accessor :paragraph_properties
|
29
|
+
# @return [Inserted] data inserted by review
|
30
|
+
attr_accessor :inserted
|
31
|
+
# @return [FieldSimple] field simple
|
32
|
+
attr_reader :field_simple
|
33
|
+
# @return [Integer] id of paragraph (for comment)
|
34
|
+
attr_accessor :paragraph_id
|
35
|
+
# @return [MathParagraph] math paragraph
|
36
|
+
attr_reader :math_paragraph
|
37
|
+
# @return [Integer] id of text (for comment)
|
38
|
+
attr_accessor :text_id
|
39
|
+
|
40
|
+
def initialize(parent: nil)
|
41
|
+
@number = 0
|
42
|
+
@bookmark_start = []
|
43
|
+
@bookmark_end = []
|
44
|
+
@align = :left
|
45
|
+
@spacing = Spacing.new
|
46
|
+
@ind = Indents.new
|
47
|
+
@character_style_array = []
|
48
|
+
@page_break = false
|
49
|
+
@borders = Borders.new
|
50
|
+
@keep_lines = false
|
51
|
+
@contextual_spacing = false
|
52
|
+
@page_numbering = false
|
53
|
+
@keep_next = false
|
54
|
+
@orphan_control = true
|
55
|
+
super
|
56
|
+
end
|
57
|
+
|
58
|
+
alias elements character_style_array
|
59
|
+
|
60
|
+
# Constructor for copy of object
|
61
|
+
# @param source [DocxParagraph] original object
|
62
|
+
# @return [void]
|
63
|
+
def initialize_copy(source)
|
64
|
+
super
|
65
|
+
@bookmark_start = source.bookmark_start.clone
|
66
|
+
@bookmark_end = source.bookmark_end.clone
|
67
|
+
@character_style_array = source.character_style_array.clone
|
68
|
+
@spacing = source.spacing.clone
|
69
|
+
end
|
70
|
+
|
71
|
+
# @return [Array<OOXMLDocumentObject>] array of child objects that contains data
|
72
|
+
def nonempty_runs
|
73
|
+
@character_style_array.select do |cur_run|
|
74
|
+
case cur_run
|
75
|
+
when DocxParagraphRun, ParagraphRun
|
76
|
+
!cur_run.empty?
|
77
|
+
when DocxFormula, StructuredDocumentTag, BookmarkStart, BookmarkEnd, CommentRangeStart, CommentRangeEnd
|
78
|
+
true
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
alias runs character_style_array
|
84
|
+
|
85
|
+
# @return [True, false] if structure contain any user data
|
86
|
+
def with_data?
|
87
|
+
!nonempty_runs.empty? || paragraph_properties&.section_properties
|
88
|
+
end
|
89
|
+
|
90
|
+
# Compare this object to other
|
91
|
+
# @param other [Object] any other object
|
92
|
+
# @return [True, False] result of comparision
|
93
|
+
def ==(other)
|
94
|
+
ignored_attributes = %i[@number @parent]
|
95
|
+
all_instance_variables = instance_variables
|
96
|
+
significan_attribues = all_instance_variables - ignored_attributes
|
97
|
+
significan_attribues.each do |current_attributes|
|
98
|
+
return false unless instance_variable_get(current_attributes) == other.instance_variable_get(current_attributes)
|
99
|
+
end
|
100
|
+
true
|
101
|
+
end
|
102
|
+
|
103
|
+
# Parse object
|
104
|
+
# @param node [Nokogiri::XML:Node] node with DocxParagraph
|
105
|
+
# @param par_number [Integer] number of paragraph
|
106
|
+
# @param default_character [DocxParagraphRun] style for paragraph
|
107
|
+
# @param parent [OOXMLDocumentObject] parent of run
|
108
|
+
# @return [DocxParagraph] result of parse
|
109
|
+
def parse(node, par_number = 0, default_character = DocxParagraphRun.new, parent: nil)
|
110
|
+
@parent ||= parent
|
111
|
+
default_character_style = default_character.dup
|
112
|
+
character_styles_array = []
|
113
|
+
custom_character_style = default_character_style.dup
|
114
|
+
custom_character_style.parent = self
|
115
|
+
char_number = 0
|
116
|
+
comments = []
|
117
|
+
node.attributes.each do |key, value|
|
118
|
+
case key
|
119
|
+
when 'paraId'
|
120
|
+
@paragraph_id = value.value.to_i
|
121
|
+
when 'textId'
|
122
|
+
@text_id = value.value.to_i
|
123
|
+
end
|
124
|
+
end
|
125
|
+
node.xpath('*').each do |node_child|
|
126
|
+
case node_child.name
|
127
|
+
when 'bookmarkStart'
|
128
|
+
character_styles_array << BookmarkStart.new(parent: self).parse(node_child)
|
129
|
+
when 'bookmarkEnd'
|
130
|
+
character_styles_array << BookmarkEnd.new(parent: self).parse(node_child)
|
131
|
+
when 'pPr'
|
132
|
+
@paragraph_properties = ParagraphProperties.new(parent: self).parse(node_child)
|
133
|
+
parse_paragraph_style(node_child, custom_character_style)
|
134
|
+
when 'commentRangeStart'
|
135
|
+
character_styles_array << CommentRangeStart.new(parent: self).parse(node_child)
|
136
|
+
when 'commentRangeEnd'
|
137
|
+
character_styles_array << CommentRangeEnd.new(parent: self).parse(node_child)
|
138
|
+
when 'fldSimple'
|
139
|
+
@field_simple = FieldSimple.new(parent: self).parse(node_child)
|
140
|
+
@page_numbering = true if field_simple.page_numbering?
|
141
|
+
character_styles_array += field_simple.runs
|
142
|
+
when 'r'
|
143
|
+
character_style = custom_character_style.dup
|
144
|
+
node_child.xpath('w:instrText').each do |insrt_text|
|
145
|
+
@page_numbering = true if insrt_text.text.include?('PAGE')
|
146
|
+
end
|
147
|
+
character_style.parse(node_child, char_number, parent: self)
|
148
|
+
character_style.comments = comments.dup
|
149
|
+
character_styles_array << character_style.dup
|
150
|
+
character_styles_array.last.shape = character_style.shape if character_style.shape
|
151
|
+
char_number += 1
|
152
|
+
when 'hyperlink'
|
153
|
+
@hyperlink = Hyperlink.new(parent: self).parse(node_child)
|
154
|
+
character_style = default_character_style.dup
|
155
|
+
character_style.parent = self
|
156
|
+
if node_child.attribute('id')
|
157
|
+
character_style.link = Hyperlink.new(parent: character_style).parse(node_child)
|
158
|
+
elsif node_child.attribute('anchor')
|
159
|
+
character_style.link = node_child.attribute('anchor').value
|
160
|
+
end
|
161
|
+
node_child.xpath('w:r').each do |r_tag|
|
162
|
+
character_style.parse(r_tag, char_number, parent: self)
|
163
|
+
character_styles_array << character_style.dup
|
164
|
+
char_number += 1
|
165
|
+
end
|
166
|
+
node_child.xpath('w:fldSimple').each do |simple_field|
|
167
|
+
hyperlink_field_simple = FieldSimple.new(parent: self).parse(simple_field)
|
168
|
+
character_styles_array += hyperlink_field_simple.runs
|
169
|
+
end
|
170
|
+
when 'oMathPara'
|
171
|
+
@math_paragraph = MathParagraph.new(parent: self).parse(node_child)
|
172
|
+
character_styles_array << math_paragraph.math
|
173
|
+
when 'ins'
|
174
|
+
@inserted = Inserted.new(parent: self).parse(node_child)
|
175
|
+
when 'sdt'
|
176
|
+
character_styles_array << StructuredDocumentTag.new(parent: self).parse(node_child)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
@number = par_number
|
180
|
+
character_styles_array.last.text = character_styles_array.last.text.rstrip if character_styles_array.last.instance_of?(DocxParagraphRun)
|
181
|
+
@character_style_array = character_styles_array
|
182
|
+
@parent = parent
|
183
|
+
self
|
184
|
+
end
|
185
|
+
|
186
|
+
# Parse style
|
187
|
+
# @param node [Nokogiri::XML:Node] node with style
|
188
|
+
# @param default_char_style [DocxParagraphRun] style for paragraph
|
189
|
+
# @return [DocxParagraph] result of parse
|
190
|
+
def parse_paragraph_style(node, default_char_style = DocxParagraphRun.new(parent: self))
|
191
|
+
node.xpath('*').each do |node_child|
|
192
|
+
case node_child.name
|
193
|
+
when 'pageBreakBefore'
|
194
|
+
@page_break = true if node_child.attribute('val').nil? || node_child.attribute('val').value != 'false'
|
195
|
+
when 'pBdr'
|
196
|
+
@borders = ParagraphBorders.new(parent: self).parse(node_child)
|
197
|
+
when 'keepLines'
|
198
|
+
if node_child.attribute('val').nil?
|
199
|
+
@keep_lines = true
|
200
|
+
else
|
201
|
+
@keep_lines = true unless node_child.attribute('val').value == 'false'
|
202
|
+
end
|
203
|
+
when 'widowControl'
|
204
|
+
@orphan_control = option_enabled?(node_child)
|
205
|
+
when 'keepNext'
|
206
|
+
@keep_next = true
|
207
|
+
when 'contextualSpacing'
|
208
|
+
@contextual_spacing = true
|
209
|
+
when 'pStyle'
|
210
|
+
parse_paragraph_style_xml(node_child.attribute('val').value, default_char_style)
|
211
|
+
when 'ind'
|
212
|
+
@ind = DocumentStructure.default_paragraph_style.ind.dup.parse(node_child)
|
213
|
+
when 'numPr'
|
214
|
+
@numbering = NumberingProperties.new(parent: self).parse(node_child)
|
215
|
+
when 'jc'
|
216
|
+
@align = node_child.attribute('val').value.to_sym unless node_child.attribute('val').nil?
|
217
|
+
@align = :justify if node_child.attribute('val').value == 'both'
|
218
|
+
when 'spacing'
|
219
|
+
@spacing.before = (node_child.attribute('before').value.to_f / 566.9).round(2) unless node_child.attribute('before').nil?
|
220
|
+
@spacing.after = (node_child.attribute('after').value.to_f / 566.9).round(2) unless node_child.attribute('after').nil?
|
221
|
+
@spacing.line_rule = node_child.attribute('lineRule').value.sub('atLeast', 'at_least').to_sym unless node_child.attribute('lineRule').nil?
|
222
|
+
unless node_child.attribute('line').nil?
|
223
|
+
@spacing.line = (@spacing.line_rule == :auto ? (node_child.attribute('line').value.to_f / 240.0).round(2) : (node_child.attribute('line').value.to_f / 566.9).round(2))
|
224
|
+
end
|
225
|
+
when 'sectPr'
|
226
|
+
@sector_properties = PageProperties.new(parent: self).parse(node_child, self, default_char_style)
|
227
|
+
@section_break = case @sector_properties.type
|
228
|
+
when 'oddPage'
|
229
|
+
'Odd page'
|
230
|
+
when 'continuous'
|
231
|
+
'Current Page'
|
232
|
+
else
|
233
|
+
'Next Page'
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
237
|
+
@parent = parent
|
238
|
+
self
|
239
|
+
end
|
240
|
+
|
241
|
+
# Parse style xml
|
242
|
+
# @param id [String] id of style to parse
|
243
|
+
# @param character_style [DocxParagraphRun] style to parse
|
244
|
+
# @return [void]
|
245
|
+
def parse_paragraph_style_xml(id, character_style)
|
246
|
+
doc = parse_xml("#{OOXMLDocumentObject.path_to_folder}word/styles.xml")
|
247
|
+
doc.search('//w:style').each do |style|
|
248
|
+
next unless style.attribute('styleId').value == id
|
249
|
+
|
250
|
+
style.xpath('w:pPr').each do |p_pr|
|
251
|
+
parse_paragraph_style(p_pr, character_style)
|
252
|
+
@style = StyleParametres.new(parent: self).parse(style)
|
253
|
+
end
|
254
|
+
style.xpath('w:rPr').each do |r_pr|
|
255
|
+
character_style.parse_properties(r_pr)
|
256
|
+
end
|
257
|
+
break
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
extend Gem::Deprecate
|
262
|
+
deprecate :page_numbering, 'field_simple.page_numbering?', 2020, 1
|
263
|
+
|
264
|
+
# @return [OoxmlParser::StructuredDocumentTag] Return first sdt element
|
265
|
+
def sdt
|
266
|
+
@character_style_array.each do |cur_element|
|
267
|
+
return cur_element if cur_element.is_a?(StructuredDocumentTag)
|
268
|
+
end
|
269
|
+
nil
|
270
|
+
end
|
271
|
+
deprecate :sdt, 'nonempty_runs[i]', 2020, 1
|
272
|
+
end
|
273
|
+
end
|