ooxml_parser 0.4.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ooxml_parser.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +39 -4
- 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/pivot_formats/pivot_format.rb +26 -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/plot_area/common_chart_data.rb +31 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb +22 -9
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text.rb +5 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/{string_reference.rb → number_string_reference.rb} +9 -7
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/{string_cache.rb → number_string_cache.rb} +11 -6
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point.rb +9 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point/text_value.rb +2 -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/view_3d.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis/scaling.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +7 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_point.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +6 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing/doc_properties.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +5 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +12 -8
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +26 -14
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative/picture_dimension.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_vertical.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +8 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +2 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +7 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties.rb +3 -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 +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb +2 -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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +3 -3
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb +42 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/effect_reference.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/fill_reference.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/font_reference.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/line_reference.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +2 -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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +5 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +4 -2
- 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 +2 -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 +2 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +6 -2
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +4 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip.rb +2 -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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry.rb +2 -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 +2 -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 +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +12 -11
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +11 -5
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_element.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_properties.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +3 -3
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +3 -3
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +25 -9
- data/lib/ooxml_parser/common_parser/common_data/color.rb +119 -71
- data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +25 -21
- data/lib/ooxml_parser/common_parser/common_data/color/ooxml_color.rb +12 -3
- data/lib/ooxml_parser/common_parser/common_data/colors/color_alpha_channel.rb +4 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +23 -8
- data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +6 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +5 -3
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +4 -2
- data/lib/ooxml_parser/common_parser/common_data/colors/scheme_color.rb +6 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb +18 -14
- data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/content_types.rb +38 -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/coordinates.rb +18 -6
- data/lib/ooxml_parser/common_parser/common_data/font_style.rb +3 -2
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +4 -2
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +42 -3
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_document_object_helper.rb +107 -116
- 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/paragraph.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +27 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +9 -16
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/position.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_spacing.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_style.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +9 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/size.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/text.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb +5 -3
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +25 -35
- 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/tabs.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs/tab.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/relationships.rb +24 -19
- data/lib/ooxml_parser/common_parser/common_data/relationships/relationship.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table.rb +5 -0
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +6 -8
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +10 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +10 -2
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +19 -17
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_column_band_size.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +3 -0
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +8 -5
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_row_band_size.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +4 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +11 -11
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/grid_span.rb +35 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +27 -39
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line/line_join.rb +4 -4
- data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +5 -2
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties/table_row_height.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +5 -0
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid/grid_column.rb +3 -1
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +26 -4
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_data/underline.rb +6 -0
- data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +2 -0
- data/lib/ooxml_parser/common_parser/common_document_structure.rb +17 -0
- data/lib/ooxml_parser/common_parser/parser.rb +6 -2
- data/lib/ooxml_parser/configuration.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +100 -41
- 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/comment.rb +37 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended.rb +4 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended/comment_extended.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +3 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +6 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb +2 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +11 -12
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style/document_style_helper.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +93 -82
- 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.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/accent.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties/argument_size.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +4 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_grow.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_limit_location.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb +5 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +4 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_helper.rb +11 -6
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +30 -23
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +15 -4
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object/ole_object.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +39 -8
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_margins.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_size.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/stroke.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +2 -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 +6 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +5 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/inserted.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_content.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_properties.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/structured_document_tag.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +3 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +4 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +12 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/multilevel_type.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +3 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_justification.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_text.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/numbering_format.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb +4 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +7 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/footnote_properties.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +16 -14
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +10 -8
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +3 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +5 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +14 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/paragraph_properties_default.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/run_properties_default.rb +2 -0
- data/lib/ooxml_parser/docx_parser/docx_parser.rb +6 -0
- data/lib/ooxml_parser/helpers/string_helper.rb +3 -1
- data/lib/ooxml_parser/name.rb +9 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +32 -37
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/comment_authors.rb +39 -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/presentation_comments.rb +33 -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_helpers.rb +3 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +12 -3
- 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/font_scheme/font_collection.rb +31 -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/theme_color.rb +14 -8
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +11 -4
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +4 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties/stretch.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data/shape_tree.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/connection_shape.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +5 -2
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +2 -4
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_notes.rb +3 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +3 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +3 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +3 -9
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +3 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +7 -4
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing.rb +6 -3
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/{condition.rb → codition_list/condition.rb} +3 -9
- 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_helper.rb +19 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +6 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action.rb +5 -5
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb +8 -2
- 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_size.rb +2 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/table_styles.rb +38 -0
- data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +7 -1
- data/lib/ooxml_parser/version.rb +4 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +57 -38
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +6 -1
- 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_cache/pivot_cache_definition.rb +37 -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/cache_source/worksheet_source.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/shared_string_table/string_index.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +15 -1
- 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/{worksheet/xlsx_row/xlsx_cell → style_sheet/cell_xfs}/cell_style/alignment.rb +2 -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/fills.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +4 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +5 -3
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +5 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +2 -5
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb +2 -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/xlsx_borders/xlsx_border.rb +34 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_helpers.rb +3 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +56 -25
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +32 -29
- 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 +10 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/ole_objects.rb +2 -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 +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part.rb +8 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column.rb +12 -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/custom_filters/custom_filter.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb +3 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/x14_table.rb +2 -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_columns/table_column.rb +34 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb +2 -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 +12 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +3 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb +2 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +3 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +60 -27
- 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_parser.rb +7 -1
- metadata +147 -29
- data/LICENSE.txt +0 -661
- data/README.md +0 -43
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/order.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_index.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point_count.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop/preset_color.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/language.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties/vertical_merge.rb +0 -20
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb +0 -30
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comment.rb +0 -28
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark.rb +0 -21
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/start.rb +0 -20
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition/abstract_numbering_id.rb +0 -20
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb +0 -31
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment/presentation_comment_author.rb +0 -26
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style.rb +0 -128
@@ -1,12 +1,15 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require_relative 'string_cache/point'
|
3
4
|
module OoxmlParser
|
4
|
-
# Class for parsing `c:tx` object
|
5
|
-
class
|
5
|
+
# Class for parsing `c:tx`, `c:numCache` object
|
6
|
+
class NumberStringCache < OOXMLDocumentObject
|
7
|
+
# @return [String] Format Code
|
8
|
+
attr_reader :format_code
|
6
9
|
# @return [StringReference] String reference of series
|
7
|
-
|
10
|
+
attr_reader :point_count
|
8
11
|
# @return [Array, Point] array of points
|
9
|
-
|
12
|
+
attr_reader :points
|
10
13
|
|
11
14
|
def initialize(parent: nil)
|
12
15
|
@points = []
|
@@ -19,8 +22,10 @@ module OoxmlParser
|
|
19
22
|
def parse(node)
|
20
23
|
node.xpath('*').each do |node_child|
|
21
24
|
case node_child.name
|
25
|
+
when 'formatCode'
|
26
|
+
@format_code = node_child.text
|
22
27
|
when 'ptCount'
|
23
|
-
@point_count =
|
28
|
+
@point_count = ValuedChild.new(:integer, parent: self).parse(node_child)
|
24
29
|
when 'pt'
|
25
30
|
@points << Point.new(parent: self).parse(node_child)
|
26
31
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'point/text_value'
|
2
4
|
module OoxmlParser
|
3
5
|
# Class for parsing `c:pt` object
|
@@ -5,7 +7,12 @@ module OoxmlParser
|
|
5
7
|
# @return [Integer] index of point
|
6
8
|
attr_accessor :index
|
7
9
|
# @return [TextValue] value of text
|
8
|
-
|
10
|
+
attr_reader :value
|
11
|
+
|
12
|
+
alias text value
|
13
|
+
|
14
|
+
extend Gem::Deprecate
|
15
|
+
deprecate :text, 'OoxmlParser::Point#value', 2020, 1
|
9
16
|
|
10
17
|
# Parse PointCount
|
11
18
|
# @param [Nokogiri::XML:Node] node with PointCount
|
@@ -21,7 +28,7 @@ module OoxmlParser
|
|
21
28
|
node.xpath('*').each do |node_child|
|
22
29
|
case node_child.name
|
23
30
|
when 'v'
|
24
|
-
@
|
31
|
+
@value = TextValue.new(parent: self).parse(node_child)
|
25
32
|
end
|
26
33
|
end
|
27
34
|
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/x_y_values.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `c:xVal`, `c:yVal` object
|
5
|
+
class XYValues < OOXMLDocumentObject
|
6
|
+
# @return [NumberReference] number reference
|
7
|
+
attr_reader :number_reference
|
8
|
+
|
9
|
+
# Parse XYValues
|
10
|
+
# @param [Nokogiri::XML:Node] node with XYValues
|
11
|
+
# @return [XYValues] result of parsing
|
12
|
+
def parse(node)
|
13
|
+
node.xpath('*').each do |node_child|
|
14
|
+
case node_child.name
|
15
|
+
when 'numRef'
|
16
|
+
@number_reference = NumberStringReference.new(parent: self).parse(node_child)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
self
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'chart_axis/scaling'
|
2
4
|
require_relative 'chart_axis_title'
|
3
5
|
module OoxmlParser
|
@@ -43,7 +45,7 @@ module OoxmlParser
|
|
43
45
|
@position = value_to_symbol(node_child.attribute('val'))
|
44
46
|
end
|
45
47
|
end
|
46
|
-
@display = false
|
48
|
+
@display = false unless @title.visible?
|
47
49
|
self
|
48
50
|
end
|
49
51
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
2
4
|
# Chart Axis Title `title` node
|
3
5
|
class ChartAxisTitle < OOXMLDocumentObject
|
@@ -8,8 +10,9 @@ module OoxmlParser
|
|
8
10
|
@parent = parent
|
9
11
|
end
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
+
# @return [Boolean] if chart title is visible
|
14
|
+
def visible?
|
15
|
+
@layout || @overlay || !@elements.empty?
|
13
16
|
end
|
14
17
|
|
15
18
|
# Parse ChartAxisTitle object
|
@@ -22,9 +25,9 @@ module OoxmlParser
|
|
22
25
|
node_child.xpath('c:rich/*').each do |rich_node_child|
|
23
26
|
case rich_node_child.name
|
24
27
|
when 'p'
|
25
|
-
|
28
|
+
root_object.default_font_style = FontStyle.new(true) # Default font style for chart title always bold
|
26
29
|
@elements << Paragraph.new(parent: self).parse(rich_node_child)
|
27
|
-
|
30
|
+
root_object.default_font_style = FontStyle.new
|
28
31
|
end
|
29
32
|
end
|
30
33
|
when 'layout'
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
2
4
|
# Cell Range of Chart
|
3
5
|
class ChartCellsRange < OOXMLDocumentObject
|
@@ -15,6 +17,8 @@ module OoxmlParser
|
|
15
17
|
def parse(node)
|
16
18
|
@list = node.xpath('c:f')[0].text.split('!').first
|
17
19
|
coordinates = Coordinates.parser_coordinates_range(node.xpath('c:f')[0].text) # .split('!')[1].gsub('$', ''))
|
20
|
+
return self unless coordinates
|
21
|
+
|
18
22
|
node.xpath('c:numCache/c:pt').each_with_index do |point_node, index|
|
19
23
|
point = ChartPoint.new(coordinates[index])
|
20
24
|
point.value = point_node.xpath('c:v').first.text.to_f unless point_node.xpath('c:v').first.nil?
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
2
4
|
# Legend of Chart `legend` tag
|
3
5
|
class ChartLegend < OOXMLDocumentObject
|
@@ -17,6 +19,7 @@ module OoxmlParser
|
|
17
19
|
# @return [Symbol] overlay and position type
|
18
20
|
def position_with_overlay
|
19
21
|
return "#{@position}_overlay".to_sym if overlay
|
22
|
+
|
20
23
|
@position
|
21
24
|
end
|
22
25
|
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
2
4
|
# Chart Label Properties, parse tag `dLbls`
|
3
5
|
class DisplayLabelsProperties < OOXMLDocumentObject
|
@@ -6,6 +8,8 @@ module OoxmlParser
|
|
6
8
|
attr_accessor :show_category_name
|
7
9
|
# @return [True, False] is series name shown
|
8
10
|
attr_accessor :show_series_name
|
11
|
+
# @return [True, False] is label is deleted
|
12
|
+
attr_reader :delete
|
9
13
|
|
10
14
|
def initialize(show_legend_key = false, show_values = false, parent: nil)
|
11
15
|
@show_legend_key = show_legend_key
|
@@ -29,6 +33,8 @@ module OoxmlParser
|
|
29
33
|
@show_category_name = option_enabled?(node_child)
|
30
34
|
when 'showSerName'
|
31
35
|
@show_series_name = option_enabled?(node_child)
|
36
|
+
when 'delete'
|
37
|
+
@delete = option_enabled?(node_child)
|
32
38
|
end
|
33
39
|
end
|
34
40
|
self
|
@@ -1,8 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
2
4
|
# Docx Drawing Distance From Text
|
3
5
|
class DocxDrawingDistanceFromText < OOXMLDocumentObject
|
4
6
|
attr_accessor :top, :bottom, :left, :right
|
5
7
|
|
8
|
+
# Parse DocxDrawingDistanceFromText object
|
9
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
10
|
+
# @return [DocxDrawingDistanceFromText] result of parsing
|
6
11
|
def parse(node)
|
7
12
|
node.attributes.each do |key, value|
|
8
13
|
case key
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'ooxml_coordinates'
|
2
4
|
require_relative 'ooxml_size'
|
3
5
|
require_relative 'docx_drawing_distance_from_text'
|
4
6
|
require_relative 'docx_drawing_position'
|
5
7
|
require_relative 'docx_wrap_drawing'
|
6
|
-
# Docx Drawing Properties
|
7
8
|
module OoxmlParser
|
9
|
+
# Docx Drawing Properties
|
8
10
|
class DocxDrawingProperties < OOXMLDocumentObject
|
9
11
|
attr_accessor :distance_from_text, :simple_position, :wrap, :object_size, :vertical_position, :horizontal_position,
|
10
12
|
:relative_height
|
@@ -1,21 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module OoxmlParser
|
4
|
+
# Docx Coordinates
|
3
5
|
class OOXMLCoordinates
|
4
6
|
attr_accessor :x, :y
|
5
7
|
|
6
|
-
def initialize(
|
7
|
-
@x = if
|
8
|
-
|
8
|
+
def initialize(x_value, y_value)
|
9
|
+
@x = if x_value.is_a?(OoxmlSize)
|
10
|
+
x_value
|
9
11
|
else
|
10
|
-
OoxmlSize.new(
|
12
|
+
OoxmlSize.new(x_value)
|
11
13
|
end
|
12
|
-
@y = if
|
13
|
-
|
14
|
+
@y = if y_value.is_a?(OoxmlSize)
|
15
|
+
y_value
|
14
16
|
else
|
15
|
-
OoxmlSize.new(
|
17
|
+
OoxmlSize.new(y_value)
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
21
|
+
# @return [String] result of convert of object to string
|
19
22
|
def to_s
|
20
23
|
'(' + @x.to_s + '; ' + @y.to_s + ')'
|
21
24
|
end
|
@@ -35,6 +38,7 @@ module OoxmlParser
|
|
35
38
|
# @return [OOXMLCoordinates] result of parsing
|
36
39
|
def self.parse(position_node, x_attr: 'x', y_attr: 'y', unit: :dxa)
|
37
40
|
return if position_node.attribute(x_attr).nil? || position_node.attribute(y_attr).nil?
|
41
|
+
|
38
42
|
OOXMLCoordinates.new(OoxmlSize.new(position_node.attribute(x_attr).value.to_f, unit),
|
39
43
|
OoxmlSize.new(position_node.attribute(y_attr).value.to_f, unit))
|
40
44
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OoxmlParser
|
2
4
|
# Size of some object
|
3
5
|
class OoxmlSize
|
@@ -26,6 +28,9 @@ module OoxmlParser
|
|
26
28
|
self
|
27
29
|
end
|
28
30
|
|
31
|
+
# Compare this object to other
|
32
|
+
# @param other [Object] any other object
|
33
|
+
# @return [True, False] result of comparision
|
29
34
|
def ==(other)
|
30
35
|
(to_base_unit.value - other.to_base_unit.value).abs < 10**(OoxmlParser.configuration.accuracy + 2)
|
31
36
|
end
|
@@ -34,8 +39,11 @@ module OoxmlParser
|
|
34
39
|
@value.zero?
|
35
40
|
end
|
36
41
|
|
37
|
-
|
38
|
-
|
42
|
+
# @param unit [Symbol] unit in which output should be
|
43
|
+
# @return [String] string representation of size
|
44
|
+
def to_s(unit = :centimeter)
|
45
|
+
converted = to_unit(unit)
|
46
|
+
"#{converted.value.to_f} #{converted.unit}"
|
39
47
|
end
|
40
48
|
|
41
49
|
# Convert all values to one same base unit
|
@@ -55,7 +63,7 @@ module OoxmlParser
|
|
55
63
|
when :one_240th_cm
|
56
64
|
OoxmlSize.new(@value * 1500)
|
57
65
|
when :dxa, :twip
|
58
|
-
|
66
|
+
OoxmlSize.new(@value * 635, :emu)
|
59
67
|
when :inch
|
60
68
|
OoxmlSize.new(@value * 914_400, :emu)
|
61
69
|
when :spacing_point
|
@@ -66,6 +74,10 @@ module OoxmlParser
|
|
66
74
|
OoxmlSize.new(@value * 100_000 / 50, :one_100000th_percent)
|
67
75
|
when :one_1000th_percent
|
68
76
|
OoxmlSize.new(@value * 100, :one_100000th_percent)
|
77
|
+
when :one_60000th_degree
|
78
|
+
OoxmlSize.new(@value, :one_60000th_degree)
|
79
|
+
when :degree
|
80
|
+
OoxmlSize.new(@value * 60_000, :one_60000th_degree)
|
69
81
|
else
|
70
82
|
self
|
71
83
|
end
|
@@ -77,27 +89,27 @@ module OoxmlParser
|
|
77
89
|
base_unit = to_base_unit
|
78
90
|
case output_unit
|
79
91
|
when :centimeter
|
80
|
-
|
92
|
+
OoxmlSize.new((base_unit.value / 360_000).round(OoxmlParser.configuration.accuracy), output_unit)
|
81
93
|
when :point
|
82
|
-
|
94
|
+
OoxmlSize.new((base_unit.value / 12_700).round(OoxmlParser.configuration.accuracy), output_unit)
|
83
95
|
when :half_point
|
84
|
-
|
96
|
+
OoxmlSize.new((base_unit.value / (12_700 * 2)).round(OoxmlParser.configuration.accuracy), output_unit)
|
85
97
|
when :one_eighth_point
|
86
|
-
|
98
|
+
OoxmlSize.new((base_unit.value / (12_700 * 8)).round(OoxmlParser.configuration.accuracy), output_unit)
|
87
99
|
when :one_100th_point
|
88
|
-
|
100
|
+
OoxmlSize.new((base_unit.value / (12_700 / 100)).round(OoxmlParser.configuration.accuracy), output_unit)
|
89
101
|
when :one_240th_cm
|
90
|
-
|
102
|
+
OoxmlSize.new((base_unit.value / 1500).round(OoxmlParser.configuration.accuracy), output_unit)
|
91
103
|
when :dxa, :twip
|
92
|
-
|
104
|
+
OoxmlSize.new((base_unit.value / 635).round(OoxmlParser.configuration.accuracy), output_unit)
|
93
105
|
when :inch
|
94
|
-
|
106
|
+
OoxmlSize.new((base_unit.value / 914_400).round(OoxmlParser.configuration.accuracy), output_unit)
|
95
107
|
when :percent
|
96
|
-
|
108
|
+
OoxmlSize.new((base_unit.value / 50).round(OoxmlParser.configuration.accuracy), output_unit)
|
97
109
|
when :spacing_point
|
98
|
-
|
110
|
+
OoxmlSize.new((base_unit.value / (12_700 * 100)).round(OoxmlParser.configuration.accuracy), output_unit)
|
99
111
|
else
|
100
|
-
|
112
|
+
base_unit
|
101
113
|
end
|
102
114
|
end
|
103
115
|
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'shape/docx_shape'
|
2
4
|
require_relative 'picture/docx_picture'
|
3
5
|
module OoxmlParser
|
@@ -22,7 +24,7 @@ module OoxmlParser
|
|
22
24
|
when 'chart'
|
23
25
|
@type = :chart
|
24
26
|
OOXMLDocumentObject.add_to_xmls_stack("#{OOXMLDocumentObject.root_subfolder}/#{OOXMLDocumentObject.get_link_from_rels(node_child.attribute('id').value)}")
|
25
|
-
@data = Chart.parse
|
27
|
+
@data = Chart.parse(parent: self)
|
26
28
|
OOXMLDocumentObject.xmls_stack.pop
|
27
29
|
when 'wgp'
|
28
30
|
@type = :group
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'docx_blip/file_reference'
|
2
4
|
module OoxmlParser
|
3
5
|
# Class for parsing `blipFill`
|
@@ -8,6 +10,7 @@ module OoxmlParser
|
|
8
10
|
|
9
11
|
alias path path_to_media_file
|
10
12
|
|
13
|
+
# @return [String] result of convert of object to string
|
11
14
|
def to_str
|
12
15
|
path_to_media_file
|
13
16
|
end
|
@@ -18,6 +21,7 @@ module OoxmlParser
|
|
18
21
|
def parse(node)
|
19
22
|
blip_node = node.xpath('a:blip', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main').first
|
20
23
|
return self if blip_node.nil?
|
24
|
+
|
21
25
|
@file_reference = FileReference.new(parent: self).parse(blip_node)
|
22
26
|
self
|
23
27
|
end
|