ooxml_parser 0.14.1-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (355) hide show
  1. checksums.yaml +7 -0
  2. data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb +25 -0
  3. data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +21 -0
  4. data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +22 -0
  5. data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice.rb +23 -0
  6. data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +42 -0
  7. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats/pivot_format.rb +26 -0
  8. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb +33 -0
  9. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/plot_area/common_chart_data.rb +31 -0
  10. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/plot_area.rb +67 -0
  11. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/number_string_reference.rb +27 -0
  12. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/number_string_cache.rb +36 -0
  13. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point/text_value.rb +17 -0
  14. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point.rb +38 -0
  15. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text.rb +23 -0
  16. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/x_y_values.rb +22 -0
  17. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb +52 -0
  18. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/view_3d.rb +34 -0
  19. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +174 -0
  20. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis/scaling.rb +22 -0
  21. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +48 -0
  22. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +42 -0
  23. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +30 -0
  24. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +39 -0
  25. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_point.rb +13 -0
  26. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +43 -0
  27. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing/doc_properties.rb +26 -0
  28. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +46 -0
  29. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +27 -0
  30. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +30 -0
  31. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +63 -0
  32. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +44 -0
  33. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +46 -0
  34. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +116 -0
  35. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative/picture_dimension.rb +19 -0
  36. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb +33 -0
  37. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_vertical.rb +32 -0
  38. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +37 -0
  39. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +43 -0
  40. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +29 -0
  41. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +31 -0
  42. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb +40 -0
  43. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties/shape_placeholder.rb +23 -0
  44. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb +31 -0
  45. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties.rb +25 -0
  46. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +29 -0
  47. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/effect_reference.rb +31 -0
  48. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/fill_reference.rb +31 -0
  49. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/font_reference.rb +31 -0
  50. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/line_reference.rb +31 -0
  51. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb +38 -0
  52. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +28 -0
  53. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +49 -0
  54. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties/preset_text_warp.rb +21 -0
  55. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +49 -0
  56. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +43 -0
  57. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +24 -0
  58. 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
  59. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb +34 -0
  60. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +29 -0
  61. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +42 -0
  62. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +63 -0
  63. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip/alpha_mod_fix.rb +21 -0
  64. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip.rb +23 -0
  65. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill.rb +26 -0
  66. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry/shape_adjust_value_list/shape_guide.rb +26 -0
  67. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry/shape_adjust_value_list.rb +33 -0
  68. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry.rb +26 -0
  69. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +26 -0
  70. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +59 -0
  71. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +52 -0
  72. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +25 -0
  73. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +35 -0
  74. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_element.rb +12 -0
  75. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group_properties.rb +8 -0
  76. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +28 -0
  77. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +29 -0
  78. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +32 -0
  79. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +25 -0
  80. data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +73 -0
  81. data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +59 -0
  82. data/lib/ooxml_parser/common_parser/common_data/color/color_indexes.list +66 -0
  83. data/lib/ooxml_parser/common_parser/common_data/color/ooxml_color.rb +66 -0
  84. data/lib/ooxml_parser/common_parser/common_data/color.rb +308 -0
  85. data/lib/ooxml_parser/common_parser/common_data/colors/color_alpha_channel.rb +17 -0
  86. data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +34 -0
  87. data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +67 -0
  88. data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +33 -0
  89. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +30 -0
  90. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +23 -0
  91. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +36 -0
  92. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +30 -0
  93. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +41 -0
  94. data/lib/ooxml_parser/common_parser/common_data/colors/scheme_color.rb +19 -0
  95. data/lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb +23 -0
  96. data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +27 -0
  97. data/lib/ooxml_parser/common_parser/common_data/content_types/content_type_default.rb +26 -0
  98. data/lib/ooxml_parser/common_parser/common_data/content_types/content_type_override.rb +26 -0
  99. data/lib/ooxml_parser/common_parser/common_data/content_types.rb +45 -0
  100. data/lib/ooxml_parser/common_parser/common_data/coordinates.rb +155 -0
  101. data/lib/ooxml_parser/common_parser/common_data/font_style.rb +42 -0
  102. data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +89 -0
  103. data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_document_object_helper.rb +117 -0
  104. data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_object_attribute_helper.rb +31 -0
  105. data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +144 -0
  106. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +109 -0
  107. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +31 -0
  108. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/position.rb +22 -0
  109. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_spacing.rb +22 -0
  110. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_style.rb +27 -0
  111. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +60 -0
  112. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/size.rb +22 -0
  113. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +148 -0
  114. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/text.rb +25 -0
  115. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +63 -0
  116. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +41 -0
  117. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +57 -0
  118. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb +38 -0
  119. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_stlye_ref.rb +27 -0
  120. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing/line_spacing.rb +33 -0
  121. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +100 -0
  122. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs/tab.rb +42 -0
  123. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +38 -0
  124. data/lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb +23 -0
  125. data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +46 -0
  126. data/lib/ooxml_parser/common_parser/common_data/relationships/relationship.rb +30 -0
  127. data/lib/ooxml_parser/common_parser/common_data/relationships.rb +68 -0
  128. data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +33 -0
  129. data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +54 -0
  130. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +23 -0
  131. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb +25 -0
  132. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +48 -0
  133. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +50 -0
  134. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +61 -0
  135. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_column_band_size.rb +25 -0
  136. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +45 -0
  137. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +57 -0
  138. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_row_band_size.rb +25 -0
  139. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +52 -0
  140. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +89 -0
  141. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/grid_span.rb +29 -0
  142. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +29 -0
  143. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +96 -0
  144. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line/line_join.rb +21 -0
  145. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +43 -0
  146. data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties/table_row_height.rb +22 -0
  147. data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +34 -0
  148. data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +40 -0
  149. data/lib/ooxml_parser/common_parser/common_data/table/table_grid/grid_column.rb +22 -0
  150. data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +38 -0
  151. data/lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb +42 -0
  152. data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +104 -0
  153. data/lib/ooxml_parser/common_parser/common_data/table.rb +52 -0
  154. data/lib/ooxml_parser/common_parser/common_data/underline.rb +50 -0
  155. data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +31 -0
  156. data/lib/ooxml_parser/common_parser/common_document_structure.rb +25 -0
  157. data/lib/ooxml_parser/common_parser/parser.rb +49 -0
  158. data/lib/ooxml_parser/configuration.rb +13 -0
  159. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments/comment.rb +37 -0
  160. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments.rb +36 -0
  161. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended/comment_extended.rb +26 -0
  162. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended.rb +42 -0
  163. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +35 -0
  164. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +33 -0
  165. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +25 -0
  166. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb +19 -0
  167. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style/document_style_helper.rb +39 -0
  168. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +98 -0
  169. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark_end.rb +22 -0
  170. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark_start.rb +26 -0
  171. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/comment_range_end.rb +22 -0
  172. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/comment_range_start.rb +27 -0
  173. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/accent.rb +27 -0
  174. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties/argument_size.rb +22 -0
  175. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties.rb +23 -0
  176. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +32 -0
  177. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +22 -0
  178. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +35 -0
  179. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +23 -0
  180. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +22 -0
  181. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +31 -0
  182. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +24 -0
  183. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +28 -0
  184. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +27 -0
  185. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb +27 -0
  186. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +13 -0
  187. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +45 -0
  188. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_grow.rb +22 -0
  189. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_limit_location.rb +22 -0
  190. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties.rb +28 -0
  191. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb +33 -0
  192. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb +32 -0
  193. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +27 -0
  194. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +75 -0
  195. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_helper.rb +20 -0
  196. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +111 -0
  197. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object/ole_object.rb +25 -0
  198. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object.rb +23 -0
  199. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_margins.rb +14 -0
  200. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/shape_size.rb +13 -0
  201. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties/stroke.rb +13 -0
  202. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape/shape_properties.rb +19 -0
  203. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +77 -0
  204. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +16 -0
  205. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +29 -0
  206. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +147 -0
  207. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/field_simple.rb +41 -0
  208. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb +51 -0
  209. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +51 -0
  210. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/inserted.rb +57 -0
  211. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_content.rb +46 -0
  212. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_properties.rb +30 -0
  213. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/structured_document_tag.rb +28 -0
  214. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +30 -0
  215. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +273 -0
  216. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +63 -0
  217. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/multilevel_type.rb +22 -0
  218. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_justification.rb +22 -0
  219. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_text.rb +22 -0
  220. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/numbering_format.rb +22 -0
  221. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +33 -0
  222. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +66 -0
  223. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +44 -0
  224. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb +32 -0
  225. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +56 -0
  226. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +23 -0
  227. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +56 -0
  228. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +25 -0
  229. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/footnote_properties.rb +34 -0
  230. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +52 -0
  231. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +45 -0
  232. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +83 -0
  233. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +62 -0
  234. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/paragraph_properties_default.rb +22 -0
  235. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/run_properties_default.rb +22 -0
  236. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults.rb +28 -0
  237. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +32 -0
  238. data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +290 -0
  239. data/lib/ooxml_parser/docx_parser/docx_parser.rb +19 -0
  240. data/lib/ooxml_parser/helpers/string_helper.rb +24 -0
  241. data/lib/ooxml_parser/name.rb +9 -0
  242. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/comment_authors/comment_author.rb +38 -0
  243. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/comment_authors.rb +39 -0
  244. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comments/presentation_comment.rb +39 -0
  245. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comments.rb +33 -0
  246. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_helpers.rb +16 -0
  247. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/font_scheme/font_collection/text_font.rb +22 -0
  248. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/font_scheme/font_collection.rb +31 -0
  249. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/font_scheme.rb +36 -0
  250. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +47 -0
  251. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +54 -0
  252. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties/stretch.rb +13 -0
  253. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties.rb +23 -0
  254. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +35 -0
  255. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data/shape_tree.rb +35 -0
  256. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data.rb +28 -0
  257. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/connection_shape.rb +7 -0
  258. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +50 -0
  259. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +27 -0
  260. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_notes.rb +23 -0
  261. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +38 -0
  262. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +30 -0
  263. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +33 -0
  264. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +28 -0
  265. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +23 -0
  266. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/codition_list/condition.rb +23 -0
  267. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition_list.rb +27 -0
  268. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing.rb +44 -0
  269. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +59 -0
  270. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +29 -0
  271. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +68 -0
  272. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +25 -0
  273. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action.rb +22 -0
  274. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +36 -0
  275. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties/wheel.rb +22 -0
  276. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb +30 -0
  277. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +85 -0
  278. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb +25 -0
  279. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/table_styles.rb +38 -0
  280. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +62 -0
  281. data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +17 -0
  282. data/lib/ooxml_parser/version.rb +9 -0
  283. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +33 -0
  284. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb +33 -0
  285. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb +42 -0
  286. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb +37 -0
  287. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb +43 -0
  288. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_source/worksheet_source.rb +26 -0
  289. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_source.rb +33 -0
  290. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition.rb +43 -0
  291. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache.rb +41 -0
  292. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items/column_row_item.rb +22 -0
  293. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items.rb +43 -0
  294. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb +34 -0
  295. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items/item.rb +26 -0
  296. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items.rb +43 -0
  297. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field.rb +37 -0
  298. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields.rb +43 -0
  299. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_table_style_info.rb +42 -0
  300. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition.rb +114 -0
  301. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table/string_index.rb +26 -0
  302. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table.rb +46 -0
  303. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/cell_style/alignment.rb +35 -0
  304. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/xf.rb +150 -0
  305. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs.rb +37 -0
  306. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +35 -0
  307. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +49 -0
  308. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +40 -0
  309. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +44 -0
  310. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +40 -0
  311. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb +26 -0
  312. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +44 -0
  313. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb +34 -0
  314. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders.rb +37 -0
  315. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +50 -0
  316. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_helpers.rb +14 -0
  317. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/author.rb +16 -0
  318. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/comment_list.rb +26 -0
  319. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +31 -0
  320. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +44 -0
  321. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/ole_objects.rb +20 -0
  322. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/page_setup.rb +105 -0
  323. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb +23 -0
  324. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +27 -0
  325. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +41 -0
  326. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column/custom_filters/custom_filter.rb +26 -0
  327. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb +42 -0
  328. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column.rb +40 -0
  329. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter.rb +36 -0
  330. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/data_validations/data_validation/data_validation_formula.rb +22 -0
  331. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/data_validations/data_validation.rb +88 -0
  332. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/data_validations.rb +47 -0
  333. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb +115 -0
  334. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb +33 -0
  335. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/x14_table.rb +26 -0
  336. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb +33 -0
  337. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +32 -0
  338. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_columns/table_column.rb +34 -0
  339. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_columns.rb +42 -0
  340. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_style_info.rb +43 -0
  341. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part.rb +50 -0
  342. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/worksheet_helper.rb +14 -0
  343. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb +54 -0
  344. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb +27 -0
  345. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +40 -0
  346. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_header_footer/header_footer_child.rb +56 -0
  347. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_header_footer.rb +64 -0
  348. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/formula.rb +39 -0
  349. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +84 -0
  350. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +43 -0
  351. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +152 -0
  352. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +165 -0
  353. data/lib/ooxml_parser/xlsx_parser/xlsx_parser.rb +17 -0
  354. data/lib/ooxml_parser.rb +40 -0
  355. metadata +572 -0
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ # @author Pavel.Lobashov
4
+
5
+ require_relative 'spacing/line_spacing'
6
+ module OoxmlParser
7
+ # Class to describe spacing
8
+ class Spacing
9
+ # @return [Float] Spacing before paragraph
10
+ attr_accessor :before
11
+ # @return [Float] Spacing after paragraph
12
+ attr_accessor :after
13
+ # @return [Float] Spacing between lines
14
+ attr_accessor :line
15
+ # @return [String] Spacing line rule
16
+ attr_accessor :line_rule
17
+ # @return [LineSpacing] line spacing data
18
+ attr_reader :line_spacing
19
+
20
+ def initialize(before = nil, after = 0.35, line = nil, line_rule = nil)
21
+ @before = before
22
+ @after = after
23
+ @line = line
24
+ @line_rule = line_rule
25
+ end
26
+
27
+ # Compare this object to other
28
+ # @param other [Object] any other object
29
+ # @return [True, False] result of comparision
30
+ def ==(other)
31
+ self.line_rule = :at_least if line_rule == 'atLeast'
32
+ self.line_rule = :multiple if line_rule == :auto
33
+ other.line_rule = :multiple if other.line_rule == :auto
34
+ self.line_rule = line_rule.to_sym if line_rule.instance_of?(String)
35
+
36
+ @before == other.before &&
37
+ @after == other.after &&
38
+ @line == other.line &&
39
+ @line_rule.to_s == other.line_rule.to_s
40
+ end
41
+
42
+ # @return [String] result of convert of object to string
43
+ def to_s
44
+ result_string = ''
45
+ variables = instance_variables
46
+ variables.each do |current_variable|
47
+ result_string += "#{current_variable.to_s.sub('@', '')}: #{instance_variable_get(current_variable)}\n"
48
+ end
49
+ result_string
50
+ end
51
+
52
+ # Method to copy object
53
+ # @return [Spacing] copied object
54
+ def copy
55
+ Spacing.new(@before, @after, @line, @line_rule)
56
+ end
57
+
58
+ # Round value of spacing
59
+ # @param count_of_digits [Integer] how digits to left
60
+ # @return [Spacing] result of round
61
+ def round(count_of_digits = 1)
62
+ before = @before.to_f.round(count_of_digits)
63
+ after = @after.to_f.round(count_of_digits)
64
+ line = @line.to_f.round(count_of_digits)
65
+ Spacing.new(before, after, line, @line_rule)
66
+ end
67
+
68
+ # Parse data for Spacing
69
+ # @param [Nokogiri::XML:Element] node with Spacing
70
+ # @return [Nothing]
71
+ def parse(node)
72
+ node.xpath('*').each do |spacing_node_child|
73
+ case spacing_node_child.name
74
+ when 'lnSpc'
75
+ self.line = Spacing.parse_spacing_value(spacing_node_child)
76
+ @line_spacing = LineSpacing.new(parent: self).parse(spacing_node_child)
77
+ self.line_rule = @line_spacing.rule
78
+ when 'spcBef'
79
+ self.before = Spacing.parse_spacing_value(spacing_node_child)
80
+ when 'spcAft'
81
+ self.after = Spacing.parse_spacing_value(spacing_node_child)
82
+ end
83
+ end
84
+ end
85
+
86
+ # Parse values of spacing number
87
+ # @param [Nokogiri::XML:Element] node with Spacing
88
+ # @return [Float] value of spacing number
89
+ def self.parse_spacing_value(node)
90
+ node.xpath('*').each do |spacing_node_child|
91
+ case spacing_node_child.name
92
+ when 'spcPct'
93
+ return OoxmlSize.new(spacing_node_child.attribute('val').value.to_f, :one_1000th_percent)
94
+ when 'spcPts'
95
+ return OoxmlSize.new(spacing_node_child.attribute('val').value.to_f, :spacing_point)
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for storing `w:tab`, `a:tab` data
5
+ class Tab < OOXMLDocumentObject
6
+ # @return [Symbol] Specifies the style of the tab.
7
+ attr_accessor :value
8
+ # @return [Symbol] Specifies the leader symbol of tab
9
+ attr_reader :leader
10
+ # @return [OOxmlSize] Specifies the position of the tab stop.
11
+ attr_accessor :position
12
+
13
+ alias align value
14
+
15
+ # Parse ParagraphTab object
16
+ # @param node [Nokogiri::XML:Element] node to parse
17
+ # @return [ParagraphTab] result of parsing
18
+ def parse(node)
19
+ node.attributes.each do |key, value|
20
+ case key
21
+ when 'algn', 'val'
22
+ @value = value_to_symbol(value)
23
+ when 'leader'
24
+ @leader = value_to_symbol(value)
25
+ when 'pos'
26
+ @position = OoxmlSize.new(value.value.to_f, position_unit(node))
27
+ end
28
+ end
29
+ self
30
+ end
31
+
32
+ private
33
+
34
+ # @param node [Nokogiri::XML:Element] node to determine size
35
+ # @return [Symbol] type of size unit
36
+ def position_unit(node)
37
+ return :emu if node.namespace.prefix == 'a'
38
+
39
+ :dxa
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'tabs/tab'
4
+ module OoxmlParser
5
+ # Class for working with `w:tabs`
6
+ class Tabs < OOXMLDocumentObject
7
+ # @return [Array, ParagraphTabs]
8
+ attr_accessor :tabs_array
9
+
10
+ def initialize(parent: nil)
11
+ @tabs_array = []
12
+ super
13
+ end
14
+
15
+ # @return [Array, Column] accessor
16
+ def [](key)
17
+ @tabs_array[key]
18
+ end
19
+
20
+ # @return [True, False] if empty
21
+ def empty?
22
+ @tabs_array.empty?
23
+ end
24
+
25
+ # Parse Tabs data
26
+ # @param [Nokogiri::XML:Element] node with Tabs data
27
+ # @return [Tabs] value of Columns data
28
+ def parse(node)
29
+ node.xpath('*').each do |node_child|
30
+ case node_child.name
31
+ when 'tab'
32
+ @tabs_array << Tab.new(parent: self).parse(node_child)
33
+ end
34
+ end
35
+ self
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for parsing `fld` tags
5
+ class TextField < OOXMLDocumentObject
6
+ attr_accessor :id, :type, :text
7
+
8
+ # Parse TextField object
9
+ # @param node [Nokogiri::XML:Element] node to parse
10
+ # @return [TextField] result of parsing
11
+ def parse(node)
12
+ @id = node.attribute('id').value
13
+ @type = node.attribute('type').value
14
+ node.xpath('*').each do |text_field_node_child|
15
+ case text_field_node_child.name
16
+ when 't'
17
+ @text = text_field_node_child.text
18
+ end
19
+ end
20
+ self
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'paragraph/paragraph_properties'
4
+ require_relative 'paragraph/paragraph_run'
5
+ require_relative 'paragraph/text_field'
6
+ module OoxmlParser
7
+ # Class for parsing `p` tags
8
+ class Paragraph < OOXMLDocumentObject
9
+ attr_accessor :properties, :runs, :text_field, :formulas
10
+ # @return [AlternateContent] alternate content data
11
+ attr_accessor :alternate_content
12
+
13
+ def initialize(runs = [],
14
+ formulas = [],
15
+ parent: nil)
16
+ @runs = runs
17
+ @formulas = formulas
18
+ @runs = []
19
+ super(parent: parent)
20
+ end
21
+
22
+ alias characters runs
23
+ alias character_style_array runs
24
+ alias characters= runs=
25
+ alias character_style_array= runs=
26
+
27
+ # Parse Paragraph object
28
+ # @param node [Nokogiri::XML:Element] node to parse
29
+ # @return [Paragraph] result of parsing
30
+ def parse(node)
31
+ node.xpath('*').each do |node_child|
32
+ case node_child.name
33
+ when 'pPr'
34
+ @properties = ParagraphProperties.new(parent: self).parse(node_child)
35
+ when 'fld'
36
+ @text_field = TextField.new(parent: self).parse(node_child)
37
+ when 'r'
38
+ @runs << ParagraphRun.new(parent: self).parse(node_child)
39
+ when 'AlternateContent'
40
+ @alternate_content = AlternateContent.new(parent: self).parse(node_child)
41
+ end
42
+ end
43
+ self
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for single relationship
5
+ class Relationship < OOXMLDocumentObject
6
+ # @return [String] id of relation
7
+ attr_accessor :id
8
+ # @return [String] type of relation
9
+ attr_accessor :type
10
+ # @return [String] target of relation
11
+ attr_accessor :target
12
+
13
+ # Parse Relationship
14
+ # @param [Nokogiri::XML:Node] node with Relationship
15
+ # @return [Relationship] result of parsing
16
+ def parse(node)
17
+ node.attributes.each do |key, value|
18
+ case key
19
+ when 'Id'
20
+ @id = value.value
21
+ when 'Type'
22
+ @type = value.value
23
+ when 'Target'
24
+ @target = value.value
25
+ end
26
+ end
27
+ self
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'relationships/relationship'
4
+ module OoxmlParser
5
+ # Class for describing list of relationships
6
+ class Relationships < OOXMLDocumentObject
7
+ # @return [Array, Relationship] array of relationships
8
+ attr_accessor :relationship
9
+
10
+ def initialize(parent: nil)
11
+ @relationship = []
12
+ super
13
+ end
14
+
15
+ # @return [Array, Column] accessor for relationship
16
+ def [](key)
17
+ @relationship[key]
18
+ end
19
+
20
+ # Parse Relationships
21
+ # @param [Nokogiri::XML:Node] node with Relationships
22
+ # @return [Relationships] result of parsing
23
+ def parse(node)
24
+ node.xpath('*').each do |node_children|
25
+ case node_children.name
26
+ when 'Relationship'
27
+ @relationship << Relationship.new(parent: self).parse(node_children)
28
+ end
29
+ end
30
+ self
31
+ end
32
+
33
+ # Parse .rels file
34
+ # @param file_path [String] path to file
35
+ # @return [Relationships]
36
+ def parse_file(file_path)
37
+ node = parse_xml(file_path)
38
+ node.xpath('*').each do |node_child|
39
+ case node_child.name
40
+ when 'Relationships'
41
+ parse(node_child)
42
+ end
43
+ end
44
+ self
45
+ end
46
+
47
+ # Get target name by id
48
+ # @param id [String] id of target
49
+ # @return [String] target name
50
+ def target_by_id(id)
51
+ @relationship.each do |cur_rels|
52
+ return cur_rels.target if cur_rels.id == id
53
+ end
54
+ nil
55
+ end
56
+
57
+ # Get target names by type
58
+ # @param type [String] type of target
59
+ # @return [Array<String>] target names
60
+ def target_by_type(type)
61
+ result = []
62
+ @relationship.each do |cur_rels|
63
+ result << cur_rels.target if cur_rels.type.include?(type)
64
+ end
65
+ result
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for working with ParagraphMargins
5
+ class ParagraphMargins < TableMargins
6
+ def initialize(top = OoxmlSize.new(0),
7
+ bottom = OoxmlSize.new(0),
8
+ left = OoxmlSize.new(0),
9
+ right = OoxmlSize.new(0),
10
+ parent: nil)
11
+ super(true, top, bottom, left, right, parent: parent)
12
+ end
13
+
14
+ # Parse ParagraphMargins object
15
+ # @param text_body_props_node [Nokogiri::XML:Element] node to parse
16
+ # @return [ParagraphMargins] result of parsing
17
+ def parse(text_body_props_node)
18
+ text_body_props_node.attributes.each do |key, value|
19
+ case key
20
+ when 'bIns', 'marB'
21
+ @bottom = OoxmlSize.new(value.value.to_f, :emu)
22
+ when 'tIns', 'marT'
23
+ @top = OoxmlSize.new(value.value.to_f, :emu)
24
+ when 'lIns', 'marL'
25
+ @left = OoxmlSize.new(value.value.to_f, :emu)
26
+ when 'rIns', 'marR'
27
+ @right = OoxmlSize.new(value.value.to_f, :emu)
28
+ end
29
+ end
30
+ self
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for working with Table Margins
5
+ class TableMargins < OOXMLDocumentObject
6
+ attr_accessor :is_default, :top, :bottom, :left, :right
7
+
8
+ def initialize(is_default = true, top = nil, bottom = nil, left = nil, right = nil, parent: nil)
9
+ @is_default = is_default
10
+ @top = top
11
+ @bottom = bottom
12
+ @left = left
13
+ @right = right
14
+ super(parent: parent)
15
+ end
16
+
17
+ # TODO: Separate @is_default attribute and remove this method
18
+ # Compare this object to other
19
+ # @param other [Object] any other object
20
+ # @return [True, False] result of comparision
21
+ def ==(other)
22
+ instance_variables.each do |current_attribute|
23
+ next if current_attribute == :@parent
24
+ next if current_attribute == :@is_default
25
+ return false unless instance_variable_get(current_attribute) == other.instance_variable_get(current_attribute)
26
+ end
27
+ true
28
+ end
29
+
30
+ # @return [String] result of convert of object to string
31
+ def to_s
32
+ "Default: #{is_default} top: #{@top}, bottom: #{@bottom}, left: #{@left}, right: #{@right}"
33
+ end
34
+
35
+ # Parse TableMargins object
36
+ # @param margin_node [Nokogiri::XML:Element] node to parse
37
+ # @return [TableMargins] result of parsing
38
+ def parse(margin_node)
39
+ margin_node.xpath('*').each do |cell_margin_node|
40
+ case cell_margin_node.name
41
+ when 'left'
42
+ @left = OoxmlSize.new(cell_margin_node.attribute('w').value.to_f)
43
+ when 'top'
44
+ @top = OoxmlSize.new(cell_margin_node.attribute('w').value.to_f)
45
+ when 'right'
46
+ @right = OoxmlSize.new(cell_margin_node.attribute('w').value.to_f)
47
+ when 'bottom'
48
+ @bottom = OoxmlSize.new(cell_margin_node.attribute('w').value.to_f)
49
+ end
50
+ end
51
+ self
52
+ end
53
+ end
54
+ end