ooxml_parser 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (315) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -5
  3. data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/chart_style.rb +19 -0
  4. data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text/math_paragraph.rb +18 -0
  5. data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice/math_text.rb +19 -0
  6. data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content/choice.rb +20 -0
  7. data/lib/ooxml_parser/common_parser/common_data/alternate_content/alternate_content.rb +20 -14
  8. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/order.rb +20 -0
  9. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_index.rb +20 -0
  10. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point/text_value.rb +15 -0
  11. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point.rb +31 -0
  12. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache/point_count.rb +20 -0
  13. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache.rb +31 -0
  14. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference.rb +25 -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.rb +39 -0
  17. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/view_3d.rb +32 -0
  18. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +81 -74
  19. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +20 -13
  20. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +15 -14
  21. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +15 -12
  22. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +15 -10
  23. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +22 -11
  24. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing/doc_properties.rb +24 -0
  25. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +34 -20
  26. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_distance_from_text.rb +9 -10
  27. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_position.rb +18 -25
  28. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +4 -1
  29. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +23 -20
  30. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +15 -5
  31. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_size.rb +104 -0
  32. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative/picture_dimension.rb +17 -0
  33. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb +31 -0
  34. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_vertical.rb +30 -0
  35. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +17 -16
  36. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip/file_reference.rb +34 -0
  37. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb +12 -15
  38. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb +15 -10
  39. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb +38 -0
  40. 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 +21 -0
  41. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/non_visual_properties.rb +29 -0
  42. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties.rb +22 -0
  43. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +29 -0
  44. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +26 -0
  45. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb +27 -10
  46. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties/preset_text_warp.rb +7 -4
  47. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb +20 -11
  48. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +18 -15
  49. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb +11 -9
  50. 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
  51. 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 +15 -27
  52. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +13 -9
  53. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_color.rb +20 -23
  54. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +27 -22
  55. 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 +19 -0
  56. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill/blip.rb +21 -0
  57. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/blip_fill.rb +24 -0
  58. 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 +24 -0
  59. 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 +31 -0
  60. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry.rb +24 -0
  61. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/text_box.rb +3 -3
  62. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +22 -13
  63. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +20 -12
  64. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb +9 -8
  65. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +15 -13
  66. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/old_docx_picture.rb +14 -12
  67. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb +15 -12
  68. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb +18 -14
  69. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_properties.rb +12 -11
  70. data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +20 -24
  71. data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +25 -0
  72. data/lib/ooxml_parser/common_parser/common_data/color.rb +48 -182
  73. data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +15 -10
  74. data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +1 -63
  75. data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +17 -20
  76. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop/preset_color.rb +20 -0
  77. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/gradient_stop.rb +20 -7
  78. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb +12 -11
  79. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +17 -17
  80. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb +15 -9
  81. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill.rb +19 -16
  82. data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +10 -6
  83. data/lib/ooxml_parser/common_parser/common_data/font_style.rb +1 -61
  84. data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +33 -26
  85. data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object/ooxml_document_object_helper.rb +97 -0
  86. data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +23 -37
  87. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +71 -23
  88. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/language.rb +20 -0
  89. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +11 -7
  90. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/position.rb +20 -0
  91. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_spacing.rb +20 -0
  92. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/run_style.rb +25 -0
  93. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +38 -0
  94. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/size.rb +20 -0
  95. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +92 -40
  96. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +12 -8
  97. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +37 -0
  98. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb +53 -0
  99. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb +36 -0
  100. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +6 -6
  101. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list/presentation_tab.rb +26 -0
  102. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tab_list.rb +36 -0
  103. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs/paragraph_tab.rb +26 -0
  104. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +36 -0
  105. data/lib/ooxml_parser/common_parser/common_data/paragraph/text_field.rb +11 -8
  106. data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +20 -12
  107. data/lib/ooxml_parser/common_parser/common_data/relationships/relationship.rb +13 -7
  108. data/lib/ooxml_parser/common_parser/common_data/relationships.rb +36 -4
  109. data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +12 -8
  110. data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +18 -19
  111. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_element.rb +9 -8
  112. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb +23 -0
  113. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +17 -14
  114. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_position.rb +16 -23
  115. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb +21 -40
  116. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_column_band_size.rb +23 -0
  117. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties/table_style_properties_helper.rb +42 -0
  118. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +50 -0
  119. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_row_band_size.rb +23 -0
  120. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +28 -23
  121. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties/vertical_merge.rb +20 -0
  122. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +71 -69
  123. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb +18 -10
  124. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/border.rb +19 -17
  125. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +31 -48
  126. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line/line_join.rb +21 -0
  127. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +25 -19
  128. data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties/table_row_height.rb +20 -0
  129. data/lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb +20 -10
  130. data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +20 -16
  131. data/lib/ooxml_parser/common_parser/common_data/table/table_grid/grid_column.rb +20 -0
  132. data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +27 -3
  133. data/lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb +20 -13
  134. data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +54 -37
  135. data/lib/ooxml_parser/common_parser/common_data/table.rb +23 -17
  136. data/lib/ooxml_parser/common_parser/common_data/underline.rb +13 -10
  137. data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +29 -0
  138. data/lib/ooxml_parser/common_parser/parser.rb +32 -4
  139. data/lib/ooxml_parser/configuration.rb +3 -13
  140. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comment.rb +1 -1
  141. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +16 -16
  142. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_properties.rb +18 -13
  143. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +20 -0
  144. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_structure_helpers.rb +18 -0
  145. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style/document_style_helper.rb +37 -0
  146. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +43 -14
  147. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/bookmark.rb +21 -0
  148. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/accent.rb +19 -5
  149. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties/argument_size.rb +20 -0
  150. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/argument_properties.rb +21 -0
  151. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +24 -4
  152. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +14 -5
  153. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +27 -6
  154. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/fraction.rb +15 -5
  155. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/function.rb +14 -5
  156. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/group_char.rb +23 -7
  157. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb +16 -6
  158. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +20 -6
  159. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +25 -0
  160. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb +25 -0
  161. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +4 -3
  162. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +36 -3
  163. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_grow.rb +20 -0
  164. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties/nary_limit_location.rb +20 -0
  165. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary/nary_properties.rb +26 -0
  166. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/nary.rb +31 -0
  167. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb +27 -0
  168. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +19 -5
  169. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +52 -183
  170. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +89 -0
  171. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object/ole_object.rb +23 -0
  172. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/object.rb +21 -0
  173. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +24 -17
  174. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_fill.rb +7 -6
  175. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +15 -10
  176. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +43 -245
  177. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb +19 -20
  178. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +24 -65
  179. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/inserted.rb +41 -0
  180. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +31 -0
  181. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +146 -172
  182. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +45 -26
  183. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/multilevel_type.rb +20 -0
  184. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_justification.rb +20 -0
  185. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/level_text.rb +20 -0
  186. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/numbering_format.rb +20 -0
  187. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/start.rb +20 -0
  188. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +31 -0
  189. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +65 -0
  190. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +42 -0
  191. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition/abstract_numbering_id.rb +20 -0
  192. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb +31 -0
  193. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +45 -0
  194. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns/column.rb +15 -4
  195. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +24 -13
  196. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/document_grid.rb +6 -12
  197. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/footnote_properties.rb +32 -0
  198. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +8 -9
  199. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +31 -24
  200. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +61 -64
  201. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +56 -0
  202. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/paragraph_properties_default.rb +20 -0
  203. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults/run_properties_default.rb +20 -0
  204. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles/document_defaults.rb +26 -0
  205. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +19 -0
  206. data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +49 -54
  207. data/lib/ooxml_parser/docx_parser/docx_parser.rb +2 -1
  208. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb +1 -1
  209. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_helpers.rb +13 -0
  210. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +15 -12
  211. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +1 -1
  212. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties/stretch.rb +11 -0
  213. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background/background_properties.rb +21 -0
  214. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +19 -6
  215. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +27 -16
  216. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +13 -9
  217. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +11 -8
  218. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +19 -15
  219. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb +17 -12
  220. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +15 -14
  221. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +18 -15
  222. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/set_time_node.rb +9 -11
  223. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition.rb +16 -13
  224. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing.rb +23 -15
  225. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +21 -19
  226. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +15 -11
  227. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +52 -0
  228. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +13 -7
  229. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action.rb +11 -9
  230. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb +13 -15
  231. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb +9 -14
  232. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +30 -67
  233. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb +11 -8
  234. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation.rb +6 -3
  235. data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +1 -1
  236. data/lib/ooxml_parser/version.rb +1 -1
  237. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +28 -0
  238. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +33 -0
  239. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +25 -0
  240. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +38 -0
  241. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +35 -0
  242. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +38 -0
  243. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb +24 -0
  244. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +47 -0
  245. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +36 -0
  246. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/workbook_helpers.rb +11 -0
  247. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +11 -10
  248. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +8 -10
  249. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb +12 -12
  250. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view/pane.rb +12 -10
  251. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +29 -8
  252. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/x14_table.rb +24 -0
  253. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb +21 -0
  254. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +30 -0
  255. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part.rb +37 -0
  256. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_column_properties.rb +29 -10
  257. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb +25 -0
  258. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing.rb +23 -29
  259. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/alignment.rb +15 -12
  260. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style.rb +70 -37
  261. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +16 -12
  262. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +31 -9
  263. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +34 -12
  264. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +20 -9
  265. data/lib/ooxml_parser/xlsx_parser/xlsx_parser.rb +1 -1
  266. data/lib/ooxml_parser.rb +0 -1
  267. metadata +122 -58
  268. data/lib/ooxml_parser/common_parser/common_data/alingment.rb +0 -56
  269. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2007_chart_style.rb +0 -17
  270. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_style/office_2010_chart_style.rb +0 -17
  271. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_group_element.rb +0 -10
  272. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/group/docx_grouped_drawing.rb +0 -34
  273. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_gradient_color.rb +0 -30
  274. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/gradient_color/docx_single_gradient_color.rb +0 -6
  275. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/solid_color/docx_solid_color.rb +0 -10
  276. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_element.rb +0 -10
  277. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end/line_size.rb +0 -20
  278. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_style/docx_shape_style.rb +0 -5
  279. data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/common_non_visual_properties.rb +0 -25
  280. data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_properties.rb +0 -19
  281. data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/non_visual_shape_properties.rb +0 -20
  282. data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape.rb +0 -28
  283. data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_placeholder.rb +0 -18
  284. data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/ooxml_shift.rb +0 -15
  285. data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/transform_effect.rb +0 -28
  286. data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties.rb +0 -13
  287. data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/ooxml_text_box.rb +0 -26
  288. data/lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb +0 -23
  289. data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching/fill_rectangle.rb +0 -22
  290. data/lib/ooxml_parser/common_parser/common_data/colors/image/stretching.rb +0 -12
  291. data/lib/ooxml_parser/common_parser/common_data/colors/image_properties.rb +0 -16
  292. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/strikeout.rb +0 -16
  293. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties/numbering_level.rb +0 -25
  294. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering/numbering_properties.rb +0 -69
  295. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering.rb +0 -18
  296. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_cell_margin.rb +0 -20
  297. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_elements.rb +0 -21
  298. data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/line_join.rb +0 -19
  299. data/lib/ooxml_parser/common_parser/common_data/table/properties/whole_table/table_cell_style.rb +0 -20
  300. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/operator.rb +0 -13
  301. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/bookmark.rb +0 -10
  302. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/paragraph_tab.rb +0 -19
  303. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style/style_parametres.rb +0 -35
  304. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/paragraph_style.rb +0 -56
  305. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/image.rb +0 -15
  306. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/size.rb +0 -84
  307. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping/grouping_properties.rb +0 -16
  308. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character/excel_comment_character_properties.rb +0 -27
  309. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character.rb +0 -25
  310. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position/xlsx_drawing_position_parameters.rb +0 -22
  311. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position.rb +0 -22
  312. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_shape_grouping.rb +0 -37
  313. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/foreground_color.rb +0 -25
  314. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell/cell_style/ooxml_font.rb +0 -36
  315. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_table.rb +0 -30
@@ -1,25 +0,0 @@
1
- module OoxmlParser
2
- class CommonNonVisualProperties
3
- attr_accessor :name, :id, :description, :on_click_hyperlink, :hyperlink_for_hover
4
-
5
- def initialize(id = '', name = '')
6
- @id = id
7
- @name = name
8
- end
9
-
10
- def self.parse(common_non_visual_properties_node)
11
- non_visual_properties = CommonNonVisualProperties.new
12
- non_visual_properties.name = common_non_visual_properties_node.attribute('name').value
13
- non_visual_properties.id = common_non_visual_properties_node.attribute('id').value
14
- common_non_visual_properties_node.xpath('*').each do |cnv_props_node_child|
15
- case cnv_props_node_child.name
16
- when 'hlinkClick'
17
- non_visual_properties.on_click_hyperlink = Hyperlink.parse(cnv_props_node_child)
18
- when 'hlinkHover'
19
- non_visual_properties.hyperlink_for_hover = HyperlinkForHover.parse(cnv_props_node_child)
20
- end
21
- end
22
- non_visual_properties
23
- end
24
- end
25
- end
@@ -1,19 +0,0 @@
1
- require_relative 'shape_placeholder'
2
- module OoxmlParser
3
- class NonVisualProperties < OOXMLDocumentObject
4
- attr_accessor :placeholder, :is_photo, :user_drawn
5
-
6
- def self.parse(non_visual_properties_node)
7
- non_visual_properties = NonVisualProperties.new
8
- non_visual_properties_node.xpath('*').each do |non_visual_properties_node_child|
9
- case non_visual_properties_node_child.name
10
- when 'ph'
11
- non_visual_properties.placeholder = ShapePlaceholder.parse(non_visual_properties_node_child)
12
- end
13
- end
14
- non_visual_properties.is_photo = OOXMLDocumentObject.option_enabled?(non_visual_properties_node, 'isPhoto')
15
- non_visual_properties.user_drawn = OOXMLDocumentObject.option_enabled?(non_visual_properties_node, 'userDrawn')
16
- non_visual_properties
17
- end
18
- end
19
- end
@@ -1,20 +0,0 @@
1
- require_relative 'common_non_visual_properties'
2
- require_relative 'non_visual_properties'
3
- module OoxmlParser
4
- class NonVisualShapeProperties
5
- attr_accessor :common_properties, :non_visual_properties
6
-
7
- def self.parse(nv_shape_props_node)
8
- non_visual_properties = NonVisualShapeProperties.new
9
- nv_shape_props_node.xpath('*').each do |nv_props_node_child|
10
- case nv_props_node_child.name
11
- when 'cNvPr'
12
- non_visual_properties.common_properties = CommonNonVisualProperties.parse(nv_props_node_child)
13
- when 'nvPr'
14
- non_visual_properties.non_visual_properties = NonVisualProperties.parse(nv_props_node_child)
15
- end
16
- end
17
- non_visual_properties
18
- end
19
- end
20
- end
@@ -1,28 +0,0 @@
1
- require_relative 'shape_properties'
2
- require_relative 'non_visual_shape_properties'
3
- module OoxmlParser
4
- class PresentationShape
5
- attr_accessor :non_visual_properties, :shape_properties, :text_body
6
-
7
- def initialize(non_visual_properties = nil, shape_properties = nil, text_body = nil)
8
- @non_visual_properties = non_visual_properties
9
- @shape_properties = shape_properties
10
- @text_body = text_body
11
- end
12
-
13
- def self.parse(shape_node)
14
- shape = PresentationShape.new
15
- shape_node.xpath('*').each do |shape_node_child|
16
- case shape_node_child.name
17
- when 'nvSpPr'
18
- shape.non_visual_properties = NonVisualShapeProperties.parse(shape_node_child)
19
- when 'spPr'
20
- shape.shape_properties = DocxShapeProperties.parse(shape_node_child)
21
- when 'txBody'
22
- shape.text_body = TextBody.parse(shape_node_child)
23
- end
24
- end
25
- shape
26
- end
27
- end
28
- end
@@ -1,18 +0,0 @@
1
- module OoxmlParser
2
- class ShapePlaceholder < OOXMLDocumentObject
3
- attr_accessor :type, :has_custom_prompt
4
-
5
- def self.parse(placeholder_node)
6
- placeholder = ShapePlaceholder.new
7
- placeholder_node.attributes.each do |key, value|
8
- case key
9
- when 'type'
10
- placeholder.type = value.value.to_sym
11
- when 'hasCustomPrompt'
12
- placeholder.has_custom_prompt = OOXMLDocumentObject.option_enabled?(placeholder_node, 'hasCustomPrompt')
13
- end
14
- end
15
- placeholder
16
- end
17
- end
18
- end
@@ -1,15 +0,0 @@
1
- module OoxmlParser
2
- class OOXMLShift
3
- attr_accessor :x, :y
4
-
5
- def initialize(x = nil, y = nil)
6
- @x = x
7
- @y = y
8
- end
9
-
10
- def self.parse(shift_node, x_name = 'x', y_name = 'y', divider = 360_000)
11
- return if shift_node.nil? || shift_node.attribute(x_name).nil? || shift_node.attribute(y_name).nil?
12
- OOXMLShift.new((shift_node.attribute(x_name).value.to_f / divider.to_f).round(2), (shift_node.attribute(y_name).value.to_f / divider.to_f).round(2))
13
- end
14
- end
15
- end
@@ -1,28 +0,0 @@
1
- require_relative 'ooxml_shift'
2
- module OoxmlParser
3
- class TransformEffect
4
- attr_accessor :offset, :extents, :child_offset, :child_extent
5
-
6
- def initialize(offset = nil, extents = nil)
7
- @offset = offset
8
- @extents = extents
9
- end
10
-
11
- def self.parse(transform_effect_node)
12
- transform_effect = TransformEffect.new
13
- transform_effect_node.xpath('*').each do |transform_effect_node_child|
14
- case transform_effect_node_child.name
15
- when 'ext'
16
- transform_effect.extents = OOXMLShift.parse(transform_effect_node_child, 'cx', 'cy')
17
- when 'off'
18
- transform_effect.offset = OOXMLShift.parse(transform_effect_node_child)
19
- when 'chOff'
20
- transform_effect.child_offset = OOXMLShift.parse(transform_effect_node_child)
21
- when 'chExt'
22
- transform_effect.child_extent = OOXMLShift.parse(transform_effect_node_child, 'cx', 'cy')
23
- end
24
- end
25
- transform_effect
26
- end
27
- end
28
- end
@@ -1,13 +0,0 @@
1
- require_relative 'shape_properties/transform_effect'
2
- require_relative 'text_body/ooxml_text_box'
3
- require_relative 'text_body/text_body'
4
- module OoxmlParser
5
- class PresentationShapeProperties < OOXMLDocumentObject
6
- attr_accessor :transform, :preset, :custom, :fill, :line
7
-
8
- def initialize(transform = TransformEffect.new, preset = nil)
9
- @transform = transform
10
- @preset = preset
11
- end
12
- end
13
- end
@@ -1,26 +0,0 @@
1
- module OoxmlParser
2
- class OOXMLTextBox < OOXMLDocumentObject
3
- attr_accessor :properties, :elements
4
-
5
- def initialize(properties = nil, elements = [])
6
- @properties = properties
7
- @elements = elements
8
- end
9
-
10
- def self.parse(text_body_node)
11
- text_body = OOXMLTextBox.new
12
- text_box_content_node = text_body_node.xpath('w:txbxContent').first
13
- text_box_content_node.xpath('*').each_with_index do |text_body_node_child, index|
14
- case text_body_node_child.name
15
- when 'p'
16
- text_body.elements << DocxParagraph.parse(text_body_node_child, index)
17
- when 'tbl'
18
- text_body.elements << Table.parse(text_body_node_child, index)
19
- when 'bodyPr'
20
- text_body.properties = OOXMLShapeBodyProperties.parse(text_body_node_child)
21
- end
22
- end
23
- text_body
24
- end
25
- end
26
- end
@@ -1,23 +0,0 @@
1
- module OoxmlParser
2
- class TextBody
3
- attr_accessor :properties, :paragraphs
4
-
5
- def initialize(properties = nil, paragraphs = [])
6
- @properties = properties
7
- @paragraphs = paragraphs
8
- end
9
-
10
- def self.parse(text_body_node)
11
- text_body = TextBody.new
12
- text_body_node.xpath('*').each do |text_body_node_child|
13
- case text_body_node_child.name
14
- when 'p'
15
- text_body.paragraphs << Paragraph.parse(text_body_node_child)
16
- when 'bodyPr'
17
- text_body.properties = OOXMLShapeBodyProperties.parse(text_body_node_child)
18
- end
19
- end
20
- text_body
21
- end
22
- end
23
- end
@@ -1,22 +0,0 @@
1
- module OoxmlParser
2
- class FillRectangle
3
- attr_accessor :left, :top, :right, :bottom
4
-
5
- def self.parse(fill_rectangle_node)
6
- fill_rectangle = FillRectangle.new
7
- fill_rectangle_node.attributes.each do |key, value|
8
- case key
9
- when 'b'
10
- fill_rectangle.bottom = value.value.to_i
11
- when 't'
12
- fill_rectangle.top = value.value.to_i
13
- when 'l'
14
- fill_rectangle.left = value.value.to_i
15
- when 'r'
16
- fill_rectangle.right = value.value.to_i
17
- end
18
- end
19
- fill_rectangle
20
- end
21
- end
22
- end
@@ -1,12 +0,0 @@
1
- require_relative 'stretching/fill_rectangle'
2
- module OoxmlParser
3
- class Stretching
4
- attr_accessor :fill_rectangle
5
-
6
- def self.parse(stretch_node)
7
- stretching = Stretching.new
8
- stretching.fill_rectangle = FillRectangle.parse(stretch_node.xpath('a:fillRect').first) if stretch_node.xpath('a:fillRect').first
9
- stretching
10
- end
11
- end
12
- end
@@ -1,16 +0,0 @@
1
- module OoxmlParser
2
- class ImageProperties
3
- attr_accessor :alpha_modulate_fixed_effect
4
-
5
- def self.parse(blip_properties_node)
6
- properties = ImageProperties.new
7
- blip_properties_node.xpath('*').each do |property_node|
8
- case property_node.name
9
- when 'alphaModFix'
10
- properties.alpha_modulate_fixed_effect = (property_node.attribute('amt').value.to_f / 1_000.0).round(1)
11
- end
12
- end
13
- properties
14
- end
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- # Class for describing strikeout
2
- module OoxmlParser
3
- class Strikeout
4
- # Parse Strikeout
5
- # @param [Nokogiri::XML:Attr] node with Strikeout
6
- # @return [Symbol] value of Strikeout
7
- def self.parse(node)
8
- case node.value
9
- when 'sngStrike'
10
- :single
11
- when 'dblStrike'
12
- :double
13
- end
14
- end
15
- end
16
- end
@@ -1,25 +0,0 @@
1
- module OoxmlParser
2
- class NumberingLevel
3
- attr_accessor :ilvl, :start, :num_format, :level_text, :level_jc, :ind, :font
4
-
5
- def initialize(ilvl = nil, start = nil, num_fmt = nil, lvl_text = nil, lvl_jc = nil, ind = nil, font = nil)
6
- @ilvl = ilvl
7
- @start = start
8
- @num_format = num_fmt
9
- @level_text = lvl_text
10
- @level_jc = lvl_jc
11
- @ind = ind
12
- @font = font
13
- end
14
-
15
- def ==(other)
16
- if @font.nil? || other.font.nil? # Ilya Kirillov change logic of numbering font of bullets, so check should be correct
17
- @start.to_s == other.start.to_s && @num_format == other.num_format && @level_text == other.level_text &&
18
- @ind.equal_with_round(other.ind)
19
- else
20
- @start.to_s == other.start.to_s && @num_format == other.num_format && @level_text == other.level_text &&
21
- @ind.equal_with_round(other.ind) && @font == other.font
22
- end
23
- end
24
- end
25
- end
@@ -1,69 +0,0 @@
1
- require_relative 'numbering_properties/numbering_level'
2
- module OoxmlParser
3
- class NumberingProperties < OOXMLDocumentObject
4
- attr_accessor :id, :nsid, :multilevel_type, :tmpl, :ilvls
5
-
6
- def initialize(id = nil, multilevel_type = nil, ilvls = [])
7
- @id = id
8
- @multilevel_type = multilevel_type
9
- @ilvls = ilvls
10
- end
11
-
12
- def self.parse(id)
13
- doc = Nokogiri::XML(File.open(OOXMLDocumentObject.path_to_folder + 'word/numbering.xml'), 'r:UTF-8')
14
- numbering = NumberingProperties.new
15
- numbering.id = id
16
- doc.search('//w:num').each do |num|
17
- next unless id == num.attribute('numId').value
18
- num.xpath('w:abstractNumId').each do |abstract_num_id|
19
- abstract_num_id = abstract_num_id.attribute('val').value
20
- doc.search('//w:abstractNum').each do |abstract_num|
21
- next unless abstract_num_id == abstract_num.attribute('abstractNumId').value
22
- abstract_num.xpath('w:multiLevelType').each do |multilevel_type|
23
- numbering.multilevel_type = multilevel_type.attribute('val').value
24
- end
25
- lvls = []
26
- abstract_num.xpath('w:lvl').each do |lvl|
27
- numbering_lvl = NumberingLevel.new
28
- numbering_lvl.ilvl = lvl.attribute('ilvl').value
29
- lvl.xpath('w:start').each do |start|
30
- numbering_lvl.start = start.attribute('val').value
31
- end
32
- lvl.xpath('w:numFmt').each do |num_format|
33
- numbering_lvl.num_format = num_format.attribute('val').value
34
- end
35
- lvl.xpath('w:lvlText').each do |level_text|
36
- numbering_lvl.level_text = level_text.attribute('val').value
37
- end
38
- lvl.xpath('w:lvlJc').each do |level_jc|
39
- numbering_lvl.level_jc = level_jc.attribute('val').value
40
- end
41
- lvl.xpath('w:pPr').each do |p_pr|
42
- p_pr.xpath('w:ind').each do |ind|
43
- numbering_lvl.ind = Indents.parse(ind)
44
- end
45
- lvl.xpath('w:rPr').each do |r_pr|
46
- r_pr.xpath('w:rFonts').each do |r_fonts|
47
- if !r_fonts.attribute('ascii').nil?
48
- numbering_lvl.font = r_fonts.attribute('ascii').value
49
- elsif !r_fonts.attribute('hAnsi').nil?
50
- numbering_lvl.font = r_fonts.attribute('hAnsi').value
51
- elsif !r_fonts.attribute('eastAsia').nil?
52
- numbering_lvl.font = r_fonts.attribute('eastAsia').value
53
- else
54
- numbering_lvl.font = r_fonts.attribute('cs').value unless r_fonts.attribute('cs').nil?
55
- end
56
- end
57
- end
58
- end
59
- lvls << numbering_lvl
60
- end
61
- numbering.ilvls = lvls
62
- end
63
- end
64
- end
65
-
66
- numbering
67
- end
68
- end
69
- end
@@ -1,18 +0,0 @@
1
- require_relative 'numbering/numbering_properties'
2
- module OoxmlParser
3
- class Numbering
4
- attr_accessor :size, :font, :symbol, :start_at, :type, :ilvl, :numbering_properties
5
-
6
- def initialize(ilvl = 0, numbering_properties = nil)
7
- @ilvl = ilvl
8
- @numbering_properties = numbering_properties
9
- end
10
-
11
- def numbering_level_current
12
- @numbering_properties.ilvls.each do |current_ilvl|
13
- return current_ilvl if current_ilvl.ilvl == @ilvl
14
- end
15
- nil
16
- end
17
- end
18
- end
@@ -1,20 +0,0 @@
1
- # Table Cell Margin data
2
- module OoxmlParser
3
- class TableCellMargin
4
- attr_accessor :left, :right, :top, :bottom
5
-
6
- def initialize(left = nil, right = nil, top = nil, bottom = nil)
7
- @left = left
8
- @top = top
9
- @right = right
10
- @bottom = bottom
11
- end
12
-
13
- def ==(other)
14
- @left == other.left &&
15
- @top == other.top &&
16
- @right == other.right &&
17
- @bottom == other.bottom
18
- end
19
- end
20
- end
@@ -1,21 +0,0 @@
1
- # Table Style in XLSX
2
- module OoxmlParser
3
- class TableStyleElement < OOXMLDocumentObject
4
- attr_accessor :cell_properties
5
-
6
- def initialize
7
- @cell_properties = CellProperties.new
8
- end
9
-
10
- def self.parse(style_node)
11
- element_style = TableStyleElement.new
12
- style_node.xpath('*').each do |style_node_child|
13
- case style_node_child.name
14
- when 'tcPr'
15
- element_style.cell_properties = CellProperties.parse(style_node_child)
16
- end
17
- end
18
- element_style
19
- end
20
- end
21
- end
@@ -1,19 +0,0 @@
1
- module OoxmlParser
2
- class LineJoin
3
- attr_accessor :type, :limit
4
-
5
- def self.parse(parent_node)
6
- line_join = LineJoin.new
7
- parent_node.xpath('*').each do |line_join_node|
8
- case line_join_node.name
9
- when 'round', 'bevel'
10
- line_join.type = line_join_node.name.to_sym
11
- when 'miter'
12
- line_join.type = :miter
13
- line_join.limit = line_join_node.attribute('lim').value.to_f
14
- end
15
- end
16
- line_join
17
- end
18
- end
19
- end
@@ -1,20 +0,0 @@
1
- require_relative 'line_join'
2
- # Table Cell Style in XLSX
3
- module OoxmlParser
4
- class TableCellStyle
5
- attr_accessor :borders, :fill
6
-
7
- def self.parse(cell_style_node)
8
- cell_style = TableCellStyle.new
9
- cell_style_node.xpath('*').each do |cell_node_child|
10
- case cell_node_child.name
11
- when 'tcBdr'
12
- cell_style.borders = Borders.parse(cell_node_child)
13
- when 'fill'
14
- cell_style.fill = PresentationFill.parse(cell_node_child)
15
- end
16
- end
17
- cell_style
18
- end
19
- end
20
- end
@@ -1,13 +0,0 @@
1
- # Operator Data
2
- module OoxmlParser
3
- class Operator
4
- attr_accessor :operator, :bottom_value, :top_value, :value
5
-
6
- def initialize(operator = nil, bottom_value = nil, top_value = nil, value = nil)
7
- @operator = operator
8
- @bottom_value = bottom_value
9
- @top_value = top_value
10
- @value = value
11
- end
12
- end
13
- end
@@ -1,10 +0,0 @@
1
- module OoxmlParser
2
- class Bookmark
3
- attr_accessor :id, :name
4
-
5
- def initialize(id = nil, name = nil)
6
- @id = id
7
- @name = name
8
- end
9
- end
10
- end
@@ -1,19 +0,0 @@
1
- module OoxmlParser
2
- class ParagraphTab < OOXMLDocumentObject
3
- attr_accessor :align, :position
4
-
5
- def initialize(align, position)
6
- @align = align
7
- @position = position
8
- end
9
-
10
- def self.parse(tabs_node)
11
- tabs = []
12
- tabs_node.xpath('a:tab').each do |tab_node|
13
- tabs << ParagraphTab.new(Alignment.parse(tab_node.attribute('algn')),
14
- (tab_node.attribute('pos').value.to_f / 360_000.0).round(2))
15
- end
16
- tabs
17
- end
18
- end
19
- end
@@ -1,35 +0,0 @@
1
- # Style Parameter Data
2
- module OoxmlParser
3
- class StyleParametres
4
- attr_accessor :q_format, :hidden, :name
5
-
6
- def initialize(name = nil, q_format = false, hidden = false)
7
- @name = name
8
- @q_format = q_format
9
- @hidden = hidden
10
- end
11
-
12
- def ==(other)
13
- all_instance_variables = instance_variables
14
- all_instance_variables.each do |current_attributes|
15
- unless instance_variable_get(current_attributes) == other.instance_variable_get(current_attributes)
16
- return false
17
- end
18
- end
19
- true
20
- end
21
-
22
- def self.parse(style_tag)
23
- style = StyleParametres.new
24
- style_tag.xpath('w:name').each do |name|
25
- style.name = name.attribute('val').value
26
- end
27
- style_tag.xpath('w:qFormat').each do |q_format|
28
- next if q_format.attribute('val').nil?
29
- next if q_format.attribute('val').value == false || q_format.attribute('val').value == 'off' || q_format.attribute('val').value == '0'
30
- style.q_format = true
31
- end
32
- style
33
- end
34
- end
35
- end
@@ -1,56 +0,0 @@
1
- require_relative 'paragraph_style/bookmark'
2
- require_relative 'paragraph_style/style_parametres'
3
- require_relative 'paragraph_style/paragraph_tab'
4
- # Paragraph Style Data
5
- module OoxmlParser
6
- class ParagraphStyle
7
- attr_accessor :name,
8
- :font_name,
9
- :font_size,
10
- :font_style,
11
- :spacing,
12
- :indent,
13
- :borders,
14
- :background
15
-
16
- def initialize(style_name = nil, font_name = nil, font_size = nil, font_style = nil, spacing = nil,
17
- indent = nil, borders = nil, background = nil)
18
- @name = style_name if style_name
19
- @font_name = font_name if font_name
20
- @font_size = font_size if font_size
21
- @font_style = font_style if font_style
22
- @spacing = spacing if spacing
23
- @indent = indent if indent
24
- @borders = borders if borders
25
- @background = background if background
26
- end
27
-
28
- def string_style_name
29
- @name.to_s.tr('_', ' ')
30
- end
31
-
32
- def self.init_by_name(style_name, object = :docx_paragraph)
33
- found_style = nil
34
- AllTestData.paragraph_settings::PARAGRAPH_STYLE_DATA.each do |style|
35
- found_style = style.clone if style.name == style_name
36
- end
37
-
38
- raise "Cannot find this style name - #{style_name}" if found_style.nil?
39
-
40
- case object
41
- when :table
42
- found_style.spacing = Spacing.new(found_style.spacing.before, 0, 1, found_style.spacing.line_rule)
43
- when :list
44
- found_style.indent = Indents.new(-0.635, 1.27, 0)
45
- end
46
-
47
- found_style
48
- end
49
-
50
- def ==(other)
51
- # FIXME, correct border comparision
52
- @font_name == other.font_name && @font_size.to_f == other.font_size.to_f && @font_style == other.font_style &&
53
- @spacing == other.spacing && @indent == other.indent && @background == other.background # && @border == other.border
54
- end
55
- end
56
- end
@@ -1,15 +0,0 @@
1
- # Image Data
2
- module OoxmlParser
3
- class Image
4
- attr_accessor :path, :start_x, :start_y, :end_x, :end_y, :wrap_text
5
-
6
- def initialize
7
- @path = nil
8
- @start_x = 0
9
- @start_y = 0
10
- @end_x = nil
11
- @end_y = nil
12
- @wrap_text = 'In text'
13
- end
14
- end
15
- end