ooxml_parser 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +18 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +20 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/order.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_index.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point/text_value.rb +15 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point_count.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference.rb +25 -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.rb +39 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/view_3d.rb +32 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +81 -74
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +20 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +15 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +15 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +22 -11
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing/doc_properties.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +34 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +9 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +18 -25
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +4 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +23 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +15 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +104 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative/picture_dimension.rb +17 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_vertical.rb +30 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +17 -16
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +34 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +12 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb +38 -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 +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb +29 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties.rb +22 -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/text_body.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +27 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties/preset_text_warp.rb +7 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +20 -11
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +18 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +11 -9
- 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 +15 -27
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +13 -9
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +20 -23
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +27 -22
- 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 +19 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip.rb +21 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill.rb +24 -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 +24 -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 +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry.rb +24 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +3 -3
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +22 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +20 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +9 -8
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +15 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +14 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +15 -12
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +18 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +12 -11
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +20 -24
- data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/color.rb +48 -182
- data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +15 -10
- data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +1 -63
- data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +17 -20
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop/preset_color.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +20 -7
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +12 -11
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +17 -17
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +15 -9
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +19 -16
- data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +10 -6
- data/lib/ooxml_parser/common_parser/common_data/font_style.rb +1 -61
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +33 -26
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_document_object_helper.rb +97 -0
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +23 -37
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +71 -23
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/language.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +11 -7
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/position.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_spacing.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_style.rb +25 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +38 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/size.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +92 -40
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +12 -8
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +37 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +53 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +6 -6
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list/presentation_tab.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs/paragraph_tab.rb +26 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +36 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb +11 -8
- data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +20 -12
- data/lib/ooxml_parser/common_parser/common_data/relationships/relationship.rb +13 -7
- data/lib/ooxml_parser/common_parser/common_data/relationships.rb +36 -4
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +12 -8
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +18 -19
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +9 -8
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +17 -14
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +16 -23
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +21 -40
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_column_band_size.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +50 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_row_band_size.rb +23 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +28 -23
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties/vertical_merge.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +71 -69
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb +18 -10
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +19 -17
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +31 -48
- 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 +25 -19
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties/table_row_height.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +20 -10
- data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +20 -16
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid/grid_column.rb +20 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +27 -3
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb +20 -13
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +54 -37
- data/lib/ooxml_parser/common_parser/common_data/table.rb +23 -17
- data/lib/ooxml_parser/common_parser/common_data/underline.rb +13 -10
- data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +29 -0
- data/lib/ooxml_parser/common_parser/parser.rb +32 -4
- data/lib/ooxml_parser/configuration.rb +3 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comment.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +16 -16
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +18 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb +18 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style/document_style_helper.rb +37 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +43 -14
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/accent.rb +19 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties/argument_size.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +24 -4
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +14 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +27 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +15 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +14 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +23 -7
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +16 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +20 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb +25 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +4 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +36 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_grow.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_limit_location.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb +27 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +19 -5
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +52 -183
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +89 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object/ole_object.rb +23 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object.rb +21 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +24 -17
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +7 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +15 -10
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +43 -245
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb +19 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +24 -65
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/inserted.rb +41 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +146 -172
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +45 -26
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/multilevel_type.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_justification.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_text.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/numbering_format.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/start.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +65 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +42 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition/abstract_numbering_id.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb +31 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +45 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +15 -4
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +24 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +6 -12
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/footnote_properties.rb +32 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +8 -9
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +31 -24
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +61 -64
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +56 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/paragraph_properties_default.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/run_properties_default.rb +20 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults.rb +26 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +19 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +49 -54
- data/lib/ooxml_parser/docx_parser/docx_parser.rb +2 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_helpers.rb +13 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +15 -12
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties/stretch.rb +11 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties.rb +21 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +19 -6
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +27 -16
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +13 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +11 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +19 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +17 -12
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +15 -14
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +18 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +9 -11
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition.rb +16 -13
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing.rb +23 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +21 -19
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +15 -11
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +52 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +13 -7
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action.rb +11 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +13 -15
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb +9 -14
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +30 -67
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb +11 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +6 -3
- data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +1 -1
- data/lib/ooxml_parser/version.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +28 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +33 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +25 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +38 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +35 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +38 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb +24 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +47 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +36 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_helpers.rb +11 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +11 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +8 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb +12 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +12 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +29 -8
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/x14_table.rb +24 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb +21 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +30 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb +29 -10
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb +25 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +23 -29
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/alignment.rb +15 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style.rb +70 -37
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +16 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +31 -9
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +34 -12
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +20 -9
- data/lib/ooxml_parser/xlsx_parser/xlsx_parser.rb +1 -1
- data/lib/ooxml_parser.rb +0 -1
- metadata +122 -58
- data/lib/ooxml_parser/common_parser/common_data/alingment.rb +0 -56
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2007_chart_style.rb +0 -17
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2010_chart_style.rb +0 -17
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_group_element.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_grouped_drawing.rb +0 -34
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_gradient_color.rb +0 -30
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_single_gradient_color.rb +0 -6
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/solid_color/docx_solid_color.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_element.rb +0 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end/line_size.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_style/docx_shape_style.rb +0 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/common_non_visual_properties.rb +0 -25
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_properties.rb +0 -19
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_shape_properties.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape.rb +0 -28
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_placeholder.rb +0 -18
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/ooxml_shift.rb +0 -15
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/transform_effect.rb +0 -28
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties.rb +0 -13
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/ooxml_text_box.rb +0 -26
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb +0 -23
- data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching/fill_rectangle.rb +0 -22
- data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching.rb +0 -12
- data/lib/ooxml_parser/common_parser/common_data/colors/image_properties.rb +0 -16
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/strikeout.rb +0 -16
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties/numbering_level.rb +0 -25
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties.rb +0 -69
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering.rb +0 -18
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_cell_margin.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_elements.rb +0 -21
- data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/line_join.rb +0 -19
- data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/table_cell_style.rb +0 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/operator.rb +0 -13
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/bookmark.rb +0 -10
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/paragraph_tab.rb +0 -19
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/style_parametres.rb +0 -35
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style.rb +0 -56
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/image.rb +0 -15
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/size.rb +0 -84
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping/grouping_properties.rb +0 -16
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character/excel_comment_character_properties.rb +0 -27
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character.rb +0 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position/xlsx_drawing_position_parameters.rb +0 -22
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position.rb +0 -22
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_shape_grouping.rb +0 -37
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/foreground_color.rb +0 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/ooxml_font.rb +0 -36
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_table.rb +0 -30
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
# noinspection RubyTooManyInstanceVariablesInspection
|
2
|
+
require_relative 'docx_paragraph_run/docx_paragraph_run_helpers'
|
3
|
+
require_relative 'docx_paragraph_run/object'
|
2
4
|
require_relative 'docx_paragraph_run/text_outline'
|
3
5
|
require_relative 'docx_paragraph_run/text_fill'
|
4
6
|
require_relative 'docx_paragraph_run/shape'
|
5
7
|
|
6
8
|
module OoxmlParser
|
7
9
|
class DocxParagraphRun < OOXMLDocumentObject
|
10
|
+
include DocxParagraphRunHelpers
|
8
11
|
attr_accessor :number, :font, :vertical_align, :size, :font_color, :background_color, :font_style, :text, :drawings,
|
9
|
-
:link, :highlight, :
|
10
|
-
:position, :
|
12
|
+
:link, :highlight, :effect, :caps, :w,
|
13
|
+
:position, :em, :spacing, :break, :touch, :shape, :footnote, :endnote, :fld_char, :style,
|
11
14
|
:comments, :alternate_content, :page_number, :text_outline, :text_fill
|
12
15
|
# @return [String] type of instruction used for upper level of run
|
13
16
|
# http://officeopenxml.com/WPfieldInstructions.php
|
14
17
|
attr_accessor :instruction
|
18
|
+
# @return [RunProperties] properties of run
|
19
|
+
attr_accessor :run_properties
|
20
|
+
# @return [RunObject] object of run
|
21
|
+
attr_accessor :object
|
15
22
|
|
16
23
|
def initialize
|
17
24
|
@number = 0
|
@@ -25,18 +32,11 @@ module OoxmlParser
|
|
25
32
|
@drawings = []
|
26
33
|
@link = nil
|
27
34
|
@highlight = nil
|
28
|
-
@shadow = nil
|
29
|
-
@outline = nil
|
30
|
-
@imprint = nil
|
31
|
-
@emboss = nil
|
32
|
-
@vanish = nil
|
33
35
|
@effect = nil
|
34
36
|
@caps = nil
|
35
37
|
@w = false
|
36
38
|
@position = 0.0
|
37
|
-
@rtl = false
|
38
39
|
@em = nil
|
39
|
-
@cs = false
|
40
40
|
@spacing = 0.0
|
41
41
|
@break = false
|
42
42
|
@touch = nil
|
@@ -50,6 +50,7 @@ module OoxmlParser
|
|
50
50
|
@text_outline = nil
|
51
51
|
@text_fill = nil
|
52
52
|
@instruction = nil
|
53
|
+
@object = nil
|
53
54
|
end
|
54
55
|
|
55
56
|
def drawing
|
@@ -70,20 +71,12 @@ module OoxmlParser
|
|
70
71
|
character.drawings = @drawings.clone
|
71
72
|
character.link = @link
|
72
73
|
character.highlight = @highlight
|
73
|
-
character.shadow = @shadow
|
74
|
-
character.outline = @outline
|
75
|
-
character.imprint = @imprint
|
76
|
-
character.emboss = @emboss
|
77
|
-
character.vanish = @vanish
|
78
74
|
character.effect = @effect
|
79
75
|
character.caps = @caps
|
80
76
|
character.w = @w
|
81
77
|
character.position = @position
|
82
|
-
character.rtl = @rtl
|
83
78
|
character.em = @em
|
84
|
-
character.cs = @cs
|
85
79
|
character.spacing = @spacing
|
86
|
-
character.cs = @cs
|
87
80
|
character.break = @break
|
88
81
|
character.touch = @touch
|
89
82
|
character.footnote = @footnote
|
@@ -96,6 +89,8 @@ module OoxmlParser
|
|
96
89
|
character.text_outline = @text_outline
|
97
90
|
character.text_fill = @text_fill
|
98
91
|
character.instruction = @instruction
|
92
|
+
character.run_properties = @run_properties
|
93
|
+
character.object = @object
|
99
94
|
character
|
100
95
|
end
|
101
96
|
|
@@ -111,249 +106,62 @@ module OoxmlParser
|
|
111
106
|
true
|
112
107
|
end
|
113
108
|
|
114
|
-
def
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
break if style.nil?
|
119
|
-
style.xpath('w:rPr').each do |style_rpr|
|
120
|
-
character_style = parse(style_rpr, character_style, default_character)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
character_pr_tag.xpath('w:rFonts').each do |r_font|
|
124
|
-
r_font.attributes.each do |font_attribute, value|
|
125
|
-
case font_attribute
|
126
|
-
when 'asciiTheme'
|
127
|
-
character_style.font = parse_font_by_theme(r_font.attribute('asciiTheme').value)
|
128
|
-
when 'ascii' # , 'hAnsi', 'eastAsia', 'cs'
|
129
|
-
character_style.font = value.value
|
130
|
-
break
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
character_pr_tag.xpath('w:highlight').each do |highlight|
|
135
|
-
character_style.highlight = highlight.attribute('val').value
|
136
|
-
end
|
137
|
-
character_pr_tag.xpath('w:vertAlign').each do |vertical_align|
|
138
|
-
character_style.vertical_align = vertical_align.attribute('val').value.to_sym
|
139
|
-
end
|
140
|
-
character_pr_tag.xpath('w:szCs').each do |sz|
|
141
|
-
character_style.size = sz.attribute('val').value.to_i / 2.0
|
142
|
-
end
|
143
|
-
character_pr_tag.xpath('w:sz').each do |sz|
|
144
|
-
character_style.size = sz.attribute('val').value.to_i / 2.0
|
145
|
-
end
|
146
|
-
character_pr_tag.xpath('w:color').each do |color|
|
147
|
-
color.attributes.each do |key, value|
|
148
|
-
case key
|
149
|
-
when 'val'
|
150
|
-
character_style.font_color = Color.from_int16(value.value)
|
151
|
-
when 'themeColor'
|
152
|
-
unless ThemeColors.list[value.value.to_sym].nil?
|
153
|
-
if value.value == 'text2' || value.value == 'background2' || value.value.include?('accent') # Don't know why. Just works
|
154
|
-
break
|
155
|
-
else
|
156
|
-
character_style.font_color = ThemeColors.list[value.value.to_sym].dup
|
157
|
-
end
|
158
|
-
end
|
159
|
-
when 'themeShade'
|
160
|
-
character_style.font_color.calculate_with_shade!(value.value.hex.to_f / 255.0)
|
161
|
-
when 'themeTint'
|
162
|
-
character_style.font_color.calculate_with_tint!(1.0 - (value.value.hex.to_f / 255.0))
|
163
|
-
end
|
164
|
-
end
|
165
|
-
end
|
166
|
-
character_pr_tag.xpath('w:shd').each do |shd|
|
167
|
-
character_style.background_color = shd.attribute('fill').value
|
168
|
-
unless shd.attribute('fill').value == 'auto' || shd.attribute('fill').value == '' || shd.attribute('fill').value == 'null'
|
169
|
-
character_style.background_color = Color.from_int16(shd.attribute('fill').value)
|
170
|
-
end
|
171
|
-
end
|
172
|
-
character_pr_tag.xpath('w:uCs').each do |u|
|
173
|
-
character_style.font_style.underlined = Underline.new
|
174
|
-
if !u.attribute('val').nil? && u.attribute('val').value != 'none' && u.attribute('val').value != false
|
175
|
-
character_style.font_style.underlined.style = u.attribute('val').value
|
176
|
-
unless u.attribute('color').nil?
|
177
|
-
character_style.font_style.underlined.color = Color.from_int16(u.attribute('color').value)
|
178
|
-
end
|
179
|
-
else
|
180
|
-
character_style.font_style.underlined = Underline.new
|
181
|
-
end
|
182
|
-
end
|
183
|
-
character_pr_tag.xpath('w:u').each do |u|
|
184
|
-
character_style.font_style.underlined = Underline.new
|
185
|
-
if !u.attribute('val').nil? && u.attribute('val').value != 'none' && u.attribute('val').value != false
|
186
|
-
character_style.font_style.underlined.style = u.attribute('val').value
|
187
|
-
unless u.attribute('color').nil?
|
188
|
-
character_style.font_style.underlined.color = Color.from_int16(u.attribute('color').value)
|
189
|
-
end
|
190
|
-
else
|
191
|
-
character_style.font_style.underlined = Underline.new
|
192
|
-
end
|
193
|
-
end
|
194
|
-
character_pr_tag.xpath('w:bCs').each do |b|
|
195
|
-
character_style.font_style.bold = if b.attribute('val').nil? || b.attribute('val').value != 'false'
|
196
|
-
true
|
197
|
-
else
|
198
|
-
false
|
199
|
-
end
|
200
|
-
end
|
201
|
-
character_pr_tag.xpath('w:b').each do |b|
|
202
|
-
character_style.font_style.bold = if b.attribute('val').nil? || b.attribute('val').value != 'false'
|
203
|
-
true
|
204
|
-
else
|
205
|
-
false
|
206
|
-
end
|
207
|
-
end
|
208
|
-
character_pr_tag.xpath('w:iCs').each do |i|
|
209
|
-
next if i.attribute('val').nil?
|
210
|
-
character_style.font_style.italic = if i.attribute('val').value != 'false'
|
211
|
-
true
|
212
|
-
else
|
213
|
-
false
|
214
|
-
end
|
215
|
-
end
|
216
|
-
character_pr_tag.xpath('w:i').each do |i|
|
217
|
-
character_style.font_style.italic = if i.attribute('val').nil? || i.attribute('val').value != 'false'
|
218
|
-
true
|
219
|
-
else
|
220
|
-
false
|
221
|
-
end
|
222
|
-
end
|
223
|
-
character_pr_tag.xpath('w:strike').each do |strike|
|
224
|
-
character_style.font_style.strike = if strike.attribute('val').nil? || strike.attribute('val').value != 'false' && strike.attribute('val').value != '0'
|
225
|
-
:single
|
226
|
-
else
|
227
|
-
:none
|
228
|
-
end
|
229
|
-
end
|
230
|
-
character_pr_tag.xpath('w:dstrike').each do |dstrike|
|
231
|
-
if dstrike.attribute('val').nil?
|
232
|
-
character_style.font_style.strike = :double
|
233
|
-
elsif dstrike.attribute('val').value == '0' || dstrike.attribute('val').value == 'false'
|
234
|
-
else
|
235
|
-
character_style.font_style.strike = :double
|
236
|
-
end
|
237
|
-
end
|
238
|
-
character_pr_tag.xpath('w:shadow').each do
|
239
|
-
character_style.shadow = true
|
240
|
-
end
|
241
|
-
character_pr_tag.xpath('w:outline').each do
|
242
|
-
character_style.outline = true
|
243
|
-
end
|
244
|
-
character_pr_tag.xpath('w:imprint').each do
|
245
|
-
character_style.imprint = true
|
246
|
-
end
|
247
|
-
character_pr_tag.xpath('w:emboss').each do
|
248
|
-
character_style.emboss = true
|
249
|
-
end
|
250
|
-
character_pr_tag.xpath('w:vanish').each do
|
251
|
-
character_style.vanish = true
|
252
|
-
end
|
253
|
-
character_pr_tag.xpath('w:effect').each do |effect|
|
254
|
-
character_style.effect = effect.attribute('val').value
|
255
|
-
end
|
256
|
-
character_pr_tag.xpath('w:caps').each do |caps|
|
257
|
-
if caps.attribute('val').nil?
|
258
|
-
character_style.caps = :caps
|
259
|
-
elsif caps.attribute('val').value == 'false'
|
260
|
-
else
|
261
|
-
character_style.caps = :caps
|
262
|
-
end
|
263
|
-
end
|
264
|
-
character_pr_tag.xpath('w:smallCaps').each do |small_caps|
|
265
|
-
if small_caps.attribute('val').nil?
|
266
|
-
character_style.caps = :small_caps
|
267
|
-
elsif small_caps.attribute('val').value == 'false'
|
268
|
-
else
|
269
|
-
character_style.caps = :small_caps
|
270
|
-
end
|
271
|
-
end
|
272
|
-
character_pr_tag.xpath('w:position').each do |position|
|
273
|
-
character_style.position = (position.attribute('val').value.to_f / (28.0 + 1.0 / 3.0) / 2.0).round(1)
|
274
|
-
end
|
275
|
-
character_pr_tag.xpath('w:rtl').each do |rtl|
|
276
|
-
character_style.rtl = OOXMLDocumentObject.option_enabled?(rtl)
|
277
|
-
end
|
278
|
-
character_pr_tag.xpath('w:em').each do |em|
|
279
|
-
character_style.em = em.attribute('val').value
|
280
|
-
end
|
281
|
-
character_pr_tag.xpath('w:cs').each do |cs|
|
282
|
-
character_style.cs = OOXMLDocumentObject.option_enabled?(cs)
|
283
|
-
end
|
284
|
-
character_pr_tag.xpath('w:spacing').each do |spacing|
|
285
|
-
character_style.spacing = (spacing.attribute('val').value.to_f / 566.9).round(1)
|
286
|
-
end
|
287
|
-
character_pr_tag.xpath('w14:textOutline', 'xmlns:w14' => 'http://schemas.microsoft.com/office/word/2010/wordml').each do |text_outline|
|
288
|
-
character_style.text_outline = TextOutline.parse(text_outline)
|
289
|
-
text_outline.xpath('w14:prstDash', 'xmlns:w14' => 'http://schemas.microsoft.com/office/word/2010/wordml').each do |outline_style|
|
290
|
-
character_style.touch = outline_style.attribute('val').value
|
291
|
-
end
|
292
|
-
end
|
293
|
-
character_pr_tag.xpath('w14:textFill', 'xmlns:w14' => 'http://schemas.microsoft.com/office/word/2010/wordml').each do |text_fill|
|
294
|
-
character_style.text_fill = TextFill.parse(text_fill)
|
295
|
-
end
|
296
|
-
character_style
|
297
|
-
end
|
298
|
-
|
299
|
-
def self.parse_character(r_tag, character_style, char_number)
|
300
|
-
r_tag.xpath('*').each do |r_node_child|
|
301
|
-
case r_node_child.name
|
109
|
+
def parse(r_tag, char_number, parent: nil)
|
110
|
+
@parent = parent
|
111
|
+
r_tag.xpath('*').each do |node_child|
|
112
|
+
case node_child.name
|
302
113
|
when 'rPr'
|
303
|
-
|
114
|
+
parse_properties(node_child, DocumentStructure.default_run_style)
|
115
|
+
@run_properties = RunProperties.new(parent: self).parse(node_child)
|
304
116
|
when 'instrText'
|
305
|
-
if
|
306
|
-
hyperlink = Hyperlink.new(
|
307
|
-
|
308
|
-
elsif
|
309
|
-
|
117
|
+
if node_child.text.include?('HYPERLINK')
|
118
|
+
hyperlink = Hyperlink.new(node_child.text.sub('HYPERLINK ', '').split(' \\o ').first, node_child.text.sub('HYPERLINK', '').split(' \\o ').last)
|
119
|
+
@link = hyperlink
|
120
|
+
elsif node_child.text[/PAGE\s+\\\*/]
|
121
|
+
@text = '*PAGE NUMBER*'
|
310
122
|
end
|
311
123
|
when 'fldChar'
|
312
|
-
|
124
|
+
@fld_char = node_child.attribute('fldCharType').value.to_sym
|
313
125
|
when 't'
|
314
|
-
|
126
|
+
@text += node_child.text
|
315
127
|
when 'noBreakHyphen'
|
316
|
-
|
128
|
+
@text += '–'
|
317
129
|
when 'tab'
|
318
|
-
|
130
|
+
@text += "\t"
|
319
131
|
when 'drawing'
|
320
|
-
|
132
|
+
@drawings << DocxDrawing.new(parent: self).parse(node_child)
|
321
133
|
when 'AlternateContent'
|
322
|
-
|
134
|
+
@alternate_content = AlternateContent.new(parent: self).parse(node_child)
|
323
135
|
when 'br'
|
324
|
-
if
|
325
|
-
|
326
|
-
|
136
|
+
if node_child.attribute('type').nil?
|
137
|
+
@break = :line
|
138
|
+
@text += "\r"
|
327
139
|
else
|
328
|
-
case
|
140
|
+
case node_child.attribute('type').value
|
329
141
|
when 'page', 'column'
|
330
|
-
|
142
|
+
@break = node_child.attribute('type').value.to_sym
|
331
143
|
end
|
332
144
|
end
|
333
145
|
when 'footnoteReference'
|
334
|
-
|
335
|
-
character_style.footnote.id = r_node_child.attribute('id').value.to_i
|
336
|
-
character_style.footnote.parse('footnote', character_style.footnote.id, @default_paragraph, @default_character)
|
146
|
+
@footnote = HeaderFooter.new(parent: self).parse(node_child)
|
337
147
|
when 'endnoteReference'
|
338
|
-
|
339
|
-
character_style.endnote.id = r_node_child.attribute('id').value.to_i
|
340
|
-
character_style.endnote.parse('endnote', character_style.endnote.id, @default_paragraph, @default_character)
|
148
|
+
@endnote = HeaderFooter.new(parent: self).parse(node_child)
|
341
149
|
when 'pict'
|
342
|
-
|
150
|
+
node_child.xpath('*').each do |pict_node_child|
|
343
151
|
case pict_node_child.name
|
344
152
|
when 'shape'
|
345
|
-
|
153
|
+
@shape = Shape.new(parent: self).parse(pict_node_child, :shape)
|
346
154
|
when 'rect'
|
347
|
-
|
155
|
+
@shape = Shape.new(parent: self).parse(pict_node_child, :rectangle)
|
348
156
|
when 'oval'
|
349
|
-
|
350
|
-
when 'shapetype'
|
157
|
+
@shape = Shape.new(parent: self).parse(pict_node_child, :oval)
|
351
158
|
end
|
352
159
|
end
|
160
|
+
when 'object'
|
161
|
+
@object = RunObject.new(parent: self).parse(node_child)
|
353
162
|
end
|
354
163
|
end
|
355
|
-
|
356
|
-
character_style
|
164
|
+
@number = char_number
|
357
165
|
end
|
358
166
|
|
359
167
|
def self.parse_font_by_theme(theme)
|
@@ -374,15 +182,5 @@ module OoxmlParser
|
|
374
182
|
end
|
375
183
|
end
|
376
184
|
end
|
377
|
-
|
378
|
-
def self.get_style_by_id(id)
|
379
|
-
doc = Nokogiri::XML(File.open("#{OOXMLDocumentObject.path_to_folder}/#{OOXMLDocumentObject.root_subfolder}/styles.xml"))
|
380
|
-
doc.search('//w:styles').each do |styles|
|
381
|
-
styles.xpath('w:style').each do |style|
|
382
|
-
return style if style.attribute('styleId').value == id
|
383
|
-
end
|
384
|
-
end
|
385
|
-
nil
|
386
|
-
end
|
387
185
|
end
|
388
186
|
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb
CHANGED
@@ -1,46 +1,45 @@
|
|
1
1
|
module OoxmlParser
|
2
|
-
class FrameProperties
|
2
|
+
class FrameProperties < OOXMLDocumentObject
|
3
3
|
attr_accessor :drop_cap, :lines, :wrap, :vertical_anchor, :horizontal_anchor, :width, :height, :height_rule,
|
4
4
|
:horizontal_align, :vertical_align, :anchor_lock, :vertical_space, :horizontal_space,
|
5
5
|
:horizontal_position, :vertical_position
|
6
6
|
|
7
|
-
def
|
8
|
-
|
9
|
-
frame_pr_node.attributes.each do |key, value|
|
7
|
+
def parse(node)
|
8
|
+
node.attributes.each do |key, value|
|
10
9
|
case key
|
11
10
|
when 'dropCap'
|
12
|
-
|
11
|
+
@drop_cap = value.value.to_sym
|
13
12
|
when 'lines'
|
14
|
-
|
13
|
+
@lines = value.value.to_i
|
15
14
|
when 'wrap'
|
16
|
-
|
15
|
+
@lines = value.value.to_sym
|
17
16
|
when 'vAnchor'
|
18
|
-
|
17
|
+
@vertical_anchor = value.value.to_sym
|
19
18
|
when 'hAnchor'
|
20
|
-
|
19
|
+
@horizontal_anchor = value.value.to_sym
|
21
20
|
when 'w'
|
22
|
-
|
21
|
+
@width = OoxmlSize.new(value.value.to_f)
|
23
22
|
when 'h'
|
24
|
-
|
23
|
+
@height = OoxmlSize.new(value.value.to_f)
|
25
24
|
when 'hRule'
|
26
|
-
|
25
|
+
@height_rule = value.value.to_s.sub('atLeast', 'at_least').to_sym
|
27
26
|
when 'xAlign'
|
28
|
-
|
27
|
+
@horizontal_align = value.value.to_sym
|
29
28
|
when 'yAlign'
|
30
|
-
|
29
|
+
@vertical_align = value.value.to_sym
|
31
30
|
when 'anchorLock'
|
32
|
-
|
31
|
+
@anchor_lock = attribute_enabled?(value)
|
33
32
|
when 'vSpace'
|
34
|
-
|
33
|
+
@vertical_space = OoxmlSize.new(value.value.to_f)
|
35
34
|
when 'hSpace'
|
36
|
-
|
35
|
+
@horizontal_space = OoxmlSize.new(value.value.to_f)
|
37
36
|
when 'x'
|
38
|
-
|
37
|
+
@horizontal_position = OoxmlSize.new(value.value.to_f)
|
39
38
|
when 'y'
|
40
|
-
|
39
|
+
@vertical_position = OoxmlSize.new(value.value.to_f)
|
41
40
|
end
|
42
41
|
end
|
43
|
-
|
42
|
+
self
|
44
43
|
end
|
45
44
|
end
|
46
45
|
end
|
@@ -1,87 +1,46 @@
|
|
1
1
|
module OoxmlParser
|
2
|
-
class Indents
|
2
|
+
class Indents < OOXMLDocumentObject
|
3
3
|
attr_accessor :first_line_indent, :left_indent, :right_indent, :hanging_indent
|
4
4
|
|
5
|
-
def initialize(first_line_indent =
|
5
|
+
def initialize(first_line_indent = OoxmlSize.new(0),
|
6
|
+
left_indent = OoxmlSize.new(0),
|
7
|
+
right_indent = OoxmlSize.new(0),
|
8
|
+
hanging_indent = OoxmlSize.new(0),
|
9
|
+
parent: nil)
|
6
10
|
@first_line_indent = first_line_indent
|
7
11
|
@left_indent = left_indent
|
8
12
|
@right_indent = right_indent
|
9
13
|
@hanging_indent = hanging_indent
|
14
|
+
@parent = parent
|
10
15
|
end
|
11
16
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
@right_indent.to_f.round(1) == other.right_indent.to_f.round(1)
|
17
|
-
return true if @hanging_indent.nil? || other.hanging_indent.nil?
|
18
|
-
@hanging_indent.to_f == other.hanging_indent.to_f
|
19
|
-
else
|
20
|
-
false
|
21
|
-
end
|
22
|
-
else
|
23
|
-
is_a?(NilClass) && other.is_a?(NilClass)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def equal_with_round(other, delta = 0.02)
|
28
|
-
if is_a?(NilClass) && other.is_a?(NilClass)
|
29
|
-
true
|
30
|
-
else
|
31
|
-
@first_line_indent.to_f.round(2) == other.first_line_indent.to_f.round(2) &&
|
32
|
-
@left_indent.to_f.round(2) == other.left_indent.to_f.round(2) &&
|
33
|
-
@right_indent.to_f.round(2) == other.right_indent.to_f.round(2) &&
|
34
|
-
(@hanging_indent.to_f.round(2) - other.hanging_indent.to_f.round(2)).to_f.abs < delta
|
35
|
-
end
|
36
|
-
end
|
17
|
+
alias first_line first_line_indent
|
18
|
+
alias left left_indent
|
19
|
+
alias right right_indent
|
20
|
+
alias hanging hanging_indent
|
37
21
|
|
38
22
|
def to_s
|
39
23
|
"first line indent: #{@first_line_indent}, left indent: #{@left_indent},
|
40
24
|
right indent: #{@right_indent}, hanging indent: #{@hanging_indent}"
|
41
25
|
end
|
42
26
|
|
43
|
-
# Parse hash with indents
|
44
|
-
# @return [Indents] parsed class
|
45
|
-
def self.parse_indents_hash(hash)
|
46
|
-
Indents.new(hash['first_line_indent'], hash['left_indent'], hash['right_indent'], hash['hanging_indent'])
|
47
|
-
end
|
48
|
-
|
49
|
-
# Increases indent, depending on clicks to "increase indent" button in canvas
|
50
|
-
# @param [Integer] count count of clicks (default = 1)
|
51
|
-
def increase_indent_by_button(count = 1)
|
52
|
-
count.times { @left_indent += 1.25 }
|
53
|
-
end
|
54
|
-
|
55
|
-
# @return [Indents
|
56
|
-
def copy
|
57
|
-
Indents.new(@first_line_indent, @left_indent, @right_indent, @hanging_indent)
|
58
|
-
end
|
59
|
-
|
60
|
-
def round(digits_after_dot = 0)
|
61
|
-
[:first_line_indent, :left_indent, :right_indent, :hanging_indent].each do |ind|
|
62
|
-
send("#{ind}=", send(ind).round(digits_after_dot)) unless send(ind).nil?
|
63
|
-
end
|
64
|
-
self
|
65
|
-
end
|
66
|
-
|
67
27
|
# Parse Indents
|
68
28
|
# @param [Nokogiri::XML:Element] node with Indents
|
69
29
|
# @return [Indents] value of Indents
|
70
|
-
def
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
indents.hanging_indent = (node.attribute('hanging').value.to_f / 566.9).round(2)
|
30
|
+
def parse(node)
|
31
|
+
node.attributes.each do |key, value|
|
32
|
+
case key
|
33
|
+
when 'firstLine'
|
34
|
+
@first_line_indent = OoxmlSize.new(value.value.to_f)
|
35
|
+
when 'left'
|
36
|
+
@left_indent = OoxmlSize.new(value.value.to_f)
|
37
|
+
when 'right'
|
38
|
+
@right_indent = OoxmlSize.new(value.value.to_f)
|
39
|
+
when 'hanging'
|
40
|
+
@hanging_indent = OoxmlSize.new(value.value.to_f)
|
41
|
+
end
|
83
42
|
end
|
84
|
-
|
43
|
+
self
|
85
44
|
end
|
86
45
|
end
|
87
46
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module OoxmlParser
|
2
|
+
# Class for parsing `w:ins` tag - Inserted Run Content
|
3
|
+
class Inserted < OOXMLDocumentObject
|
4
|
+
# @return [Integer] id of inserted
|
5
|
+
attr_accessor :id
|
6
|
+
# @return [String] author of insert
|
7
|
+
attr_accessor :author
|
8
|
+
# @return [Date] date of insert
|
9
|
+
attr_accessor :date
|
10
|
+
# @return [String] id of user
|
11
|
+
attr_accessor :user_id
|
12
|
+
# @return [ParagraphRun] inserted run
|
13
|
+
attr_accessor :run
|
14
|
+
|
15
|
+
# Parse Inserted object
|
16
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
17
|
+
# @return [Inserted] result of parsing
|
18
|
+
def parse(node)
|
19
|
+
node.attributes.each do |key, value|
|
20
|
+
case key
|
21
|
+
when 'id'
|
22
|
+
@id = value.value.to_i
|
23
|
+
when 'author'
|
24
|
+
@author = value.value.to_s
|
25
|
+
when 'date'
|
26
|
+
@date = DateTime.parse(value.value.to_s)
|
27
|
+
when 'oouserid'
|
28
|
+
@user_id = value.value.to_s
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
node.xpath('*').each do |node_child|
|
33
|
+
case node_child.name
|
34
|
+
when 'r'
|
35
|
+
@run = ParagraphRun.new(parent: self).parse(node_child)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
self
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Style Parameter Data
|
2
|
+
module OoxmlParser
|
3
|
+
class StyleParametres < OOXMLDocumentObject
|
4
|
+
attr_accessor :q_format, :hidden, :name
|
5
|
+
|
6
|
+
def initialize(name = nil,
|
7
|
+
q_format = false,
|
8
|
+
hidden = false,
|
9
|
+
parent: nil)
|
10
|
+
@name = name
|
11
|
+
@q_format = q_format
|
12
|
+
@hidden = hidden
|
13
|
+
@parent = parent
|
14
|
+
end
|
15
|
+
|
16
|
+
# Parse StyleParametres data
|
17
|
+
# @param [Nokogiri::XML:Element] node with StyleParametres data
|
18
|
+
# @return [StyleParametres] value of Columns data
|
19
|
+
def parse(node)
|
20
|
+
node.xpath('*').each do |node_child|
|
21
|
+
case node_child.name
|
22
|
+
when 'name'
|
23
|
+
@name = node_child.attribute('val').value
|
24
|
+
when 'qFormat'
|
25
|
+
@q_format = option_enabled?(node_child)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
self
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|