ooxml_parser 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87857f8a432b1217218ea6780f6a836aa1dc92508623b2f5475b7baac9c488ad
4
- data.tar.gz: d4f19dd557b08a1f11141d38c13833eee7fa767c5a86e95bd743fe12aaef8982
3
+ metadata.gz: 70f22490ee51df42e0fcdab9b647c19ee44adcef3ad22a2af2ee68de346b8fcd
4
+ data.tar.gz: e7faaec854030bb9b6b435401c78d50f1421bbf12eac175c8772eba608b92ed6
5
5
  SHA512:
6
- metadata.gz: f5708ce9c0fb1825dc929c876780a83d96b5b99d8b21df16506eb589a2d6807111e747064bcaa5f5a300fedb6ec8c502bd912ba846ac6d5cd62c35eee23d7870
7
- data.tar.gz: 564d9a0a2fa4501fb177bf8aeb9e498f7763dd57c30dea0647c5789259877ed7f8fc7d9b2c873e2f3c6ff209f7f7d3ff082f3daf1fb09033c3ea2525b690569e
6
+ metadata.gz: b3c1dadbed29dddce8f84bb2df7c09b50fa117608f66fb5f4895259618d7659e772cf7617de7e5ea7979d914800d589eff122a6022670daeaad73de1817b013c
7
+ data.tar.gz: bb7a942fbc164badb3b066bd5fea520f972b8821929f10027f3f4be9e91161cbe7d11f4f5c519559da51280db12d7aa9f487dd31a24179e2bb8846b167e25cae
@@ -11,7 +11,7 @@ module OoxmlParser
11
11
  # Class for working with DocxParagraphRun
12
12
  class DocxParagraphRun < OOXMLDocumentObject
13
13
  include DocxParagraphRunHelpers
14
- attr_accessor :number, :font, :vertical_align, :size, :font_color, :background_color, :font_style, :text, :drawings,
14
+ attr_accessor :number, :font, :vertical_align, :size, :font_color, :font_style, :text, :drawings,
15
15
  :link, :highlight, :effect, :caps, :w,
16
16
  :position, :em, :spacing, :break, :touch, :shape, :footnote, :endnote, :fld_char, :style,
17
17
  :comments, :alternate_content, :page_number, :text_outline, :text_fill
@@ -22,6 +22,8 @@ module OoxmlParser
22
22
  attr_accessor :run_properties
23
23
  # @return [RunObject] object of run
24
24
  attr_accessor :object
25
+ # @return [Shade] shade properties
26
+ attr_accessor :shade
25
27
 
26
28
  def initialize(parent: nil)
27
29
  @number = 0
@@ -53,10 +53,7 @@ module OoxmlParser
53
53
  when 'color'
54
54
  parse_color_tag(node_child)
55
55
  when 'shd'
56
- self.background_color = node_child.attribute('fill').value
57
- unless node_child.attribute('fill').value == 'auto' || node_child.attribute('fill').value == '' || node_child.attribute('fill').value == 'null'
58
- self.background_color = Color.new(parent: self).parse_hex_string(node_child.attribute('fill').value)
59
- end
56
+ @shade = Shade.new(parent: self).parse(node_child)
60
57
  when 'u', 'uCs'
61
58
  parse_underline(node_child)
62
59
  when 'strike'
@@ -68,6 +65,13 @@ module OoxmlParser
68
65
  self
69
66
  end
70
67
 
68
+ # Temp method to return background color
69
+ # Need to be compatible with older versions
70
+ # @return [OoxmlParser::Color]
71
+ def background_color
72
+ shade.to_background_color
73
+ end
74
+
71
75
  private
72
76
 
73
77
  # Parse `color` tag
@@ -4,6 +4,6 @@ module OoxmlParser
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
6
  # [String] Version of Gem
7
- STRING = '0.12.0'
7
+ STRING = '0.12.1'
8
8
  end
9
9
  end
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.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE