ooxml_parser 0.8.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +55 -48
  3. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb +1 -1
  4. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/plot_area/common_chart_data.rb +1 -1
  5. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/number_string_cache.rb +1 -1
  6. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +6 -10
  7. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +1 -1
  8. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +1 -1
  9. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +4 -6
  10. data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +4 -4
  11. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +1 -1
  12. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +1 -1
  13. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +1 -1
  14. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +1 -1
  15. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +1 -1
  16. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb +0 -4
  17. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/effect_reference.rb +0 -4
  18. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/fill_reference.rb +0 -4
  19. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/font_reference.rb +0 -4
  20. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/line_reference.rb +0 -4
  21. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +1 -1
  22. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +1 -1
  23. 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 +1 -1
  24. 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 +1 -1
  25. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +1 -1
  26. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +1 -1
  27. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +1 -1
  28. 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 +1 -1
  29. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +1 -1
  30. data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +1 -1
  31. data/lib/ooxml_parser/common_parser/common_data/color.rb +7 -11
  32. data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +29 -0
  33. data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +0 -33
  34. data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +1 -1
  35. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +1 -1
  36. data/lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb +1 -1
  37. data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +1 -1
  38. data/lib/ooxml_parser/common_parser/common_data/content_types.rb +8 -1
  39. data/lib/ooxml_parser/common_parser/common_data/coordinates.rb +2 -2
  40. data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +2 -2
  41. data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +1 -1
  42. data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +1 -1
  43. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +6 -4
  44. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +1 -1
  45. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +1 -1
  46. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +1 -1
  47. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +14 -1
  48. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +1 -1
  49. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +5 -9
  50. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +1 -1
  51. data/lib/ooxml_parser/common_parser/common_data/relationships.rb +1 -1
  52. data/lib/ooxml_parser/common_parser/common_data/table.rb +1 -1
  53. data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +1 -5
  54. data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +2 -2
  55. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +1 -1
  56. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +1 -1
  57. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +1 -1
  58. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/grid_span.rb +1 -7
  59. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +1 -1
  60. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +1 -1
  61. data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +1 -1
  62. data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +1 -1
  63. data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +1 -1
  64. data/lib/ooxml_parser/common_parser/common_data/underline.rb +1 -1
  65. data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +1 -1
  66. data/lib/ooxml_parser/common_parser/common_document_structure.rb +1 -0
  67. data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +2 -2
  68. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments.rb +2 -2
  69. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments/comment.rb +1 -1
  70. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended.rb +2 -2
  71. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +1 -1
  72. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +1 -1
  73. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +1 -1
  74. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +6 -10
  75. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +1 -1
  76. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +1 -1
  77. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +1 -1
  78. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +1 -1
  79. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +1 -1
  80. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +1 -1
  81. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +1 -1
  82. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +1 -1
  83. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +1 -1
  84. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_helper.rb +7 -0
  85. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +1 -1
  86. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +38 -21
  87. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +2 -2
  88. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +1 -1
  89. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/field_simple.rb +1 -1
  90. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +1 -1
  91. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_content.rb +1 -1
  92. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +5 -8
  93. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +1 -1
  94. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +2 -2
  95. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +1 -1
  96. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +1 -1
  97. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +1 -1
  98. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +1 -0
  99. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +1 -0
  100. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +1 -0
  101. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +1 -1
  102. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +2 -1
  103. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +2 -2
  104. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/comment_authors.rb +1 -1
  105. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comments.rb +1 -1
  106. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +1 -0
  107. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +1 -1
  108. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +1 -1
  109. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +1 -1
  110. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data/shape_tree.rb +1 -1
  111. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +2 -2
  112. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +1 -1
  113. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +1 -1
  114. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +1 -1
  115. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +1 -1
  116. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +1 -1
  117. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +1 -1
  118. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition_list.rb +1 -1
  119. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +1 -3
  120. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +1 -1
  121. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/table_styles.rb +1 -1
  122. data/lib/ooxml_parser/version.rb +1 -1
  123. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +17 -3
  124. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +1 -1
  125. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition.rb +6 -0
  126. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb +43 -0
  127. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb +37 -0
  128. 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
  129. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition.rb +114 -0
  130. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items.rb +43 -0
  131. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items/column_row_item.rb +22 -0
  132. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb +34 -0
  133. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields.rb +43 -0
  134. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field.rb +37 -0
  135. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items.rb +43 -0
  136. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items/item.rb +26 -0
  137. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_table_style_info.rb +42 -0
  138. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table.rb +1 -1
  139. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +1 -1
  140. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs.rb +1 -1
  141. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/cell_style/alignment.rb +5 -5
  142. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/xf.rb +1 -1
  143. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +1 -1
  144. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill.rb +1 -1
  145. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +1 -1
  146. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +1 -1
  147. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +1 -1
  148. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders.rb +1 -1
  149. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +1 -1
  150. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +1 -1
  151. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/comment_list.rb +1 -1
  152. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +1 -1
  153. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +1 -1
  154. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column.rb +1 -1
  155. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb +1 -1
  156. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +1 -1
  157. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb +1 -1
  158. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_columns.rb +1 -1
  159. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +1 -1
  160. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +1 -1
  161. metadata +111 -36
  162. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +0 -28
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'items/item'
4
+
5
+ module OoxmlParser
6
+ # Class for parsing <items> tag
7
+ class Items < OOXMLDocumentObject
8
+ # @return [Integer] count
9
+ attr_reader :count
10
+ # @return [Array<Item>] list of items
11
+ attr_reader :items
12
+
13
+ def initialize(parent: nil)
14
+ @items = []
15
+ super
16
+ end
17
+
18
+ # @return [Item] accessor
19
+ def [](key)
20
+ @items[key]
21
+ end
22
+
23
+ # Parse `<items>` tag
24
+ # @param [Nokogiri::XML:Element] node with items data
25
+ # @return [Items]
26
+ def parse(node)
27
+ node.attributes.each do |key, value|
28
+ case key
29
+ when 'count'
30
+ @count = value.value.to_i
31
+ end
32
+ end
33
+
34
+ node.xpath('*').each do |node_child|
35
+ case node_child.name
36
+ when 'item'
37
+ @items << Item.new(parent: self).parse(node_child)
38
+ end
39
+ end
40
+ self
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for parsing <item> tag
5
+ class Item < OOXMLDocumentObject
6
+ # @return [Integer] index of item
7
+ attr_reader :index
8
+ # @return [Symbol] type of item
9
+ attr_reader :type
10
+
11
+ # Parse `<item>` tag
12
+ # # @param [Nokogiri::XML:Element] node with Item data
13
+ # @return [item]
14
+ def parse(node)
15
+ node.attributes.each do |key, value|
16
+ case key
17
+ when 'x'
18
+ @index = value.value.to_i
19
+ when 't'
20
+ @type = value.value.to_sym
21
+ end
22
+ end
23
+ self
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for parsing <pivotTableStyleInfo> tag
5
+ class PivotTableStyleInfo < OOXMLDocumentObject
6
+ # @return [String] name of style
7
+ attr_reader :name
8
+ # @return [True, False] show row header
9
+ attr_reader :show_row_header
10
+ # @return [True, False] show column header
11
+ attr_reader :show_column_header
12
+ # @return [True, False] show row stripes
13
+ attr_reader :show_row_stripes
14
+ # @return [True, False] show column stripes
15
+ attr_reader :show_column_stripes
16
+ # @return [True, False] show last column
17
+ attr_reader :show_last_column
18
+
19
+ # Parse `<pivotTableStyleInfo>` tag
20
+ # @param [Nokogiri::XML:Element] node with PivotTableStyleInfo data
21
+ # @return [PivotTableStyleInfo]
22
+ def parse(node)
23
+ node.attributes.each do |key, value|
24
+ case key
25
+ when 'name'
26
+ @name = value.value.to_s
27
+ when 'showRowHeaders'
28
+ @show_row_header = attribute_enabled?(value)
29
+ when 'showColHeaders'
30
+ @show_column_header = attribute_enabled?(value)
31
+ when 'showRowStripes'
32
+ @show_row_stripes = attribute_enabled?(value)
33
+ when 'showColStripes'
34
+ @show_column_stripes = attribute_enabled?(value)
35
+ when 'showLastColumn'
36
+ @show_last_column = attribute_enabled?(value)
37
+ end
38
+ end
39
+ self
40
+ end
41
+ end
42
+ end
@@ -13,7 +13,7 @@ module OoxmlParser
13
13
 
14
14
  def initialize(parent: nil)
15
15
  @string_indexes = []
16
- @parent = parent
16
+ super
17
17
  end
18
18
 
19
19
  # Parse Shared string table file
@@ -23,7 +23,7 @@ module OoxmlParser
23
23
  @number_formats = NumberFormats.new(parent: self)
24
24
  @fonts = Fonts.new(parent: self)
25
25
  @fills = Fills.new(parent: self)
26
- @parent = parent
26
+ super
27
27
  end
28
28
 
29
29
  # Parse StyleSheet object
@@ -11,7 +11,7 @@ module OoxmlParser
11
11
 
12
12
  def initialize(parent: nil)
13
13
  @xf_array = []
14
- @parent = parent
14
+ super
15
15
  end
16
16
 
17
17
  # Parse CellXfs data
@@ -5,11 +5,11 @@ module OoxmlParser
5
5
  class XlsxAlignment < OOXMLDocumentObject
6
6
  attr_accessor :horizontal, :vertical, :wrap_text, :text_rotation
7
7
 
8
- def initialize(horizontal = :left, vertical = :bottom, wrap_text = false, parent: nil)
9
- @horizontal = horizontal
10
- @vertical = vertical
11
- @wrap_text = wrap_text
12
- @parent = parent
8
+ def initialize(params = {})
9
+ @horizontal = params.fetch(:horizontal, :left)
10
+ @vertical = params.fetch(:vertical, :bottom)
11
+ @wrap_text = params.fetch(:wrap_text, false)
12
+ super(parent: params[:parent])
13
13
  end
14
14
 
15
15
  # Parse XlsxAlignment object
@@ -80,7 +80,7 @@ module OoxmlParser
80
80
  def initialize(parent: nil)
81
81
  @numerical_format = 'General'
82
82
  @alignment = XlsxAlignment.new
83
- @parent = parent
83
+ super
84
84
  end
85
85
 
86
86
  # Parse Xf object
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
 
10
10
  def initialize(parent: nil)
11
11
  @fills_array = []
12
- @parent = parent
12
+ super
13
13
  end
14
14
 
15
15
  # @return [Array, Fill] accessor
@@ -22,7 +22,7 @@ module OoxmlParser
22
22
  node.attributes.each do |key, value|
23
23
  case key
24
24
  when 'color2'
25
- @color2 = Color.new(parent: self).parse_hex_string(value.value.split(' ').first.delete('#'))
25
+ @color2 = Color.new(parent: self).parse_hex_string(value.value.split.first.delete('#'))
26
26
  when 'id'
27
27
  @id = value.value.to_s
28
28
  @file = FileReference.new(parent: self).parse(node)
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
 
10
10
  def initialize(parent: nil)
11
11
  @fonts_array = []
12
- @parent = parent
12
+ super
13
13
  end
14
14
 
15
15
  # @return [Array<Font>] accessor
@@ -10,7 +10,7 @@ module OoxmlParser
10
10
  def initialize(parent: nil)
11
11
  @name = 'Calibri'
12
12
  @size = 11
13
- @parent = parent
13
+ super
14
14
  end
15
15
 
16
16
  # Parse Font object
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
 
10
10
  def initialize(parent: nil)
11
11
  @number_formats_array = []
12
- @parent = parent
12
+ super
13
13
  end
14
14
 
15
15
  # Parse NumberFormats data
@@ -11,7 +11,7 @@ module OoxmlParser
11
11
 
12
12
  def initialize(parent: nil)
13
13
  @borders_array = []
14
- @parent = parent
14
+ super
15
15
  end
16
16
 
17
17
  # Parse XlsxBorders data
@@ -39,7 +39,7 @@ module OoxmlParser
39
39
  @drawings = []
40
40
  @sheet_views = []
41
41
  @table_parts = []
42
- @parent = parent
42
+ super
43
43
  end
44
44
 
45
45
  # Perform parsing of relationships
@@ -13,7 +13,7 @@ module OoxmlParser
13
13
  def initialize(parent: nil)
14
14
  @authors = []
15
15
  @comment_list = []
16
- @parent = parent
16
+ super
17
17
  end
18
18
 
19
19
  # @return [Array<ExcelComment>] list of comments
@@ -7,7 +7,7 @@ module OoxmlParser
7
7
 
8
8
  def initialize(parent: nil)
9
9
  @comments = []
10
- @parent = parent
10
+ super
11
11
  end
12
12
 
13
13
  # Parse Author object
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
 
10
10
  def initialize(parent: nil)
11
11
  @characters = []
12
- @parent = parent
12
+ super
13
13
  end
14
14
 
15
15
  # Parse ExcelComment object
@@ -11,9 +11,9 @@ module OoxmlParser
11
11
  attr_accessor :show_row_column_headers
12
12
 
13
13
  def initialize(parent: nil)
14
- @parent = parent
15
14
  @show_gridlines = true
16
15
  @show_row_column_headers = true
16
+ super
17
17
  end
18
18
 
19
19
  # Parse SheetView object
@@ -14,7 +14,7 @@ module OoxmlParser
14
14
 
15
15
  def initialize(parent: nil)
16
16
  @show_button = true
17
- @parent = parent
17
+ super
18
18
  end
19
19
 
20
20
  # Parse FilterColumn data
@@ -11,7 +11,7 @@ module OoxmlParser
11
11
 
12
12
  def initialize(parent: nil)
13
13
  @filters_array = []
14
- @parent = parent
14
+ super
15
15
  end
16
16
 
17
17
  # @return [Array, CustomFilter] accessor
@@ -8,7 +8,7 @@ module OoxmlParser
8
8
 
9
9
  def initialize(parent: nil)
10
10
  @extension_array = []
11
- @parent = parent
11
+ super
12
12
  end
13
13
 
14
14
  # @return [Array, Extension] accessor
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
 
10
10
  def initialize(parent: nil)
11
11
  @sparklines_groups = []
12
- @parent = parent
12
+ super
13
13
  end
14
14
 
15
15
  # @return [SparklineGroup] accessor
@@ -11,7 +11,7 @@ module OoxmlParser
11
11
 
12
12
  def initialize(parent: nil)
13
13
  @table_column_array = []
14
- @parent = parent
14
+ super
15
15
  end
16
16
 
17
17
  # @return [Array, TableColumn] accessor
@@ -12,7 +12,7 @@ module OoxmlParser
12
12
 
13
13
  def initialize(parent: nil)
14
14
  @cells = []
15
- @parent = parent
15
+ super
16
16
  end
17
17
 
18
18
  # Parse XlsxRow object
@@ -18,7 +18,7 @@ module OoxmlParser
18
18
  def initialize(parent: nil)
19
19
  @style_index = 0 # default style is zero
20
20
  @raw_text = ''
21
- @parent = parent
21
+ super
22
22
  end
23
23
 
24
24
  # Parse XlsxCell object
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ooxml_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-08-04 00:00:00.000000000 Z
13
+ date: 2021-02-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
@@ -18,118 +18,182 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.6'
21
+ version: '1'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '1.6'
28
+ version: '1'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: ruby-filemagic
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '0.1'
35
+ version: '0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.1'
42
+ version: '0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rubyzip
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: '1.1'
50
- - - "<"
47
+ - - "~>"
51
48
  - !ruby/object:Gem::Version
52
- version: '3.0'
49
+ version: '2'
53
50
  type: :runtime
54
51
  prerelease: false
55
52
  version_requirements: !ruby/object:Gem::Requirement
56
53
  requirements:
57
- - - ">="
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '2'
57
+ - !ruby/object:Gem::Dependency
58
+ name: overcommit
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ - !ruby/object:Gem::Dependency
72
+ name: parallel_tests
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
58
76
  - !ruby/object:Gem::Version
59
- version: '1.1'
60
- - - "<"
77
+ version: '3'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
61
83
  - !ruby/object:Gem::Version
62
- version: '3.0'
84
+ version: '3'
63
85
  - !ruby/object:Gem::Dependency
64
86
  name: rake
65
87
  requirement: !ruby/object:Gem::Requirement
66
88
  requirements:
67
89
  - - "~>"
68
90
  - !ruby/object:Gem::Version
69
- version: '13.0'
91
+ version: '13'
70
92
  type: :development
71
93
  prerelease: false
72
94
  version_requirements: !ruby/object:Gem::Requirement
73
95
  requirements:
74
96
  - - "~>"
75
97
  - !ruby/object:Gem::Version
76
- version: '13.0'
98
+ version: '13'
99
+ - !ruby/object:Gem::Dependency
100
+ name: rspec
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: '3'
106
+ type: :development
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - "~>"
111
+ - !ruby/object:Gem::Version
112
+ version: '3'
77
113
  - !ruby/object:Gem::Dependency
78
114
  name: rubocop
79
115
  requirement: !ruby/object:Gem::Requirement
80
116
  requirements:
81
- - - '='
117
+ - - "~>"
82
118
  - !ruby/object:Gem::Version
83
- version: 0.88.0
119
+ version: '1'
84
120
  type: :development
85
121
  prerelease: false
86
122
  version_requirements: !ruby/object:Gem::Requirement
87
123
  requirements:
88
- - - '='
124
+ - - "~>"
89
125
  - !ruby/object:Gem::Version
90
- version: 0.88.0
126
+ version: '1'
91
127
  - !ruby/object:Gem::Dependency
92
128
  name: rubocop-performance
93
129
  requirement: !ruby/object:Gem::Requirement
94
130
  requirements:
95
- - - '='
131
+ - - "~>"
96
132
  - !ruby/object:Gem::Version
97
- version: 1.7.1
133
+ version: '1'
98
134
  type: :development
99
135
  prerelease: false
100
136
  version_requirements: !ruby/object:Gem::Requirement
101
137
  requirements:
102
- - - '='
138
+ - - "~>"
103
139
  - !ruby/object:Gem::Version
104
- version: 1.7.1
140
+ version: '1'
105
141
  - !ruby/object:Gem::Dependency
106
142
  name: rubocop-rake
107
143
  requirement: !ruby/object:Gem::Requirement
108
144
  requirements:
109
- - - '='
145
+ - - "~>"
110
146
  - !ruby/object:Gem::Version
111
- version: 0.5.1
147
+ version: '0'
112
148
  type: :development
113
149
  prerelease: false
114
150
  version_requirements: !ruby/object:Gem::Requirement
115
151
  requirements:
116
- - - '='
152
+ - - "~>"
117
153
  - !ruby/object:Gem::Version
118
- version: 0.5.1
154
+ version: '0'
119
155
  - !ruby/object:Gem::Dependency
120
156
  name: rubocop-rspec
121
157
  requirement: !ruby/object:Gem::Requirement
122
158
  requirements:
123
- - - '='
159
+ - - "~>"
124
160
  - !ruby/object:Gem::Version
125
- version: 1.42.0
161
+ version: '2'
126
162
  type: :development
127
163
  prerelease: false
128
164
  version_requirements: !ruby/object:Gem::Requirement
129
165
  requirements:
130
- - - '='
166
+ - - "~>"
167
+ - !ruby/object:Gem::Version
168
+ version: '2'
169
+ - !ruby/object:Gem::Dependency
170
+ name: simplecov
171
+ requirement: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - "~>"
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ type: :development
177
+ prerelease: false
178
+ version_requirements: !ruby/object:Gem::Requirement
179
+ requirements:
180
+ - - "~>"
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ - !ruby/object:Gem::Dependency
184
+ name: yard
185
+ requirement: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: 0.9.20
190
+ type: :development
191
+ prerelease: false
192
+ version_requirements: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
131
195
  - !ruby/object:Gem::Version
132
- version: 1.42.0
196
+ version: 0.9.20
133
197
  description: Parse OOXML files (docx, xlsx, pptx)
134
198
  email:
135
199
  - shockwavenn@gmail.com
@@ -399,7 +463,6 @@ files:
399
463
  - lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb
400
464
  - lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb
401
465
  - lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_notes.rb
402
- - lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb
403
466
  - lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb
404
467
  - lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb
405
468
  - lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/animation_effect/animation_effect.rb
@@ -424,8 +487,20 @@ files:
424
487
  - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb
425
488
  - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache.rb
426
489
  - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition.rb
490
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
491
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
492
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb
427
493
  - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_source.rb
428
494
  - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_source/worksheet_source.rb
495
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition.rb
496
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items.rb
497
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items/column_row_item.rb
498
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb
499
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields.rb
500
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field.rb
501
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items.rb
502
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items/item.rb
503
+ - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_table_style_info.rb
429
504
  - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table.rb
430
505
  - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table/string_index.rb
431
506
  - lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb
@@ -490,14 +565,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
490
565
  requirements:
491
566
  - - ">="
492
567
  - !ruby/object:Gem::Version
493
- version: '2.4'
568
+ version: '2.5'
494
569
  required_rubygems_version: !ruby/object:Gem::Requirement
495
570
  requirements:
496
571
  - - ">="
497
572
  - !ruby/object:Gem::Version
498
573
  version: '0'
499
574
  requirements: []
500
- rubygems_version: 3.1.4
575
+ rubygems_version: 3.2.9
501
576
  signing_key:
502
577
  specification_version: 4
503
578
  summary: OoxmlParser Gem