ooxml_parser 0.12.1 → 0.12.2

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: 70f22490ee51df42e0fcdab9b647c19ee44adcef3ad22a2af2ee68de346b8fcd
4
- data.tar.gz: e7faaec854030bb9b6b435401c78d50f1421bbf12eac175c8772eba608b92ed6
3
+ metadata.gz: 36954aec83ece68abe869fbdacc1eb46f3324ca2220fa1309480ac58c1d7a30e
4
+ data.tar.gz: aa146d19ad2d1791d435be68b2d13bf4f601fbea14856cd880c292c269d3fc77
5
5
  SHA512:
6
- metadata.gz: b3c1dadbed29dddce8f84bb2df7c09b50fa117608f66fb5f4895259618d7659e772cf7617de7e5ea7979d914800d589eff122a6022670daeaad73de1817b013c
7
- data.tar.gz: bb7a942fbc164badb3b066bd5fea520f972b8821929f10027f3f4be9e91161cbe7d11f4f5c519559da51280db12d7aa9f487dd31a24179e2bb8846b167e25cae
6
+ metadata.gz: d024e15631968da836ad38f32316f52eb87a9aa924cbb7240ea445162679799ce4cfc85183122e07fdc8a501b34efde6a6c3d38d179b7fd7ee12fd5e17a95693
7
+ data.tar.gz: e97ac2cff7f7db1f93e79bff2b7110db0c78a748f396337ac851369c799001eb9779762324dfa7c177a9583905cd435db2ba507caab7faf41a5a980e66a0f31c
@@ -3,6 +3,7 @@
3
3
  require_relative 'paragrpah_properties/numbering_properties'
4
4
  require_relative 'paragrpah_properties/paragraph_borders'
5
5
  require_relative 'paragrpah_properties/paragraph_spacing'
6
+ require_relative 'paragrpah_properties/paragraph_stlye_ref'
6
7
  require_relative 'paragrpah_properties/spacing'
7
8
  require_relative 'paragrpah_properties/tabs'
8
9
  module OoxmlParser
@@ -17,6 +18,8 @@ module OoxmlParser
17
18
  attr_accessor :run_properties
18
19
  # @return [Borders] borders of paragraph
19
20
  attr_accessor :paragraph_borders
21
+ # @return [ParagraphStyleRef] Referenced Paragraph Style
22
+ attr_accessor :paragraph_style_ref
20
23
  # @return [True, False] Specifies that the paragraph
21
24
  # (or at least part of it) should be rendered on
22
25
  # the same page as the next paragraph when possible
@@ -84,6 +87,8 @@ module OoxmlParser
84
87
  @run_properties = RunProperties.new(parent: self).parse(node_child)
85
88
  when 'pBdr'
86
89
  @paragraph_borders = ParagraphBorders.new(parent: self).parse(node_child)
90
+ when 'pStyle'
91
+ @paragraph_style_ref = ParagraphStyleRef.new(parent: self).parse(node_child)
87
92
  when 'keepNext'
88
93
  @keep_next = true
89
94
  when 'sectPr'
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OoxmlParser
4
+ # Class for parsing `pStyle` tags
5
+ class ParagraphStyleRef < OOXMLDocumentObject
6
+ # @return [Integer] value of ParagraphStyleRef
7
+ attr_reader :value
8
+
9
+ # Parse ParagraphStyleRef object
10
+ # @param node [Nokogiri::XML:Element] node to parse
11
+ # @return [ParagraphStyleRef] result of parsing
12
+ def parse(node)
13
+ node.attributes.each do |key, value|
14
+ case key
15
+ when 'val'
16
+ @value = value.value.to_s
17
+ end
18
+ end
19
+ self
20
+ end
21
+
22
+ # @return [ParagraphStyle] which was referenced
23
+ def referenced_style
24
+ root_object.document_style_by_id(value)
25
+ end
26
+ end
27
+ end
@@ -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.1'
7
+ STRING = '0.12.2'
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.1
4
+ version: 0.12.2
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: 2021-02-17 00:00:00.000000000 Z
13
+ date: 2021-02-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
@@ -321,6 +321,7 @@ files:
321
321
  - lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb
322
322
  - lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb
323
323
  - lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb
324
+ - lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_stlye_ref.rb
324
325
  - lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb
325
326
  - lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing/line_spacing.rb
326
327
  - lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb