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,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Fallback DOCX group properties
5
+ class OldDocxGroupProperties
6
+ attr_accessor :wrap
7
+ end
8
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'shape/old_docx_shape'
4
+ require_relative 'shape/old_docx_shape_fill'
5
+ require_relative 'group/old_docx_group'
6
+ module OoxmlParser
7
+ # Fallback DOCX Picture
8
+ class OldDocxPicture < OOXMLDocumentObject
9
+ attr_accessor :data, :type
10
+
11
+ # Parse OldDocxPicture object
12
+ # @param node [Nokogiri::XML:Element] node to parse
13
+ # @return [OldDocxPicture] result of parsing
14
+ def parse(node)
15
+ node.xpath('*').each do |node_child|
16
+ case node_child.name
17
+ when 'shape'
18
+ @type = :shape
19
+ @data = OldDocxShape.new(parent: self).parse(node_child)
20
+ when 'group'
21
+ @type = :group
22
+ @data = OldDocxGroup.new(parent: self).parse(node_child)
23
+ end
24
+ end
25
+ self
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'old_docx_shape_properties'
4
+ module OoxmlParser
5
+ # Fallback DOCX shape data
6
+ class OldDocxShape < OOXMLDocumentObject
7
+ attr_accessor :properties, :text_box, :fill
8
+ # @return [FileReference] image structure
9
+ attr_accessor :file_reference
10
+
11
+ # Parse OldDocxShape object
12
+ # @param node [Nokogiri::XML:Element] node to parse
13
+ # @return [OldDocxShape] result of parsing
14
+ def parse(node)
15
+ @properties = OldDocxShapeProperties.new(parent: self).parse(node)
16
+ node.xpath('*').each do |node_child|
17
+ case node_child.name
18
+ when 'textbox'
19
+ @text_box = TextBox.parse_list(node_child, parent: self)
20
+ when 'imagedata'
21
+ @file_reference = FileReference.new(parent: self).parse(node_child)
22
+ when 'fill'
23
+ @fill = OldDocxShapeFill.new(parent: self).parse(node_child)
24
+ end
25
+ end
26
+ self
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Fallback DOCX shape fill properties
5
+ class OldDocxShapeFill < OOXMLDocumentObject
6
+ attr_accessor :stretching_type, :opacity, :title
7
+ # @return [FileReference] image structure
8
+ attr_accessor :file_reference
9
+
10
+ # Parse OldDocxShapeFill object
11
+ # @param node [Nokogiri::XML:Element] node to parse
12
+ # @return [OldDocxShapeFill] result of parsing
13
+ def parse(node)
14
+ node.attributes.each do |key, value|
15
+ case key
16
+ when 'id'
17
+ @file_reference = FileReference.new(parent: self).parse(node)
18
+ when 'type'
19
+ @stretching_type = case value.value
20
+ when 'frame'
21
+ :stretch
22
+ else
23
+ value.value.to_sym
24
+ end
25
+ when 'title'
26
+ @title = value.value.to_s
27
+ end
28
+ end
29
+ self
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Fallback DOCX Shape Properties
5
+ class OldDocxShapeProperties < OOXMLDocumentObject
6
+ attr_accessor :fill_color, :stroke_color, :stroke_weight
7
+
8
+ # Parse OldDocxShapeProperties object
9
+ # @param node [Nokogiri::XML:Element] node to parse
10
+ # @return [OldDocxShapeProperties] result of parsing
11
+ def parse(node)
12
+ node.attributes.each do |key, value|
13
+ case key
14
+ when 'fillcolor'
15
+ @fill_color = Color.new(parent: self).parse_hex_string(value.value.delete('#'))
16
+ when 'strokecolor'
17
+ @stroke_color = Color.new(parent: self).parse_hex_string(value.value.delete('#'))
18
+ when 'strokeweight'
19
+ @stroke_weight = value.value.to_f
20
+ end
21
+ end
22
+ self
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Border Properties Data
5
+ class BordersProperties < OOXMLDocumentObject
6
+ attr_accessor :color, :space, :val, :shadow, :frame, :side
7
+ # @return [OoxmlSize] size of border
8
+ attr_reader :size
9
+
10
+ def initialize(color = :auto, size = 0, val = :none, space = 0, parent: nil)
11
+ @color = color
12
+ @size = size
13
+ @val = val
14
+ @space = space
15
+ super(parent: parent)
16
+ end
17
+
18
+ # @return [OoxmlSize] alias for sz
19
+ def sz
20
+ size
21
+ end
22
+
23
+ extend Gem::Deprecate
24
+ deprecate :sz, 'size', 2020, 1
25
+
26
+ def nil?
27
+ size.zero? && val == :none
28
+ end
29
+
30
+ # @return [String] result of convert of object to string
31
+ def to_s
32
+ return '' if nil?
33
+
34
+ "borders color: #{@color}, size: #{size}, space: #{@space}, value: #{@val}"
35
+ end
36
+
37
+ # Method to copy object
38
+ # @return [BordersProperties] copied object
39
+ def copy
40
+ BordersProperties.new(@color, size, @val, @space)
41
+ end
42
+
43
+ def visible?
44
+ return false if nil?
45
+
46
+ val != 'none'
47
+ end
48
+
49
+ # Parse BordersProperties
50
+ # @param [Nokogiri::XML:Element] node with BordersProperties
51
+ # @return [BordersProperties] value of BordersProperties
52
+ def parse(node)
53
+ return nil if node.attribute('val').value == 'nil'
54
+
55
+ node.attributes.each do |key, value|
56
+ case key
57
+ when 'val'
58
+ @val = value.value.to_sym
59
+ when 'sz'
60
+ @size = OoxmlSize.new(value.value.to_f, :one_eighth_point)
61
+ when 'space'
62
+ @space = OoxmlSize.new(value.value.to_f, :point)
63
+ when 'color'
64
+ @color = value.value.to_s
65
+ @color = Color.new(parent: self).parse_hex_string(@color) if @color != 'auto'
66
+ when 'shadow'
67
+ @shadow = value.value
68
+ end
69
+ end
70
+ self
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Helper methods for color
5
+ module ColorHelper
6
+ # Parse string in hex
7
+ # @param [String] hex_string with or without alpha-channel
8
+ def parse_hex_string(hex_string)
9
+ return self if %w[auto null].include?(hex_string)
10
+
11
+ char_array = hex_string.chars
12
+ case char_array.length
13
+ when 3
14
+ @red = char_array[0].hex
15
+ @green = char_array[1].hex
16
+ @blue = char_array[2].hex
17
+ when 6
18
+ @red = (char_array[0] + char_array[1]).hex
19
+ @green = (char_array[2] + char_array[3]).hex
20
+ @blue = (char_array[4] + char_array[5]).hex
21
+ when 8
22
+ @alpha_channel = (char_array[0] + char_array[1]).hex
23
+ @red = (char_array[2] + char_array[3]).hex
24
+ @green = (char_array[4] + char_array[5]).hex
25
+ @blue = (char_array[6] + char_array[7]).hex
26
+ end
27
+ self
28
+ end
29
+
30
+ # Convert color to HSLColor
31
+ # @return [HSLColor]
32
+ def to_hsl
33
+ hls_color = HSLColor.new
34
+
35
+ min = [red, green, blue].min.to_f
36
+ max = [red, green, blue].max.to_f
37
+
38
+ delta = (max - min).to_f
39
+ hls_color.l = (min + max) / 255.0 / 2.0
40
+ hls_color.alpha_channel = alpha_channel.to_f / 255.0
41
+
42
+ unless max == min
43
+ hls_color.s = delta / (255.0 - (255.0 - max - min).abs)
44
+
45
+ hls_color.h = if max == red && green >= blue
46
+ 60.0 * (green - blue) / delta
47
+ elsif max == red && green < blue
48
+ 60.0 * (green - blue) / delta + 360.0
49
+ elsif max == green
50
+ 60.0 * (blue - red) / delta + 120.0
51
+ else
52
+ 60.0 * (red - green) / delta + 240.0
53
+ end
54
+ end
55
+
56
+ hls_color
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,66 @@
1
+ 000000
2
+ FFFFFF
3
+ FF0000
4
+ 00FF00
5
+ 0000FF
6
+ FFFF00
7
+ FF00FF
8
+ 00FFFF
9
+ 000000
10
+ FFFFFF
11
+ FF0000
12
+ 00FF00
13
+ 0000FF
14
+ FFFF00
15
+ FF00FF
16
+ 00FFFF
17
+ 800000
18
+ 008000
19
+ 000080
20
+ 808000
21
+ 800080
22
+ 008080
23
+ C0C0C0
24
+ 808080
25
+ 9999FF
26
+ 993366
27
+ FFFFCC
28
+ CCFFFF
29
+ 660066
30
+ FF8080
31
+ 0066CC
32
+ CCCCFF
33
+ 000080
34
+ FF00FF
35
+ FFFF00
36
+ 00FFFF
37
+ 800080
38
+ 800000
39
+ 008080
40
+ 0000FF
41
+ 00CCFF
42
+ CCFFFF
43
+ CCFFCC
44
+ FFFF99
45
+ 99CCFF
46
+ FF99CC
47
+ CC99FF
48
+ FFCC99
49
+ 3366FF
50
+ 33CCCC
51
+ 99CC00
52
+ FFCC00
53
+ FF9900
54
+ FF6600
55
+ 666699
56
+ 969696
57
+ 003366
58
+ 339966
59
+ 003300
60
+ 333300
61
+ 993300
62
+ 993366
63
+ 333399
64
+ 333333
65
+ n/a
66
+ n/a
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for parsing `color` tag
5
+ class OoxmlColor < OOXMLDocumentObject
6
+ # @return [Color] value of color
7
+ attr_reader :value
8
+ # @return [Symbol] theme color name
9
+ attr_reader :theme_color
10
+ # @return [Symbol] theme shade
11
+ attr_reader :theme_shade
12
+ # @return [Integer] theme index
13
+ attr_reader :theme
14
+ # @return [Float] tint
15
+ attr_reader :tint
16
+ # @return [Float] Indexed id
17
+ attr_reader :indexed
18
+ # @return [Color] rgb color
19
+ attr_reader :rgb
20
+
21
+ # Convert OoxmlColor to other color type
22
+ # @return [Object] result of conversion
23
+ def to_color
24
+ return Color.get_rgb_by_color_index(indexed) if indexed
25
+ return ThemeColors.new(parent: self).parse_color_theme(theme, tint) if theme
26
+ return rgb if rgb
27
+
28
+ value
29
+ end
30
+
31
+ # Compare this object to other
32
+ # @param other [Object] any other object
33
+ # @return [True, False] result of comparision
34
+ def ==(other)
35
+ return to_color == other if other.is_a?(Color)
36
+ return to_color == other if other.is_a?(Symbol)
37
+
38
+ super
39
+ end
40
+
41
+ # Parse OoxmlColor object
42
+ # @param node [Nokogiri::XML:Element] node to parse
43
+ # @return [OoxmlColor] result of parsing
44
+ def parse(node)
45
+ node.attributes.each do |key, value|
46
+ case key
47
+ when 'val'
48
+ @value = Color.new.parse_hex_string(value.value.to_s)
49
+ when 'themeColor'
50
+ @theme_color = value.value.to_sym
51
+ when 'themeShade'
52
+ @theme_shade = Integer("0x#{value.value}")
53
+ when 'theme'
54
+ @theme = value.value.to_i
55
+ when 'tint'
56
+ @tint = value.value.to_f
57
+ when 'indexed'
58
+ @indexed = value.value.to_i
59
+ when 'rgb'
60
+ @rgb = Color.new.parse_hex_string(value.value)
61
+ end
62
+ end
63
+ self
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,308 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'color/color_helper'
4
+ require_relative 'color/ooxml_color'
5
+ require_relative 'colors/color_alpha_channel'
6
+ require_relative 'colors/hsl_color'
7
+ require_relative 'colors/scheme_color'
8
+ require_relative 'colors/color_properties'
9
+ require_relative 'colors/theme_colors'
10
+ # @author Pavel.Lobashov
11
+ module OoxmlParser
12
+ # Class for Color in RGB
13
+ class Color < OOXMLDocumentObject
14
+ include ColorHelper
15
+ # @return [Integer] Value of Red Part
16
+ attr_accessor :red
17
+ # @return [Integer] Value of Green Part
18
+ attr_accessor :green
19
+ # @return [Integer] Value of Blue Part
20
+ attr_accessor :blue
21
+ # @return [String] Value of Color Style
22
+ attr_accessor :style
23
+
24
+ alias set_style style=
25
+ # @return [String] color scheme of color
26
+ attr_accessor :scheme
27
+
28
+ # @return [Integer] Value of alpha-channel
29
+ attr_accessor :alpha_channel
30
+
31
+ alias set_alpha_channel alpha_channel=
32
+
33
+ # @return [ColorProperties] properties of color
34
+ attr_accessor :properties
35
+
36
+ # Value of color if non selected
37
+ VALUE_FOR_NONE_COLOR = nil
38
+
39
+ def initialize(new_red = VALUE_FOR_NONE_COLOR,
40
+ new_green = VALUE_FOR_NONE_COLOR,
41
+ new_blue = VALUE_FOR_NONE_COLOR,
42
+ parent: nil)
43
+ @red = new_red
44
+ @green = new_green
45
+ @blue = new_blue
46
+ super(parent: parent)
47
+ end
48
+
49
+ # @return [String] result of convert of object to string
50
+ def to_s
51
+ if @red == VALUE_FOR_NONE_COLOR && @green == VALUE_FOR_NONE_COLOR && @blue == VALUE_FOR_NONE_COLOR
52
+ 'none'
53
+ else
54
+ "RGB (#{@red}, #{@green}, #{@blue})"
55
+ end
56
+ end
57
+
58
+ # @return [String] inspect of object for debug means
59
+ def inspect
60
+ to_s
61
+ end
62
+
63
+ # @return [String] color in hex value
64
+ def to_hex
65
+ (@red.to_s(16).rjust(2, '0') + @green.to_s(16).rjust(2, '0') + @blue.to_s(16).rjust(2, '0')).upcase
66
+ end
67
+
68
+ alias to_int16 to_hex
69
+
70
+ # @return [True, False] is color default
71
+ def none?
72
+ (@red == VALUE_FOR_NONE_COLOR) && (@green == VALUE_FOR_NONE_COLOR) && (@blue == VALUE_FOR_NONE_COLOR) ||
73
+ (style == :nil)
74
+ end
75
+
76
+ # @return [True, False] is color not default
77
+ def any?
78
+ !none?
79
+ end
80
+
81
+ # @return [True, False] is color white
82
+ def white?
83
+ (@red == 255) && (@green == 255) && (@blue == 255)
84
+ end
85
+
86
+ # Method to copy object
87
+ # @return [Color] copied object
88
+ def copy
89
+ Color.new(@red, @green, @blue)
90
+ end
91
+
92
+ # Compare this object to other
93
+ # @param other [Object] any other object
94
+ # @return [True, False] result of comparision
95
+ def ==(other)
96
+ if other.is_a?(Color)
97
+ ((@red == other.red) && (@green == other.green) && (@blue == other.blue)) ||
98
+ (none? && other.white?) ||
99
+ (white? && other.none?)
100
+ else
101
+ false
102
+ end
103
+ end
104
+
105
+ # To compare color, which look alike
106
+ # @param [String or Color] color_to_check color to compare
107
+ # @param [Integer] delta max delta for each of specters
108
+ def looks_like?(color_to_check = nil, delta = 8)
109
+ color_to_check = color_to_check.converted_color if color_to_check.is_a?(SchemeColor)
110
+ color_to_check = color_to_check.pattern_fill.foreground_folor if color_to_check.is_a?(Fill)
111
+ color_to_check = color_to_check.color.converted_color if color_to_check.is_a?(PresentationFill)
112
+ color_to_check = Color.parse(color_to_check) if color_to_check.is_a?(String)
113
+ color_to_check = Color.parse(color_to_check.to_s) if color_to_check.is_a?(Symbol)
114
+ color_to_check = Color.parse(color_to_check.value) if color_to_check.is_a?(DocxColor)
115
+ return true if none? && color_to_check.nil?
116
+ return true if none? && color_to_check.none?
117
+ return false if none? && color_to_check.any?
118
+ return false if !none? && color_to_check.none?
119
+ return true if self == color_to_check
120
+
121
+ red = color_to_check.red
122
+ green = color_to_check.green
123
+ blue = color_to_check.blue
124
+ (self.red - red).abs < delta && (self.green - green).abs < delta && (self.blue - blue).abs < delta
125
+ end
126
+
127
+ # Apply tint to color
128
+ # @param tint [Integer] tint to apply
129
+ # @return [void]
130
+ def calculate_with_tint!(tint)
131
+ @red += (tint.to_f * (255 - @red)).to_i
132
+ @green += (tint.to_f * (255 - @green)).to_i
133
+ @blue += (tint.to_f * (255 - @blue)).to_i
134
+ end
135
+
136
+ # Apply shade to color
137
+ # @param shade [Integer] shade to apply
138
+ # @return [void]
139
+ def calculate_with_shade!(shade)
140
+ @red = (@red * shade.to_f).to_i
141
+ @green = (@green * shade.to_f).to_i
142
+ @blue = (@blue * shade.to_f).to_i
143
+ end
144
+
145
+ # Parse color scheme data
146
+ # @param scheme_color_node [Nokogiri::XML:Element] node to parse
147
+ # @return [Color] result of parsing
148
+ def parse_scheme_color(scheme_color_node)
149
+ color = root_object.theme.color_scheme[scheme_color_node.attribute('val').value.to_sym].color
150
+ hls = color.to_hsl
151
+ scheme_name = nil
152
+ scheme_color_node.xpath('*').each do |scheme_color_node_child|
153
+ case scheme_color_node_child.name
154
+ when 'lumMod'
155
+ hls.l = hls.l * (scheme_color_node_child.attribute('val').value.to_f / 100_000.0)
156
+ when 'lumOff'
157
+ hls.l = hls.l + (scheme_color_node_child.attribute('val').value.to_f / 100_000.0)
158
+ end
159
+ end
160
+ scheme_color_node.attributes.each do |key, value|
161
+ case key
162
+ when 'val'
163
+ scheme_name = value.to_s
164
+ end
165
+ end
166
+ color = hls.to_rgb
167
+ @red = color.red
168
+ @green = color.green
169
+ @blue = color.blue
170
+ @alpha_channel = ColorAlphaChannel.parse(scheme_color_node)
171
+ @scheme = scheme_name
172
+ self
173
+ end
174
+
175
+ # Parse color model data
176
+ # @param color_model_parent_node [Nokogiri::XML:Element] node to parse
177
+ # @return [Color] result of parsing
178
+ def parse_color_model(color_model_parent_node)
179
+ color = nil
180
+ tint = nil
181
+ color_model_parent_node.xpath('*').each do |color_model_node|
182
+ color_model_node.xpath('*').each do |color_mode_node_child|
183
+ case color_mode_node_child.name
184
+ when 'tint'
185
+ tint = color_mode_node_child.attribute('val').value.to_f / 100_000.0
186
+ end
187
+ end
188
+ case color_model_node.name
189
+ when 'srgbClr'
190
+ color = Color.new.parse_hex_string(color_model_node.attribute('val').value)
191
+ color.alpha_channel = ColorAlphaChannel.parse(color_model_node)
192
+ when 'schemeClr'
193
+ color = Color.new(parent: self).parse_scheme_color(color_model_node)
194
+ end
195
+ end
196
+ return nil unless color
197
+
198
+ color.calculate_with_tint!(1.0 - tint) if tint
199
+ @red = color.red
200
+ @green = color.green
201
+ @blue = color.blue
202
+ @alpha_channel = color.alpha_channel
203
+ @scheme = color.scheme
204
+ self
205
+ end
206
+
207
+ # Parse color data
208
+ # @param color_node [Nokogiri::XML:Element] node to parse
209
+ # @return [Color] result of parsing
210
+ def parse_color(color_node)
211
+ case color_node.name
212
+ when 'srgbClr'
213
+ color = parse_hex_string(color_node.attribute('val').value)
214
+ color.properties = ColorProperties.new(parent: color).parse(color_node)
215
+ color
216
+ when 'schemeClr'
217
+ color = SchemeColor.new(parent: parent)
218
+ return ValuedChild.new(:string, parent: parent).parse(color_node) unless root_object.theme
219
+
220
+ color.value = root_object.theme.color_scheme[color_node.attribute('val').value.to_sym].color
221
+ color.properties = ColorProperties.new(parent: color).parse(color_node)
222
+ color.converted_color = Color.new(parent: self).parse_scheme_color(color_node)
223
+ color.value.calculate_with_tint!(1.0 - color.properties.tint) if color.properties.tint
224
+ color
225
+ end
226
+ end
227
+
228
+ class << self
229
+ # @return [Color] random color
230
+ def generate_random_color
231
+ Color.new(rand(256), rand(256), rand(256))
232
+ end
233
+
234
+ alias random generate_random_color
235
+
236
+ # Read array of color from the AllTestData's constant
237
+ # @param [Array] const_array_name - array of the string
238
+ # @return [Array, Color] array of color
239
+ def array_from_const(const_array_name)
240
+ const_array_name.map { |current_color| Color.parse_string(current_color) }
241
+ end
242
+
243
+ # @param index [Integer] index to get
244
+ # @return [Color] color by it's index
245
+ def get_rgb_by_color_index(index)
246
+ color_by_index = color_indexes[index]
247
+ return :unknown if color_by_index.nil?
248
+
249
+ color_by_index == 'n/a' ? Color.new : Color.new.parse_hex_string(color_by_index)
250
+ end
251
+
252
+ # @return [Array] Deprecated Indexed colors
253
+ # List of color duplicated from `OpenXML Sdk IndexedColors` class
254
+ # See https://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.indexedcolors.aspx
255
+ def color_indexes
256
+ @color_indexes ||= File.readlines("#{__dir__}/color/color_indexes.list", chomp: true)
257
+ end
258
+
259
+ # Parse color from string
260
+ # @param str [String] string to parse
261
+ # @return [Color] result of parsing
262
+ def parse_string(str)
263
+ return str if str.is_a?(Color)
264
+ return Color.new(VALUE_FOR_NONE_COLOR, VALUE_FOR_NONE_COLOR, VALUE_FOR_NONE_COLOR) if str == 'none' || str == '' || str == 'transparent' || str.nil?
265
+
266
+ split = if str.include?('RGB (') || str.include?('rgb(')
267
+ str.gsub(/[(RGBrgb) ]/, '').split(',')
268
+ elsif str.include?('RGB ') || str.include?('rgb')
269
+ str.gsub(/RGB |rgb/, '').split(', ')
270
+ else
271
+ raise "Incorrect data for color to parse: '#{str}'"
272
+ end
273
+
274
+ Color.new(split[0].to_i, split[1].to_i, split[2].to_i)
275
+ end
276
+
277
+ alias parse parse_string
278
+
279
+ # Convert other object type to Color
280
+ # @param something [Object] object to convert
281
+ # @return [Color] result of conversion
282
+ def to_color(something)
283
+ case something
284
+ when SchemeColor
285
+ something.converted_color
286
+ when DocxColorScheme
287
+ something.color
288
+ when Fill
289
+ something.to_color
290
+ when PresentationFill
291
+ if something.color.respond_to? :converted_color
292
+ something.color.converted_color
293
+ else
294
+ something.color
295
+ end
296
+ when String
297
+ Color.parse(something)
298
+ when Symbol
299
+ Color.parse(something.to_s)
300
+ when DocxColor
301
+ Color.parse(something.value)
302
+ else
303
+ something
304
+ end
305
+ end
306
+ end
307
+ end
308
+ end