ooxml_parser 0.30.0 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ooxml_parser/common_parser/common_data/content_types.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/coordinates.rb +9 -4
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +4 -0
- data/lib/ooxml_parser/docx_parser/document_structure/numbering.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/presentation/comment_authors.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb +1 -1
- data/lib/ooxml_parser/version.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/workbook.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 682b6146d274c90e967ce9d494c4c6df0fafe597d9dc01fc27c3b8fa854630c2
|
4
|
+
data.tar.gz: a5f7c131398910ef896a0c0b21578083e02dbe84aa6d024bf4abd4e2fab2c1bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df07e615fd1ecc0c4436072b978f6f6ba8959a83785d88fe2a1922417c94daef2227ae4914f34683e3f9542ca35e68de2652c5cf78b2a52cf828d6f46b850aa2
|
7
|
+
data.tar.gz: 0fce9c7ca3617ef27c67acc338f8e2eaa7a2220d98de3d4367d4b4bcf89f445a1982e58fe2e3f4ec6aa1bca48e8ed533f7bed9ad0a7d64244620f47dd241b4c3
|
@@ -21,7 +21,7 @@ module OoxmlParser
|
|
21
21
|
# Parse ContentTypes object
|
22
22
|
# @return [ContentTypes] result of parsing
|
23
23
|
def parse
|
24
|
-
doc =
|
24
|
+
doc = parse_xml("#{root_object.unpacked_folder}/[Content_Types].xml")
|
25
25
|
node = doc.xpath('*').first
|
26
26
|
|
27
27
|
node.xpath('*').each do |node_child|
|
@@ -3,6 +3,11 @@
|
|
3
3
|
module OoxmlParser
|
4
4
|
# Class for working with coordinates
|
5
5
|
class Coordinates
|
6
|
+
# @return [Regexp] regexp for row name
|
7
|
+
ROW_REGEXP = /[a-z]/i.freeze
|
8
|
+
# @return [Regexp] regexp for column name
|
9
|
+
COLUMN_REGEXP = /\d/.freeze
|
10
|
+
|
6
11
|
attr_accessor :row, :column, :list
|
7
12
|
|
8
13
|
def initialize(row = nil, column = nil, list = nil)
|
@@ -30,10 +35,10 @@ module OoxmlParser
|
|
30
35
|
range = arguments_string.split(':')
|
31
36
|
|
32
37
|
difference = []
|
33
|
-
symbols_from = range.first.scan(
|
34
|
-
symbols_to = range.last.scan(
|
35
|
-
digits_from = range.first.scan(
|
36
|
-
digits_to = range.last.scan(
|
38
|
+
symbols_from = range.first.scan(ROW_REGEXP).join
|
39
|
+
symbols_to = range.last.scan(ROW_REGEXP).join
|
40
|
+
digits_from = range.first.scan(COLUMN_REGEXP).join
|
41
|
+
digits_to = range.last.scan(COLUMN_REGEXP).join
|
37
42
|
|
38
43
|
difference[0] = [symbols_from, symbols_to] unless symbols_from == symbols_to
|
39
44
|
difference[1] = [digits_from, digits_to] unless digits_from == digits_to
|
@@ -47,6 +47,8 @@ module OoxmlParser
|
|
47
47
|
attr_accessor :shade
|
48
48
|
# @return [RunStyle] run style
|
49
49
|
attr_accessor :run_style
|
50
|
+
# @return [ValuedChild] ligatures type
|
51
|
+
attr_reader :ligatures
|
50
52
|
|
51
53
|
def initialize(params = {})
|
52
54
|
@font_name = params.fetch(:font_name, '')
|
@@ -124,6 +126,8 @@ module OoxmlParser
|
|
124
126
|
@shade = Shade.new(parent: self).parse(node_child)
|
125
127
|
when 'rStyle'
|
126
128
|
@run_style = RunStyle.new(parent: self).parse(node_child)
|
129
|
+
when 'ligatures'
|
130
|
+
@ligatures = ValuedChild.new(:symbol, parent: self).parse(node_child)
|
127
131
|
end
|
128
132
|
end
|
129
133
|
@font_color = DocxColorScheme.new(parent: self).parse(node)
|
@@ -41,7 +41,7 @@ module OoxmlParser
|
|
41
41
|
numbering_xml = "#{root_object.unpacked_folder}word/numbering.xml"
|
42
42
|
return nil unless File.exist?(numbering_xml)
|
43
43
|
|
44
|
-
node = parse_xml(
|
44
|
+
node = parse_xml(numbering_xml)
|
45
45
|
node.xpath('w:numbering/*').each do |numbering_child_node|
|
46
46
|
case numbering_child_node.name
|
47
47
|
when 'abstractNum'
|
@@ -18,7 +18,7 @@ module OoxmlParser
|
|
18
18
|
def parse(file = "#{root_object.unpacked_folder}/#{root_object.root_subfolder}/commentAuthors.xml")
|
19
19
|
return nil unless File.exist?(file)
|
20
20
|
|
21
|
-
document = parse_xml(
|
21
|
+
document = parse_xml(file)
|
22
22
|
node = document.xpath('*').first
|
23
23
|
|
24
24
|
node.xpath('*').each do |node_child|
|
@@ -18,7 +18,7 @@ module OoxmlParser
|
|
18
18
|
def parse(file = "#{root_object.unpacked_folder}/#{root_object.root_subfolder}/comments/comment1.xml")
|
19
19
|
return nil unless File.exist?(file)
|
20
20
|
|
21
|
-
document = parse_xml(
|
21
|
+
document = parse_xml(file)
|
22
22
|
node = document.xpath('*').first
|
23
23
|
|
24
24
|
node.xpath('*').each do |node_child|
|
data/lib/ooxml_parser/version.rb
CHANGED
@@ -55,7 +55,7 @@ module OoxmlParser
|
|
55
55
|
# @param [String] file path
|
56
56
|
# @return [PivotTableDefinition] result of parsing
|
57
57
|
def parse(file)
|
58
|
-
doc =
|
58
|
+
doc = parse_xml("#{root_object.unpacked_folder}/#{file}")
|
59
59
|
node = doc.xpath('//xmlns:pivotTableDefinition').first
|
60
60
|
node.attributes.each do |key, value|
|
61
61
|
case key
|
@@ -121,7 +121,7 @@ module OoxmlParser
|
|
121
121
|
parse_shared_strings
|
122
122
|
@root_subfolder = 'xl/'
|
123
123
|
root_object.add_to_xmls_stack('xl/workbook.xml')
|
124
|
-
@doc =
|
124
|
+
@doc = parse_xml(root_object.current_xml)
|
125
125
|
@theme = PresentationTheme.new(parent: self).parse("xl/#{link_to_theme_xml}") if link_to_theme_xml
|
126
126
|
@style_sheet = StyleSheet.new(parent: self).parse
|
127
127
|
@doc.xpath('xmlns:workbook/xmlns:sheets/xmlns:sheet').each do |sheet|
|
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.
|
4
|
+
version: 0.31.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: 2022-09-
|
13
|
+
date: 2022-09-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|