ooxml_parser 0.7.1 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) 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 +2 -21
  12. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +51 -4
  13. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +1 -1
  14. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +1 -1
  15. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +1 -1
  16. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +1 -1
  17. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb +0 -4
  18. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/effect_reference.rb +0 -4
  19. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/fill_reference.rb +0 -4
  20. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/font_reference.rb +0 -4
  21. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/line_reference.rb +0 -4
  22. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +1 -1
  23. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.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.rb +1 -1
  25. 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
  26. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +1 -1
  27. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +1 -1
  28. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +13 -3
  29. 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
  30. data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +10 -3
  31. data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +1 -1
  32. data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +1 -1
  33. data/lib/ooxml_parser/common_parser/common_data/color.rb +11 -77
  34. data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +33 -3
  35. data/lib/ooxml_parser/common_parser/common_data/color/color_indexes.list +66 -0
  36. data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +8 -2
  37. data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +0 -33
  38. data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +1 -1
  39. data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +1 -1
  40. data/lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb +1 -1
  41. data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +1 -1
  42. data/lib/ooxml_parser/common_parser/common_data/content_types.rb +1 -1
  43. data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +15 -4
  44. data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +5 -1
  45. data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +1 -1
  46. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +1 -1
  47. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +1 -1
  48. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +31 -9
  49. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +5 -3
  50. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +1 -1
  51. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +1 -1
  52. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +1 -1
  53. data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +1 -1
  54. data/lib/ooxml_parser/common_parser/common_data/relationships.rb +1 -1
  55. data/lib/ooxml_parser/common_parser/common_data/table.rb +1 -1
  56. data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +1 -5
  57. data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +2 -2
  58. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +1 -1
  59. data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +1 -1
  60. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +1 -1
  61. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell_properties.rb +2 -0
  62. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/grid_span.rb +1 -7
  63. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +1 -1
  64. data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +1 -1
  65. data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +1 -1
  66. data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +1 -1
  67. data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +1 -1
  68. data/lib/ooxml_parser/common_parser/common_data/underline.rb +4 -3
  69. data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +1 -1
  70. data/lib/ooxml_parser/common_parser/common_document_structure.rb +1 -0
  71. data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +15 -7
  72. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments.rb +2 -2
  73. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments/comment.rb +1 -1
  74. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended.rb +2 -2
  75. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +1 -1
  76. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +1 -1
  77. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +1 -1
  78. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +5 -9
  79. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +1 -1
  80. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +1 -1
  81. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +1 -1
  82. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +1 -1
  83. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +1 -1
  84. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +1 -1
  85. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +1 -1
  86. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +1 -1
  87. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +1 -1
  88. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +1 -1
  89. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +38 -21
  90. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +1 -1
  91. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +1 -1
  92. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/field_simple.rb +1 -1
  93. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +3 -3
  94. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_content.rb +1 -1
  95. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +5 -8
  96. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +9 -3
  97. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +2 -2
  98. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +1 -1
  99. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +1 -1
  100. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +1 -1
  101. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +4 -1
  102. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +4 -2
  103. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +1 -0
  104. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +1 -1
  105. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +2 -1
  106. data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +2 -2
  107. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/comment_authors.rb +1 -1
  108. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comments.rb +1 -1
  109. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +1 -0
  110. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +1 -1
  111. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +3 -3
  112. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +1 -1
  113. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data/shape_tree.rb +1 -1
  114. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +2 -2
  115. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +1 -1
  116. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +1 -1
  117. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +1 -1
  118. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +1 -1
  119. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +1 -1
  120. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +1 -1
  121. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition_list.rb +1 -1
  122. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +1 -1
  123. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/table_styles.rb +1 -1
  124. data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +1 -1
  125. data/lib/ooxml_parser/version.rb +1 -1
  126. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +1 -1
  127. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table.rb +1 -1
  128. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +1 -1
  129. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs.rb +1 -1
  130. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/cell_style/alignment.rb +5 -5
  131. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/xf.rb +1 -1
  132. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +1 -1
  133. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +1 -1
  134. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +1 -1
  135. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +1 -1
  136. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders.rb +1 -1
  137. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +1 -1
  138. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +1 -1
  139. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/comment_list.rb +1 -1
  140. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +1 -1
  141. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +1 -1
  142. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column.rb +1 -1
  143. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb +1 -1
  144. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +1 -1
  145. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb +1 -1
  146. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_columns.rb +1 -1
  147. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +1 -1
  148. data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +1 -1
  149. metadata +9 -9
  150. data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +0 -28
@@ -10,7 +10,7 @@ module OoxmlParser
10
10
 
11
11
  def initialize(parent: nil)
12
12
  @path = ''
13
- @parent = parent
13
+ super
14
14
  end
15
15
 
16
16
  # Parse ImageFill object
@@ -11,7 +11,7 @@ module OoxmlParser
11
11
 
12
12
  def initialize(parent: nil)
13
13
  @gradient_stops = []
14
- @parent = parent
14
+ super
15
15
  end
16
16
 
17
17
  # Parse GradientColor object
@@ -15,7 +15,7 @@ module OoxmlParser
15
15
  # TODO: if no swap performed - incorrect color parsing. But don't know why it needed
16
16
  themes_array[0], themes_array[1] = themes_array[1], themes_array[0]
17
17
  themes_array[2], themes_array[3] = themes_array[3], themes_array[2]
18
- hls = HSLColor.rgb_to_hsl(themes_array[theme].color)
18
+ hls = themes_array[theme].color.to_hsl
19
19
  tint = 0 if tint.nil?
20
20
  hls.calculate_rgb_with_tint(tint)
21
21
  end
@@ -8,7 +8,7 @@ module OoxmlParser
8
8
  def initialize(offset = nil, ratio = nil, parent: nil)
9
9
  @offset = offset
10
10
  @ratio = ratio
11
- @parent = parent
11
+ super(parent: parent)
12
12
  end
13
13
 
14
14
  # Parse Tile object
@@ -9,8 +9,8 @@ module OoxmlParser
9
9
  attr_accessor :content_types_list
10
10
 
11
11
  def initialize(parent: nil)
12
- @parent = parent
13
12
  @content_types_list = []
13
+ super
14
14
  end
15
15
 
16
16
  # @return [Array] accessor
@@ -3,9 +3,20 @@
3
3
  module OoxmlParser
4
4
  # Class for parsing `hlinkClick`, `hyperlink` tags
5
5
  class Hyperlink < OOXMLDocumentObject
6
- attr_accessor :url, :tooltip, :coordinates, :highlight_click, :action
7
- attr_accessor :action_link
8
- attr_accessor :id
6
+ # @return [OOXMLDocumentObject] url of hyperlink
7
+ attr_accessor :url
8
+ # @return [String] tooltip value
9
+ attr_reader :tooltip
10
+ # @return [Coordinates] coordinates of link
11
+ attr_reader :coordinates
12
+ # @return [True, False] should click be highlighted
13
+ attr_reader :highlight_click
14
+ # @return [Symbol] type of action
15
+ attr_reader :action
16
+ # @return [String] value of action link
17
+ attr_reader :action_link
18
+ # @return [String] id of link
19
+ attr_reader :id
9
20
  # @return [Array<ParagraphRun>] run of paragraph
10
21
  attr_reader :runs
11
22
 
@@ -16,8 +27,8 @@ module OoxmlParser
16
27
  @url = link
17
28
  @tooltip = tooltip
18
29
  @coordinates = coordinates
19
- @parent = parent
20
30
  @runs = []
31
+ super(parent: parent)
21
32
  end
22
33
 
23
34
  alias link url
@@ -43,9 +43,13 @@ module OoxmlParser
43
43
  end
44
44
 
45
45
  class << self
46
+ # @return [String] path to root subfolder
46
47
  attr_accessor :root_subfolder
48
+ # @return [PresentationTheme] list of themes
47
49
  attr_accessor :theme
50
+ # @return [Array<String>] stack of xmls
48
51
  attr_accessor :xmls_stack
52
+ # @return [String] path to root folder
49
53
  attr_accessor :path_to_folder
50
54
 
51
55
  # @param path_to_file [String] file
@@ -104,7 +108,7 @@ module OoxmlParser
104
108
 
105
109
  # @return [String] dir to base of file
106
110
  def dir
107
- OOXMLDocumentObject.path_to_folder + File.dirname(OOXMLDocumentObject.xmls_stack.last) + '/'
111
+ "#{OOXMLDocumentObject.path_to_folder}#{File.dirname(OOXMLDocumentObject.xmls_stack.last)}/"
108
112
  end
109
113
 
110
114
  # @return [String] path to current xml file
@@ -16,7 +16,7 @@ module OoxmlParser
16
16
  @runs = runs
17
17
  @formulas = formulas
18
18
  @runs = []
19
- @parent = parent
19
+ super(parent: parent)
20
20
  end
21
21
 
22
22
  alias characters runs
@@ -39,7 +39,7 @@ module OoxmlParser
39
39
  :multiple)
40
40
  @keep_next = false
41
41
  @tabs = []
42
- @parent = parent
42
+ super(parent: parent)
43
43
  end
44
44
 
45
45
  # Parse ParagraphProperties object
@@ -14,7 +14,7 @@ module OoxmlParser
14
14
  def initialize(properties = RunProperties.new, text = '', parent: nil)
15
15
  @properties = properties
16
16
  @text = text
17
- @parent = parent
17
+ super(parent: parent)
18
18
  end
19
19
 
20
20
  # Parse ParagraphRun object
@@ -9,12 +9,34 @@ require_relative 'run_properties/shade'
9
9
  module OoxmlParser
10
10
  # Data about `rPr` object
11
11
  class RunProperties < OOXMLDocumentObject
12
- attr_accessor :font_style, :font_color, :space, :dirty, :font_name, :font_size, :baseline, :hyperlink, :caps,
13
- :vertical_align, :outline
14
- attr_accessor :shadow
15
- attr_accessor :emboss
16
- attr_accessor :vanish
17
- attr_accessor :rtl
12
+ # @return [FontStyle] font style of run
13
+ attr_accessor :font_style
14
+ # @return [Color, DocxColorScheme] color of run
15
+ attr_reader :font_color
16
+ # @return [OoxmlSize] space size
17
+ attr_reader :space
18
+ # @return [string] name of font
19
+ attr_reader :font_name
20
+ # @return [Float] font size
21
+ attr_reader :font_size
22
+ # @return [Symbol] baseline of run
23
+ attr_reader :baseline
24
+ # @return [Hyperlink] hyperlink of run
25
+ attr_reader :hyperlink
26
+ # @return [Symbol] caps data
27
+ attr_reader :caps
28
+ # @return [Symbol] vertical align data
29
+ attr_reader :vertical_align
30
+ # @return [Outline] outline data
31
+ attr_reader :outline
32
+ # @return [True, False] is text shadow
33
+ attr_reader :shadow
34
+ # @return [True, False] is text emboss
35
+ attr_reader :emboss
36
+ # @return [True, False] is text vanish
37
+ attr_reader :vanish
38
+ # @return [True, False] is text rtl
39
+ attr_reader :rtl
18
40
  # @return [Size] get run size
19
41
  attr_accessor :size
20
42
  # @return [RunSpacing] get run spacing
@@ -30,11 +52,11 @@ module OoxmlParser
30
52
  # @return [RunStyle] run style
31
53
  attr_accessor :run_style
32
54
 
33
- def initialize(parent: nil)
34
- @font_name = ''
55
+ def initialize(params = {})
56
+ @font_name = params.fetch(:font_name, '')
35
57
  @font_style = FontStyle.new
36
58
  @baseline = :baseline
37
- @parent = parent
59
+ super(parent: params[:parent])
38
60
  end
39
61
 
40
62
  # Parse RunProperties object
@@ -4,12 +4,14 @@
4
4
  module OoxmlParser
5
5
  # Class for parsing `w:ln` tags
6
6
  class Outline < OOXMLDocumentObject
7
- attr_accessor :width
8
- attr_accessor :color_scheme
7
+ # @return [OoxmlSize] width of outline
8
+ attr_reader :width
9
+ # @return [DocxColorScheme] color of outline
10
+ attr_reader :color_scheme
9
11
 
10
12
  def initialize(parent: nil)
11
13
  @width = OoxmlSize.new(0)
12
- @parent = parent
14
+ super
13
15
  end
14
16
 
15
17
  # Parse Outline object
@@ -17,7 +17,7 @@ module OoxmlParser
17
17
  @value = value
18
18
  @color = color
19
19
  @fill = fill
20
- @parent = parent
20
+ super(parent: parent)
21
21
  end
22
22
 
23
23
  # @return [String] text representation
@@ -7,7 +7,7 @@ module OoxmlParser
7
7
 
8
8
  def initialize(ilvl = 0, parent: nil)
9
9
  @ilvl = ilvl
10
- @parent = parent
10
+ super(parent: parent)
11
11
  end
12
12
 
13
13
  # @return [AbstractNumbering] AbstractNumbering of current properties
@@ -48,7 +48,7 @@ module OoxmlParser
48
48
  result_string = ''
49
49
  variables = instance_variables
50
50
  variables.each do |current_variable|
51
- result_string += current_variable.to_s.sub('@', '') + ': ' + instance_variable_get(current_variable).to_s + "\n"
51
+ result_string += "#{current_variable.to_s.sub('@', '')}: #{instance_variable_get(current_variable)}\n"
52
52
  end
53
53
  result_string
54
54
  end
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
 
10
10
  def initialize(parent: nil)
11
11
  @tabs_array = []
12
- @parent = parent
12
+ super
13
13
  end
14
14
 
15
15
  # @return [Array, Column] accessor
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
 
10
10
  def initialize(parent: nil)
11
11
  @relationship = []
12
- @parent = parent
12
+ super
13
13
  end
14
14
 
15
15
  # @return [Array, Column] accessor for relationship
@@ -12,7 +12,7 @@ module OoxmlParser
12
12
 
13
13
  def initialize(rows = [], parent: nil)
14
14
  @rows = rows
15
- @parent = parent
15
+ super(parent: parent)
16
16
  end
17
17
 
18
18
  alias table_properties properties
@@ -8,11 +8,7 @@ module OoxmlParser
8
8
  left = OoxmlSize.new(0),
9
9
  right = OoxmlSize.new(0),
10
10
  parent: nil)
11
- @top = top
12
- @bottom = bottom
13
- @left = left
14
- @right = right
15
- @parent = parent
11
+ super(true, top, bottom, left, right, parent: parent)
16
12
  end
17
13
 
18
14
  # Parse ParagraphMargins object
@@ -11,7 +11,7 @@ module OoxmlParser
11
11
  @bottom = bottom
12
12
  @left = left
13
13
  @right = right
14
- @parent = parent
14
+ super(parent: parent)
15
15
  end
16
16
 
17
17
  # TODO: Separate @is_default attribute and remove this method
@@ -29,7 +29,7 @@ module OoxmlParser
29
29
 
30
30
  # @return [String] result of convert of object to string
31
31
  def to_s
32
- 'Default: ' + is_default.to_s + ' top: ' + @top.to_s + ', bottom: ' + @bottom.to_s + ', left: ' + @left.to_s + ', right: ' + @right.to_s
32
+ "Default: #{is_default} top: #{@top}, bottom: #{@bottom}, left: #{@left}, right: #{@right}"
33
33
  end
34
34
 
35
35
  # Parse TableMargins object
@@ -15,7 +15,7 @@ module OoxmlParser
15
15
  @banding_column = false
16
16
  @no_horizontal_banding = false
17
17
  @no_horizontal_banding = false
18
- @parent = parent
18
+ super
19
19
  end
20
20
 
21
21
  # Parse TableLook object
@@ -23,7 +23,7 @@ module OoxmlParser
23
23
  @type = type
24
24
  @run_properties = nil
25
25
  @table_cell_properties = CellProperties.new
26
- @parent = parent
26
+ super(parent: parent)
27
27
  end
28
28
 
29
29
  # Parse table style property
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
 
10
10
  def initialize(parent: nil)
11
11
  @elements = []
12
- @parent = parent
12
+ super
13
13
  end
14
14
 
15
15
  alias cell_properties properties
@@ -77,6 +77,8 @@ module OoxmlParser
77
77
 
78
78
  node.attributes.each do |key, value|
79
79
  case key
80
+ when 'vert'
81
+ @text_direction = value.value.to_sym
80
82
  when 'anchor'
81
83
  @anchor = value_to_symbol(value)
82
84
  end
@@ -10,15 +10,9 @@ module OoxmlParser
10
10
 
11
11
  def initialize(parent: nil)
12
12
  @type = 'horizontal'
13
- @parent = parent
13
+ super
14
14
  end
15
15
 
16
- alias count_of_merged_cells value
17
-
18
- extend Gem::Deprecate
19
- deprecate :type, 'GridSpan always horizontal', 2069, 1
20
- deprecate :count_of_merged_cells, 'value', 2069, 1
21
-
22
16
  # Parse Grid Span data
23
17
  # @param [Nokogiri::XML:Element] node with GridSpan data
24
18
  # @return [GridSpan] value of GridSpan
@@ -15,7 +15,7 @@ module OoxmlParser
15
15
  @between = BordersProperties.new
16
16
  @inner_horizontal = BordersProperties.new
17
17
  @inner_vertical = BordersProperties.new
18
- @parent = parent
18
+ super
19
19
  end
20
20
 
21
21
  # Method to copy object
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
  def initialize(fill = nil, line_join = nil, parent: nil)
10
10
  @fill = fill
11
11
  @line_join = line_join
12
- @parent = parent
12
+ super(parent: parent)
13
13
  end
14
14
 
15
15
  # Parse TableCellLine object
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
 
10
10
  def initialize(cells = [], parent: nil)
11
11
  @cells = cells
12
- @parent = parent
12
+ super(parent: parent)
13
13
  end
14
14
 
15
15
  alias table_row_height height
@@ -9,7 +9,7 @@ module OoxmlParser
9
9
 
10
10
  def initialize(parent: nil)
11
11
  @columns = []
12
- @parent = parent
12
+ super
13
13
  end
14
14
 
15
15
  # Compare this object to other
@@ -40,7 +40,7 @@ module OoxmlParser
40
40
  def initialize(parent: nil)
41
41
  @jc = :left
42
42
  @table_borders = TableBorders.new
43
- @parent = parent
43
+ super
44
44
  end
45
45
 
46
46
  # Parse TableProperties object
@@ -8,16 +8,17 @@ module OoxmlParser
8
8
  def initialize(style = :none, color = nil, parent: nil)
9
9
  @style = style == 'single' ? :single : style
10
10
  @color = color
11
- @parent = parent
11
+ super(parent: parent)
12
12
  end
13
13
 
14
14
  # Compare this object to other
15
15
  # @param other [Object] any other object
16
16
  # @return [True, False] result of comparision
17
17
  def ==(other)
18
- if other.is_a? Underline
18
+ case other
19
+ when Underline
19
20
  @style.to_sym == other.style.to_sym && @color == other.color
20
- elsif other.is_a? Symbol
21
+ when Symbol
21
22
  @style.to_sym == other
22
23
  else
23
24
  false
@@ -9,8 +9,8 @@ module OoxmlParser
9
9
  attr_reader :type
10
10
 
11
11
  def initialize(type = :string, parent: nil)
12
- @parent = parent
13
12
  @type = type
13
+ super(parent: parent)
14
14
  end
15
15
 
16
16
  # Parse ValuedChild object
@@ -19,6 +19,7 @@ module OoxmlParser
19
19
  @default_font_size = params.fetch(:default_font_size, 18)
20
20
  @default_font_typeface = params.fetch(:default_font_typeface, 'Arial')
21
21
  @default_font_style = FontStyle.new
22
+ super(parent: nil)
22
23
  end
23
24
  end
24
25
  end