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