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,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for parsing header or footer
5
+ class HeaderFooterChild < OOXMLDocumentObject
6
+ # @return [Symbol] type of header
7
+ attr_reader :type
8
+ # @return [String] raw text of header
9
+ attr_reader :raw_string
10
+
11
+ def initialize(type: nil, raw_string: nil, parent: nil)
12
+ @type = type
13
+ @raw_string = raw_string
14
+ super(parent: parent)
15
+ end
16
+
17
+ # Parse HeaderFooterChild data
18
+ # @param node [Nokogiri::XML:Element] node to parse
19
+ # @return [HeaderFooterChild] result of parsing
20
+ def parse(node)
21
+ @raw_string = node.text
22
+ self
23
+ end
24
+
25
+ # @return [String] right part of header
26
+ def right
27
+ return @right if @right
28
+
29
+ right = @raw_string.match(/&R(.+)/)
30
+ return nil unless right
31
+
32
+ @right = right[1]
33
+ end
34
+
35
+ # @return [String] center part of header
36
+ def center
37
+ return @center if @center
38
+
39
+ center = @raw_string.split('&R').first.match(/&C(.+)/)
40
+ return nil unless center
41
+
42
+ @center = center[1]
43
+ end
44
+
45
+ # @return [String] left part of header
46
+ def left
47
+ return @left if @left
48
+
49
+ left = @raw_string.gsub("&R#{right}", '')
50
+ left = left.gsub("&C#{center}", '')
51
+ return nil if left == ''
52
+
53
+ left.gsub('&L', '')
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'xlsx_header_footer/header_footer_child'
4
+ module OoxmlParser
5
+ # Class for parsing <headerFooter> tag
6
+ class XlsxHeaderFooter < OOXMLDocumentObject
7
+ # @return [Symbol] Specifies whether to align header with margins
8
+ attr_reader :align_with_margins
9
+ # @return [Symbol] Specifies whether first header is different
10
+ attr_reader :different_first
11
+ # @return [Symbol] Specifies whether odd and even headers are different
12
+ attr_reader :different_odd_even
13
+ # @return [Symbol] Specifies whether to scale header with document
14
+ attr_reader :scale_with_document
15
+ # @return [String] odd header
16
+ attr_reader :odd_header
17
+ # @return [String] odd footer
18
+ attr_reader :odd_footer
19
+ # @return [String] even header
20
+ attr_reader :even_header
21
+ # @return [String] even footer
22
+ attr_reader :even_footer
23
+ # @return [String] first header
24
+ attr_reader :first_header
25
+ # @return [String] first footer
26
+ attr_reader :first_footer
27
+
28
+ # Parse Header Footer data
29
+ # @param node [Nokogiri::XML:Element] node to parse
30
+ # @return [XlsxHeaderFooter] result of parsing
31
+ def parse(node)
32
+ node.attributes.each do |key, value|
33
+ case key
34
+ when 'alignWithMargins'
35
+ @align_with_margins = attribute_enabled?(value)
36
+ when 'differentFirst'
37
+ @different_first = attribute_enabled?(value)
38
+ when 'differentOddEven'
39
+ @different_odd_even = attribute_enabled?(value)
40
+ when 'scaleWithDoc'
41
+ @scale_with_document = attribute_enabled?(value)
42
+ end
43
+
44
+ node.xpath('*').each do |node_child|
45
+ case node_child.name
46
+ when 'oddHeader'
47
+ @odd_header = HeaderFooterChild.new(parent: parent, type: odd_header).parse(node_child)
48
+ when 'oddFooter'
49
+ @odd_footer = HeaderFooterChild.new(parent: parent, type: odd_footer).parse(node_child)
50
+ when 'evenHeader'
51
+ @even_header = HeaderFooterChild.new(parent: parent, type: even_header).parse(node_child)
52
+ when 'evenFooter'
53
+ @even_footer = HeaderFooterChild.new(parent: parent, type: even_footer).parse(node_child)
54
+ when 'firstHeader'
55
+ @first_header = HeaderFooterChild.new(parent: parent, type: first_header).parse(node_child)
56
+ when 'firstFooter'
57
+ @first_footer = HeaderFooterChild.new(parent: parent, type: first_footer).parse(node_child)
58
+ end
59
+ end
60
+ end
61
+ self
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for parsing `formulas` <f>
5
+ class Formula < OOXMLDocumentObject
6
+ # @return [Coordinates] reference coordinates
7
+ attr_reader :reference
8
+ # @return [StringIndex] string index
9
+ attr_reader :string_index
10
+ # @return [String] type
11
+ attr_reader :type
12
+ # @return [String] value
13
+ attr_reader :value
14
+
15
+ # Parse Formula object
16
+ # @param node [Nokogiri::XML:Element] node to parse
17
+ # @return [Formula] parsed object
18
+ def parse(node)
19
+ node.attributes.each do |key, value|
20
+ case key
21
+ when 'ref'
22
+ @reference = Coordinates.parser_coordinates_range(value.value.to_s)
23
+ when 'si'
24
+ @string_index = value.value.to_i
25
+ when 't'
26
+ @type = value.value.to_s
27
+ end
28
+ end
29
+
30
+ @value = node.text unless node.text.empty?
31
+ self
32
+ end
33
+
34
+ # @return [True, False] check if formula empty
35
+ def empty?
36
+ !(reference || string_index || type || value)
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'xlsx_cell/formula'
4
+ module OoxmlParser
5
+ # Single Cell of XLSX
6
+ class XlsxCell < OOXMLDocumentObject
7
+ attr_accessor :formula, :character
8
+
9
+ # @return [String] text without applying any style modificators, like quote_prefix
10
+ attr_accessor :raw_text
11
+ # @return [Integer] index of style
12
+ attr_reader :style_index
13
+ # @return [String] value of cell
14
+ attr_reader :value
15
+ # @return [String] type of string
16
+ attr_reader :type
17
+
18
+ def initialize(parent: nil)
19
+ @style_index = 0 # default style is zero
20
+ @raw_text = ''
21
+ super
22
+ end
23
+
24
+ # Parse XlsxCell object
25
+ # @param node [Nokogiri::XML:Element] node to parse
26
+ # @return [XlsxCell] result of parsing
27
+ def parse(node)
28
+ node.attributes.each do |key, value|
29
+ case key
30
+ when 's'
31
+ @style_index = value.value.to_i
32
+ when 't'
33
+ @type = value.value.to_s
34
+ end
35
+ end
36
+ node.xpath('*').each do |node_child|
37
+ case node_child.name
38
+ when 'f'
39
+ @formula = Formula.new(parent: self).parse(node_child)
40
+ when 'v'
41
+ @value = TextValue.new(parent: self).parse(node_child)
42
+ end
43
+ end
44
+ parse_text_data
45
+ self
46
+ end
47
+
48
+ # @return [Xf] style of cell
49
+ def style
50
+ return nil unless @style_index
51
+
52
+ root_object.style_sheet.cell_xfs.xf_array[@style_index]
53
+ end
54
+
55
+ # @return [String] text with modifiers
56
+ def text
57
+ return '' unless @raw_text
58
+ return @raw_text.dup.insert(0, "'") if style.quote_prefix
59
+
60
+ @raw_text
61
+ end
62
+
63
+ private
64
+
65
+ # @return [Nothing] parse text data
66
+ def parse_text_data
67
+ if @type && @value
68
+ type == 's' ? get_shared_string(value.value) : @raw_text = value.value
69
+ elsif @value
70
+ @raw_text = value.value if @value
71
+ end
72
+ end
73
+
74
+ # Get shared string by it's number
75
+ # @return [Nothing]
76
+ def get_shared_string(value)
77
+ return '' if value == ''
78
+
79
+ string = root_object.shared_strings_table.string_indexes[value.to_i]
80
+ @character = string.run
81
+ @raw_text = string.text
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'xlsx_row/xlsx_cell'
4
+ module OoxmlParser
5
+ # Single Row of XLSX
6
+ class XlsxRow < OOXMLDocumentObject
7
+ attr_accessor :cells, :height, :style, :hidden
8
+ # @return [True, False] true if the row height has been manually set.
9
+ attr_accessor :custom_height
10
+ # @return [Integer] Indicates to which row in the sheet this <row> definition corresponds.
11
+ attr_accessor :index
12
+
13
+ def initialize(parent: nil)
14
+ @cells = []
15
+ super
16
+ end
17
+
18
+ # Parse XlsxRow object
19
+ # @param node [Nokogiri::XML:Element] node to parse
20
+ # @return [XlsxRow] result of parsing
21
+ def parse(node)
22
+ node.attributes.each do |key, value|
23
+ case key
24
+ when 'customHeight'
25
+ @custom_height = option_enabled?(node, 'customHeight')
26
+ when 'ht'
27
+ @height = OoxmlSize.new(value.value.to_f, :point)
28
+ when 'hidden'
29
+ @hidden = option_enabled?(node, 'hidden')
30
+ when 'r'
31
+ @index = value.value.to_i
32
+ end
33
+ end
34
+ node.xpath('*').each do |node_child|
35
+ case node_child.name
36
+ when 'c'
37
+ @cells[Coordinates.parse_coordinates_from_string(node_child.attribute('r').value.to_s).column_number.to_i - 1] = XlsxCell.new(parent: self).parse(node_child)
38
+ end
39
+ end
40
+ self
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,152 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'worksheet/excel_comments'
4
+ require_relative 'worksheet/ole_objects'
5
+ require_relative 'worksheet/page_setup'
6
+ require_relative 'worksheet/sheet_format_properties'
7
+ require_relative 'worksheet/sheet_view'
8
+ require_relative 'worksheet/table_part'
9
+ require_relative 'worksheet/worksheet_helper'
10
+ require_relative 'worksheet/xlsx_column_properties'
11
+ require_relative 'worksheet/xlsx_drawing'
12
+ require_relative 'worksheet/xlsx_row'
13
+ require_relative 'worksheet/xlsx_header_footer'
14
+ module OoxmlParser
15
+ # Properties of worksheet
16
+ class Worksheet < OOXMLDocumentObject
17
+ include WorksheetHelper
18
+ attr_accessor :name, :rows, :merge, :charts, :hyperlinks, :drawings, :comments, :columns, :sheet_format_properties,
19
+ :autofilter, :table_parts, :sheet_views
20
+ # @return [String] xml name of sheet
21
+ attr_accessor :xml_name
22
+ # @return [Relationships] array of relationships
23
+ attr_accessor :relationships
24
+ # @return [Relationships] array of ole objects
25
+ attr_accessor :ole_objects
26
+ # @return [PageMargins] page margins settings
27
+ attr_reader :page_margins
28
+ # @return [PageSetup] page setup settings
29
+ attr_reader :page_setup
30
+ # @return [ExtensionList] list of extensions
31
+ attr_accessor :extension_list
32
+ # @return [XlsxHeaderFooter] header and footer
33
+ attr_reader :header_footer
34
+
35
+ def initialize(parent: nil)
36
+ @columns = []
37
+ @name = ''
38
+ @rows = []
39
+ @merge = []
40
+ @charts = []
41
+ @hyperlinks = []
42
+ @drawings = []
43
+ @sheet_views = []
44
+ @table_parts = []
45
+ super
46
+ end
47
+
48
+ # Perform parsing of relationships
49
+ # @return [nil]
50
+ def parse_relationships
51
+ OOXMLDocumentObject.add_to_xmls_stack("#{OOXMLDocumentObject.root_subfolder}/worksheets/_rels/#{@xml_name}.rels")
52
+ @relationships = Relationships.new(parent: self).parse_file(OOXMLDocumentObject.current_xml) if File.exist?(OOXMLDocumentObject.current_xml)
53
+ OOXMLDocumentObject.xmls_stack.pop
54
+ end
55
+
56
+ # @return [True, false] if structure contain any user data
57
+ def with_data?
58
+ return true unless @rows.empty?
59
+ return true unless default_columns?
60
+ return true unless @drawings.empty?
61
+ return true unless @charts.empty?
62
+ return true unless @hyperlinks.empty?
63
+
64
+ false
65
+ end
66
+
67
+ # Parse list of drawings in file
68
+ def parse_drawing
69
+ drawing_node = parse_xml(OOXMLDocumentObject.current_xml)
70
+ drawing_node.xpath('xdr:wsDr/*').each do |drawing_node_child|
71
+ @drawings << XlsxDrawing.new(parent: self).parse(drawing_node_child)
72
+ end
73
+ end
74
+
75
+ # Parse data of Worksheet
76
+ # @param path_to_xml_file [String] path to file to parse
77
+ # @return [Worksheet] parsed worksheet
78
+ def parse(path_to_xml_file)
79
+ @xml_name = File.basename path_to_xml_file
80
+ parse_relationships
81
+ OOXMLDocumentObject.add_to_xmls_stack("#{OOXMLDocumentObject.root_subfolder}/worksheets/#{File.basename(path_to_xml_file)}")
82
+ doc = parse_xml(OOXMLDocumentObject.current_xml)
83
+ sheet = doc.search('//xmlns:worksheet').first
84
+ sheet.xpath('*').each do |worksheet_node_child|
85
+ case worksheet_node_child.name
86
+ when 'sheetData'
87
+ worksheet_node_child.xpath('xmlns:row').each do |row_node|
88
+ @rows[row_node.attribute('r').value.to_i - 1] = XlsxRow.new(parent: self).parse(row_node)
89
+ @rows[row_node.attribute('r').value.to_i - 1].style = root_object.style_sheet.cell_xfs.xf_array[row_node.attribute('s').value.to_i] if row_node.attribute('s')
90
+ end
91
+ when 'sheetFormatPr'
92
+ if !worksheet_node_child.attribute('defaultColWidth').nil? && !worksheet_node_child.attribute('defaultRowHeight').nil?
93
+ @sheet_format_properties = SheetFormatProperties.new(parent: self).parse(worksheet_node_child)
94
+ end
95
+ when 'mergeCells'
96
+ worksheet_node_child.xpath('xmlns:mergeCell').each do |merge_node|
97
+ @merge << merge_node.attribute('ref').value.to_s
98
+ end
99
+ when 'drawing'
100
+ path_to_drawing = OOXMLDocumentObject.get_link_from_rels(worksheet_node_child.attribute('id').value)
101
+ unless path_to_drawing.nil?
102
+ OOXMLDocumentObject.add_to_xmls_stack(path_to_drawing)
103
+ parse_drawing
104
+ OOXMLDocumentObject.xmls_stack.pop
105
+ end
106
+ when 'hyperlinks'
107
+ worksheet_node_child.xpath('xmlns:hyperlink').each do |hyperlink_node|
108
+ @hyperlinks << Hyperlink.new(parent: self).parse(hyperlink_node).dup
109
+ end
110
+ when 'cols'
111
+ @columns = XlsxColumnProperties.parse_list(worksheet_node_child, parent: self)
112
+ when 'autoFilter'
113
+ @autofilter = Autofilter.new(parent: self).parse(worksheet_node_child)
114
+ when 'tableParts'
115
+ worksheet_node_child.xpath('*').each do |part_node|
116
+ @table_parts << TablePart.new(parent: self).parse(part_node)
117
+ end
118
+ when 'sheetViews'
119
+ worksheet_node_child.xpath('*').each do |view_child|
120
+ @sheet_views << SheetView.new(parent: self).parse(view_child)
121
+ end
122
+ when 'oleObjects'
123
+ @ole_objects = OleObjects.new(parent: self).parse(worksheet_node_child)
124
+ when 'pageMargins'
125
+ @page_margins = PageMargins.new(parent: self).parse(worksheet_node_child, :inch)
126
+ when 'pageSetup'
127
+ @page_setup = PageSetup.new(parent: self).parse(worksheet_node_child)
128
+ when 'extLst'
129
+ @extension_list = ExtensionList.new(parent: self).parse(worksheet_node_child)
130
+ when 'headerFooter'
131
+ @header_footer = XlsxHeaderFooter.new(parent: self).parse(worksheet_node_child)
132
+ end
133
+ end
134
+ parse_comments
135
+ OOXMLDocumentObject.xmls_stack.pop
136
+ self
137
+ end
138
+
139
+ private
140
+
141
+ # Do work for parsing shared comments file
142
+ def parse_comments
143
+ return unless relationships
144
+
145
+ comments_target = relationships.target_by_type('comment')
146
+ return if comments_target.empty?
147
+
148
+ comments_file = "#{OOXMLDocumentObject.path_to_folder}/#{OOXMLDocumentObject.root_subfolder}/#{comments_target.first.gsub('..', '')}"
149
+ @comments = ExcelComments.new(parent: self).parse(comments_file)
150
+ end
151
+ end
152
+ end
@@ -0,0 +1,165 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'workbook/chartsheet'
4
+ require_relative 'workbook/pivot_cache'
5
+ require_relative 'workbook/pivot_table_definition'
6
+ require_relative 'workbook/defined_name'
7
+ require_relative 'workbook/shared_string_table'
8
+ require_relative 'workbook/style_sheet'
9
+ require_relative 'workbook/worksheet'
10
+ require_relative 'workbook/workbook_helpers'
11
+ module OoxmlParser
12
+ # Class for storing XLSX Workbook
13
+ class XLSXWorkbook < CommonDocumentStructure
14
+ include WorkbookHelpers
15
+ attr_accessor :worksheets
16
+ # @return [PresentationTheme] theme of Workbook
17
+ attr_accessor :theme
18
+ # @return [Relationships] rels of book
19
+ attr_accessor :relationships
20
+ # @return [StyleSheet] styles of book
21
+ attr_accessor :style_sheet
22
+ # @return [SharedStringTable] styles of book
23
+ attr_accessor :shared_strings_table
24
+ # @return [Array<PivotCache>] list of pivot caches
25
+ attr_accessor :pivot_caches
26
+ # @return [Array<PivotTableDefintion>] list of pivot table defitions
27
+ attr_accessor :pivot_table_definitions
28
+ # @return [Array<DefinedName>] list of defined names
29
+ attr_reader :defined_names
30
+
31
+ def initialize(params = {})
32
+ @worksheets = []
33
+ @pivot_caches = []
34
+ @pivot_table_definitions = []
35
+ @defined_names = []
36
+ super
37
+ end
38
+
39
+ # Return cell by coordinates
40
+ # @param column [String, Integer] number or numeric digit of column
41
+ # @param row [Integer] row to find
42
+ # @param sheet [Integer] number of sheet
43
+ # @return [XlsxCell] result
44
+ def cell(column, row, sheet = 0)
45
+ column = Coordinates.new(row, column).column_number unless StringHelper.numeric?(column.to_s)
46
+
47
+ if StringHelper.numeric?(sheet.to_s)
48
+ row = @worksheets[sheet].rows[row.to_i - 1]
49
+ return nil if row.nil?
50
+
51
+ return row.cells[column.to_i - 1]
52
+ elsif sheet.is_a?(String)
53
+ @worksheets.each do |worksheet|
54
+ next unless worksheet.name == sheet
55
+ next unless worksheet.rows[row.to_i - 1]
56
+
57
+ return worksheet.rows[row.to_i - 1].cells[column.to_i - 1]
58
+ end
59
+ return nil
60
+ end
61
+ raise "Error. Wrong sheet value: #{sheet}"
62
+ end
63
+
64
+ # Get all values of formulas.
65
+ # @param [Fixnum] precision of formulas counting
66
+ # @return [Array, String] all formulas
67
+ def all_formula_values(precision = 14)
68
+ formulas = []
69
+ worksheets.each do |c_sheet|
70
+ next unless c_sheet
71
+
72
+ c_sheet.rows.each do |c_row|
73
+ next unless c_row
74
+
75
+ c_row.cells.each do |c_cell|
76
+ next unless c_cell
77
+ next unless c_cell.formula
78
+ next if c_cell.formula.empty?
79
+
80
+ text = c_cell.raw_text
81
+ if StringHelper.numeric?(text)
82
+ text = text.to_f.round(10).to_s[0..precision]
83
+ elsif StringHelper.complex?(text)
84
+ complex_number = Complex(text.tr(',', '.'))
85
+ real_part = complex_number.real
86
+ real_rounded = real_part.to_f.round(10).to_s[0..precision].to_f
87
+
88
+ imag_part = complex_number.imag
89
+ imag_rounded = imag_part.to_f.round(10).to_s[0..precision].to_f
90
+ complex_rounded = Complex(real_rounded, imag_rounded)
91
+ text = complex_rounded.to_s
92
+ end
93
+ formulas << text
94
+ end
95
+ end
96
+ end
97
+ formulas
98
+ end
99
+
100
+ # Do work for parsing shared strings file
101
+ def parse_shared_strings
102
+ shared_strings_target = relationships.target_by_type('sharedString')
103
+ return if shared_strings_target.empty?
104
+
105
+ shared_string_file = "#{OOXMLDocumentObject.path_to_folder}/xl/#{shared_strings_target.first}"
106
+ @shared_strings_table = SharedStringTable.new(parent: self).parse(shared_string_file)
107
+ end
108
+
109
+ # Parse content of Workbook
110
+ # @return [XLSXWorkbook]
111
+ def parse
112
+ @content_types = ContentTypes.new(parent: self).parse
113
+ @relationships = Relationships.new(parent: self).parse_file("#{OOXMLDocumentObject.path_to_folder}xl/_rels/workbook.xml.rels")
114
+ parse_shared_strings
115
+ OOXMLDocumentObject.xmls_stack = []
116
+ OOXMLDocumentObject.root_subfolder = 'xl/'
117
+ OOXMLDocumentObject.add_to_xmls_stack('xl/workbook.xml')
118
+ @doc = Nokogiri::XML.parse(File.open(OOXMLDocumentObject.current_xml))
119
+ @theme = PresentationTheme.parse("xl/#{link_to_theme_xml}") if link_to_theme_xml
120
+ @style_sheet = StyleSheet.new(parent: self).parse
121
+ @doc.xpath('xmlns:workbook/xmlns:sheets/xmlns:sheet').each do |sheet|
122
+ file = @relationships.target_by_id(sheet.attribute('id').value)
123
+ if file.start_with?('worksheets')
124
+ @worksheets << Worksheet.new(parent: self).parse(file)
125
+ @worksheets.last.name = sheet.attribute('name').value
126
+ elsif file.start_with?('chartsheets')
127
+ @worksheets << Chartsheet.new(parent: self).parse(file)
128
+ end
129
+ end
130
+ parse_pivot_cache
131
+ parse_pivot_table
132
+ parse_defined_names
133
+ OOXMLDocumentObject.xmls_stack.pop
134
+ self
135
+ end
136
+
137
+ private
138
+
139
+ def link_to_theme_xml
140
+ relationships.target_by_type('theme').first
141
+ end
142
+
143
+ # Perform parsing of pivot cache
144
+ def parse_pivot_cache
145
+ @doc.xpath('xmlns:workbook/xmlns:pivotCaches/xmlns:pivotCache').each do |pivot_cache|
146
+ @pivot_caches << PivotCache.new(parent: self).parse(pivot_cache)
147
+ end
148
+ end
149
+
150
+ # Perform parsing of pivot table
151
+ def parse_pivot_table
152
+ files = @content_types.by_type('application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml')
153
+ files.each do |file|
154
+ @pivot_table_definitions << PivotTableDefinition.new(parent: self).parse(file.part_name)
155
+ end
156
+ end
157
+
158
+ # Perform parsing of defined names
159
+ def parse_defined_names
160
+ @doc.xpath('xmlns:workbook/xmlns:definedNames/xmlns:definedName').each do |defined_name|
161
+ @defined_names << DefinedName.new(parent: self).parse(defined_name)
162
+ end
163
+ end
164
+ end
165
+ end