roo-xls 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +2 -1
- data/README.md +5 -0
- data/lib/roo/xls/excel_2003_xml.rb +45 -24
- data/lib/roo/xls/version.rb +1 -1
- data/roo-xls.gemspec +1 -2
- data/spec/lib/roo/xls/excel2003xml_spec.rb +196 -6
- data/test/files/font_colors.xml +203 -0
- data/test/files/font_colors_screenshot_in_Mac_Excel_16.10.png +0 -0
- metadata +10 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5497f8b6a9779fc588a2a111be208b15b161980a742db7aa51bf493a1aa97cd6
|
4
|
+
data.tar.gz: 40589a5d46b9134aa6dfe7fd8e93fc38d1409e1c318fef7d93cd958ff95b8cbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7024a683484e5a679df01b9a4d7a4a62eb6a11a826e68fe51e9ab0ef3019e103349d1d097a52d51cf188fcb78ad67acad7fa827cdf7c4f7e58615c052f6c9d8f
|
7
|
+
data.tar.gz: b3d528dee5ea5771d1f394701bee2fc305f5064c688a1f5df4595fd4c811c2d3568a5e2d10a2b0558432bc03191edd5f6a6c1a67de74e9a3bd6ac563740f4edb
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -10,6 +10,11 @@ This library extends Roo to add support for handling class Excel files, includin
|
|
10
10
|
There is no support for formulas in Roo for .xls files - you can get the result
|
11
11
|
of a formula but not the formula itself.
|
12
12
|
|
13
|
+
## Limitations
|
14
|
+
|
15
|
+
Roo::Xls currently doesn't provide support for the following features in Roo:
|
16
|
+
* [Option `:expand_merged_ranged => true`](https://github.com/roo-rb/roo#expand_merged_ranges)
|
17
|
+
|
13
18
|
## License
|
14
19
|
|
15
20
|
While Roo and Roo::Xls are licensed under the MIT / Expat license, please note that the `spreadsheet` gem [is released under](https://github.com/zdavatz/spreadsheet/blob/master/LICENSE.txt) the GPLv3 license. Please be aware that the author of the `spreadsheet` gem [claims you need a commercial license](http://spreadsheet.ch/2014/10/24/using-ruby-spreadsheet-on-heroku-with-dynos/) to use it as part of a public-facing, closed-source service, an interpretation [at odds with the FSF's intent and interpretation of the license](http://www.gnu.org/licenses/gpl-faq.html#UnreleasedMods).
|
@@ -21,7 +21,7 @@ class Roo::Excel2003XML < Roo::Base
|
|
21
21
|
end
|
22
22
|
@doc = ::Roo::Utils.load_xml(@filename)
|
23
23
|
end
|
24
|
-
namespace = @doc.namespaces.select{|
|
24
|
+
namespace = @doc.namespaces.select { |_, urn| urn == 'urn:schemas-microsoft-com:office:spreadsheet' }.keys.last
|
25
25
|
@namespace = (namespace.nil? || namespace.empty?) ? 'ss' : namespace.split(':').last
|
26
26
|
super(filename, options)
|
27
27
|
@formula = {}
|
@@ -58,7 +58,7 @@ class Roo::Excel2003XML < Roo::Base
|
|
58
58
|
alias_method :formula?, :formula
|
59
59
|
|
60
60
|
class Font
|
61
|
-
attr_accessor :bold, :italic, :underline
|
61
|
+
attr_accessor :bold, :italic, :underline, :color, :name, :size
|
62
62
|
|
63
63
|
def bold?
|
64
64
|
@bold == '1'
|
@@ -191,31 +191,49 @@ class Roo::Excel2003XML < Roo::Base
|
|
191
191
|
validate_sheet!(sheet)
|
192
192
|
return if @cells_read[sheet]
|
193
193
|
sheet_found = false
|
194
|
+
|
194
195
|
@doc.xpath("/#{@namespace}:Workbook/#{@namespace}:Worksheet[@#{@namespace}:Name='#{sheet}']").each do |ws|
|
195
196
|
sheet_found = true
|
196
|
-
|
197
|
+
column_styles = {}
|
198
|
+
|
199
|
+
# Column Styles
|
197
200
|
col = 1
|
198
|
-
column_attributes = {}
|
199
|
-
idx = 0
|
200
201
|
ws.xpath("./#{@namespace}:Table/#{@namespace}:Column").each do |c|
|
201
|
-
|
202
|
+
skip_to_col = c["#{@namespace}:Index"].to_i
|
203
|
+
col = skip_to_col if skip_to_col > 0
|
204
|
+
col_style_name = c["#{@namespace}:StyleID"]
|
205
|
+
column_styles[col] = col_style_name unless col_style_name.nil?
|
206
|
+
col += 1
|
202
207
|
end
|
208
|
+
|
209
|
+
# Rows
|
210
|
+
row = 1
|
203
211
|
ws.xpath("./#{@namespace}:Table/#{@namespace}:Row").each do |r|
|
204
|
-
skip_to_row = r[
|
212
|
+
skip_to_row = r["#{@namespace}:Index"].to_i
|
205
213
|
row = skip_to_row if skip_to_row > 0
|
206
|
-
|
214
|
+
|
215
|
+
# Excel uses a 'Span' attribute on a 'Row' to indicate the presence of
|
216
|
+
# empty rows to skip.
|
217
|
+
skip_next_rows = r["#{@namespace}:Span"].to_i
|
218
|
+
|
219
|
+
row_style_name = r["#{@namespace}:StyleID"]
|
220
|
+
|
221
|
+
# Cells
|
222
|
+
col = 1
|
207
223
|
r.xpath("./#{@namespace}:Cell").each do |c|
|
208
|
-
skip_to_col = c[
|
224
|
+
skip_to_col = c["#{@namespace}:Index"].to_i
|
209
225
|
col = skip_to_col if skip_to_col > 0
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
226
|
+
|
227
|
+
skip_next_cols = c["#{@namespace}:MergeAcross"].to_i
|
228
|
+
|
229
|
+
cell_style_name = c["#{@namespace}:StyleID"]
|
230
|
+
style_name = cell_style_name || row_style_name || column_styles[col]
|
231
|
+
|
232
|
+
# Cell Data
|
215
233
|
c.xpath("./#{@namespace}:Data").each do |cell|
|
216
234
|
formula = cell['Formula']
|
217
235
|
value_type = cell["#{@namespace}:Type"].downcase.to_sym
|
218
|
-
v =
|
236
|
+
v = cell.content
|
219
237
|
str_v = v
|
220
238
|
case value_type
|
221
239
|
when :number
|
@@ -234,10 +252,9 @@ class Roo::Excel2003XML < Roo::Base
|
|
234
252
|
end
|
235
253
|
set_cell_values(sheet, col, row, 0, v, value_type, formula, cell, str_v, style_name)
|
236
254
|
end
|
237
|
-
col += 1
|
255
|
+
col += (skip_next_cols + 1)
|
238
256
|
end
|
239
|
-
row += 1
|
240
|
-
col = 1
|
257
|
+
row += (skip_next_rows + 1)
|
241
258
|
end
|
242
259
|
end
|
243
260
|
unless sheet_found
|
@@ -248,12 +265,16 @@ class Roo::Excel2003XML < Roo::Base
|
|
248
265
|
|
249
266
|
def read_styles
|
250
267
|
@doc.xpath("/#{@namespace}:Workbook/#{@namespace}:Styles/#{@namespace}:Style").each do |style|
|
251
|
-
style_id = style[
|
252
|
-
|
253
|
-
|
254
|
-
@style_definitions[style_id]
|
255
|
-
@style_definitions[style_id].
|
256
|
-
@style_definitions[style_id].
|
268
|
+
style_id = style["#{@namespace}:ID"]
|
269
|
+
font = style.at_xpath("./#{@namespace}:Font")
|
270
|
+
unless font.nil?
|
271
|
+
@style_definitions[style_id] = Roo::Excel2003XML::Font.new
|
272
|
+
@style_definitions[style_id].bold = font["#{@namespace}:Bold"]
|
273
|
+
@style_definitions[style_id].italic = font["#{@namespace}:Italic"]
|
274
|
+
@style_definitions[style_id].underline = font["#{@namespace}:Underline"]
|
275
|
+
@style_definitions[style_id].color = font["#{@namespace}:Color"]
|
276
|
+
@style_definitions[style_id].name = font["#{@namespace}:FontName"]
|
277
|
+
@style_definitions[style_id].size = font["#{@namespace}:Size"]
|
257
278
|
end
|
258
279
|
end
|
259
280
|
end
|
data/lib/roo/xls/version.rb
CHANGED
data/roo-xls.gemspec
CHANGED
@@ -10,7 +10,6 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["ruby.ruby.ruby.roo@gmail.com"]
|
11
11
|
spec.summary = "Roo::Excel can access the contents of classic xls files."
|
12
12
|
spec.description = "Roo can access the contents of various spreadsheet files. It can handle\n* OpenOffice\n* Excel\n* Google spreadsheets\n* Excelx\n* LibreOffice\n* CSV"
|
13
|
-
spec.homepage = ""
|
14
13
|
spec.license = "MIT"
|
15
14
|
|
16
15
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -18,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
18
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
18
|
spec.require_paths = ["lib"]
|
20
19
|
|
21
|
-
spec.add_dependency "roo", ">= 2.0.
|
20
|
+
spec.add_dependency "roo", ">= 2.0.0", "< 3"
|
22
21
|
spec.add_dependency "spreadsheet", "> 0.9.0"
|
23
22
|
|
24
23
|
if RUBY_VERSION >= '2.1'
|
@@ -1,14 +1,204 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Roo::Excel2003XML do
|
3
|
+
RSpec.describe Roo::Excel2003XML do
|
4
|
+
subject { instance }
|
5
|
+
|
6
|
+
let(:instance) { described_class.new(path) }
|
7
|
+
let(:path) { File.join(test_files_dir, test_file) }
|
8
|
+
let(:test_files_dir) { 'test/files' }
|
9
|
+
|
4
10
|
describe '.new' do
|
5
11
|
context 'with an xml file' do
|
6
|
-
let(:
|
12
|
+
let(:test_file) { 'datetime.xml' }
|
13
|
+
|
14
|
+
it 'loads the file without error' do
|
15
|
+
expect { subject }.to_not raise_error
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#cell' do
|
21
|
+
subject { super().cell(cell[:row], cell[:col]) }
|
22
|
+
|
23
|
+
before(:each) { instance.default_sheet = instance.sheets.first }
|
24
|
+
|
25
|
+
context 'with merged cells' do
|
26
|
+
# See font_colors_screenshot_in_Mac_Excel_16.10.png for a screenshot of
|
27
|
+
# this how this file looks in Mac Excel 16.10.
|
28
|
+
let(:test_file) { 'font_colors.xml' }
|
29
|
+
|
30
|
+
context 'the top-left cell in a merged cell' do
|
31
|
+
let(:cell) { { :row => 1, :col => 'A' } }
|
32
|
+
|
33
|
+
it 'returns the contents of the merged cell' do
|
34
|
+
is_expected.to eq 'Roo::Xls Test of Font Colors'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'the cell to the right of the top-left cell in a merged cell' do
|
39
|
+
let(:cell) { { :row => 2, :col => 'A' } }
|
40
|
+
it { is_expected.to be_nil }
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'the cell below the top-left cell in a merged cell' do
|
44
|
+
let(:cell) { { :row => 2, :col => 'B' } }
|
45
|
+
it { is_expected.to be_nil }
|
46
|
+
end
|
47
|
+
|
48
|
+
context 'the first cell to the right of an entire merged cell' do
|
49
|
+
let(:cell) { { :row => 1, :col => 'K' } }
|
50
|
+
|
51
|
+
it 'returns the expected contents' do
|
52
|
+
is_expected.to eq 'This entire COLUMN should be ITALIC and GREEN'
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'the first cell below an entire merged cell' do
|
57
|
+
let(:cell) { { :row => 6, :col => 'A' } }
|
58
|
+
|
59
|
+
it 'returns the expected contents' do
|
60
|
+
is_expected.to eq '(The above should be font "Courier New", size 24)'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
describe '#font' do
|
67
|
+
subject { super().font(cell[:row], cell[:col]) }
|
68
|
+
|
69
|
+
before(:each) { instance.default_sheet = instance.sheets.first }
|
70
|
+
|
71
|
+
# See font_colors_screenshot_in_Mac_Excel_16.10.png for a screenshot of
|
72
|
+
# this how this file looks in Mac Excel 16.10.
|
73
|
+
let(:test_file) { 'font_colors.xml' }
|
74
|
+
|
75
|
+
let(:default_attrs) do
|
76
|
+
{
|
77
|
+
:name => 'Arial',
|
78
|
+
:size => '12',
|
79
|
+
:color => '#000000',
|
80
|
+
:bold? => false,
|
81
|
+
:italic? => false,
|
82
|
+
:underline? => false
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
let(:expected_attrs) { default_attrs }
|
87
|
+
|
88
|
+
context 'with no font styling' do
|
89
|
+
let(:cell) { { :row => 6, :col => 'A' } }
|
90
|
+
|
91
|
+
it 'returns default font attributes' do
|
92
|
+
is_expected.to have_attributes(default_attrs)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
context 'with styling set on an individual cell' do
|
97
|
+
context 'when set font name and size' do
|
98
|
+
let(:cell) { { :row => 1, :col => 'A' } }
|
99
|
+
|
100
|
+
it 'returns expected font attributes including name and size' do
|
101
|
+
expects = default_attrs.merge({ :name => 'Courier New', :size => '24' })
|
102
|
+
is_expected.to have_attributes(expects)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
context 'when colored BLACK' do
|
107
|
+
let(:cell) { { :row => 7, :col => 'A' } }
|
108
|
+
|
109
|
+
it 'returns default font attributes (which include black)' do
|
110
|
+
is_expected.to have_attributes(default_attrs)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
context 'when colored RED' do
|
115
|
+
let(:cell) { { :row => 8, :col => 'A' } }
|
116
|
+
|
117
|
+
it 'returns defaults plus red color' do
|
118
|
+
expects = default_attrs.merge({ :color => '#FF0000' })
|
119
|
+
is_expected.to have_attributes(expects)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
context 'when colored BLUE' do
|
124
|
+
let(:cell) { { :row => 9, :col => 'A' } }
|
125
|
+
|
126
|
+
it 'returns defaults plus blue color' do
|
127
|
+
expects = default_attrs.merge({ :color => '#0066CC' })
|
128
|
+
is_expected.to have_attributes(expects)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
context 'when BOLD' do
|
133
|
+
let(:cell) { { :row => 10, :col => 'A' } }
|
134
|
+
|
135
|
+
it 'returns defaults plus bold style' do
|
136
|
+
# somehow in Excel, this ended up "no color" rather than black...
|
137
|
+
expects = default_attrs.merge({ :bold? => true, :color => nil })
|
138
|
+
is_expected.to have_attributes(expects)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
context 'when ITALIC' do
|
143
|
+
let(:cell) { { :row => 11, :col => 'A' } }
|
144
|
+
|
145
|
+
it 'returns defaults plus italic style' do
|
146
|
+
# somehow in Excel, this ended up "no color" rather than black...
|
147
|
+
expects = default_attrs.merge({ :italic? => true, :color => nil })
|
148
|
+
is_expected.to have_attributes(expects)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
context 'when UNDERLINED' do
|
153
|
+
let(:cell) { { :row => 12, :col => 'A' } }
|
154
|
+
|
155
|
+
it 'returns defaults plus underlined style' do
|
156
|
+
# somehow in Excel, this ended up "no color" rather than black...
|
157
|
+
expects = default_attrs.merge({ :underline? => true, :color => nil })
|
158
|
+
is_expected.to have_attributes(expects)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
context 'when BOLD, ITALIC, UNDERLINED, and colored PURPLE' do
|
163
|
+
let(:cell) { { :row => 13, :col => 'A' } }
|
164
|
+
|
165
|
+
it 'returns defaults plus bold, italic, underlined, and purple color' do
|
166
|
+
expects = default_attrs.merge({
|
167
|
+
:color => '#666699',
|
168
|
+
:bold? => true,
|
169
|
+
:italic? => true,
|
170
|
+
:underline? => true
|
171
|
+
})
|
172
|
+
is_expected.to have_attributes(expects)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
context 'with styling set on an entire row' do
|
178
|
+
let(:row_style) do
|
179
|
+
default_attrs.merge({ :color => '#ED7D31', :bold? => true })
|
180
|
+
end
|
181
|
+
|
182
|
+
context 'when no cell styling' do
|
183
|
+
let(:cell) { { :row => 14, :col => 'L' } }
|
184
|
+
|
185
|
+
it 'returns the row style' do
|
186
|
+
is_expected.to have_attributes(row_style)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
context 'with styling set on an entire column' do
|
192
|
+
let(:col_style) do
|
193
|
+
default_attrs.merge({ :color => '#00FF00', :italic? => true })
|
194
|
+
end
|
195
|
+
|
196
|
+
context 'when no cell styling' do
|
197
|
+
let(:cell) { { :row => 20, :col => 'K' } }
|
7
198
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}.to_not raise_error
|
199
|
+
it 'returns the column style' do
|
200
|
+
is_expected.to have_attributes(col_style)
|
201
|
+
end
|
12
202
|
end
|
13
203
|
end
|
14
204
|
end
|
@@ -0,0 +1,203 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<?mso-application progid="Excel.Sheet"?>
|
3
|
+
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
|
4
|
+
xmlns:o="urn:schemas-microsoft-com:office:office"
|
5
|
+
xmlns:x="urn:schemas-microsoft-com:office:excel"
|
6
|
+
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
|
7
|
+
xmlns:html="http://www.w3.org/TR/REC-html40">
|
8
|
+
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
|
9
|
+
<Author>Marc Siegel</Author>
|
10
|
+
<LastAuthor>Marc Siegel</LastAuthor>
|
11
|
+
<Created>2018-02-14T22:21:05Z</Created>
|
12
|
+
<LastSaved>2018-02-15T17:12:56Z</LastSaved>
|
13
|
+
<Version>16.00</Version>
|
14
|
+
</DocumentProperties>
|
15
|
+
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
|
16
|
+
<AllowPNG/>
|
17
|
+
</OfficeDocumentSettings>
|
18
|
+
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
|
19
|
+
<WindowHeight>16940</WindowHeight>
|
20
|
+
<WindowWidth>27640</WindowWidth>
|
21
|
+
<WindowTopX>3380</WindowTopX>
|
22
|
+
<WindowTopY>5080</WindowTopY>
|
23
|
+
<ProtectStructure>False</ProtectStructure>
|
24
|
+
<ProtectWindows>False</ProtectWindows>
|
25
|
+
</ExcelWorkbook>
|
26
|
+
<Styles>
|
27
|
+
<Style ss:ID="Default" ss:Name="Normal">
|
28
|
+
<Alignment ss:Vertical="Bottom"/>
|
29
|
+
<Borders/>
|
30
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#000000"/>
|
31
|
+
<Interior/>
|
32
|
+
<NumberFormat/>
|
33
|
+
<Protection/>
|
34
|
+
</Style>
|
35
|
+
<Style ss:ID="s62">
|
36
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#000000"/>
|
37
|
+
</Style>
|
38
|
+
<Style ss:ID="s63">
|
39
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#00FF00"
|
40
|
+
ss:Italic="1"/>
|
41
|
+
</Style>
|
42
|
+
<Style ss:ID="s65">
|
43
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
|
44
|
+
<Font ss:FontName="Courier New" x:Family="Roman" ss:Size="24" ss:Color="#000000"/>
|
45
|
+
</Style>
|
46
|
+
<Style ss:ID="s67">
|
47
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
|
48
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#00FF00"
|
49
|
+
ss:Italic="1"/>
|
50
|
+
</Style>
|
51
|
+
<Style ss:ID="s69">
|
52
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
|
53
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#000000"/>
|
54
|
+
</Style>
|
55
|
+
<Style ss:ID="s71">
|
56
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
|
57
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#FF0000"/>
|
58
|
+
</Style>
|
59
|
+
<Style ss:ID="s73">
|
60
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
|
61
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#FF0000"
|
62
|
+
ss:Underline="Single"/>
|
63
|
+
</Style>
|
64
|
+
<Style ss:ID="s75">
|
65
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
|
66
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#0066CC"/>
|
67
|
+
</Style>
|
68
|
+
<Style ss:ID="s77">
|
69
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
|
70
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Bold="1"/>
|
71
|
+
</Style>
|
72
|
+
<Style ss:ID="s79">
|
73
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
|
74
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Italic="1"/>
|
75
|
+
</Style>
|
76
|
+
<Style ss:ID="s81">
|
77
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
|
78
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Underline="Single"/>
|
79
|
+
</Style>
|
80
|
+
<Style ss:ID="s83">
|
81
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
|
82
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#666699"
|
83
|
+
ss:Bold="1" ss:Italic="1" ss:Underline="Single"/>
|
84
|
+
</Style>
|
85
|
+
<Style ss:ID="s90">
|
86
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
|
87
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#00FF00"
|
88
|
+
ss:Bold="1" ss:Italic="1"/>
|
89
|
+
</Style>
|
90
|
+
<Style ss:ID="s91">
|
91
|
+
<Alignment ss:Vertical="Center" ss:WrapText="1"/>
|
92
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#008080"
|
93
|
+
ss:Bold="1" ss:Italic="1"/>
|
94
|
+
</Style>
|
95
|
+
<Style ss:ID="s97">
|
96
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
|
97
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#ED7D31"
|
98
|
+
ss:Bold="1"/>
|
99
|
+
</Style>
|
100
|
+
<Style ss:ID="s100">
|
101
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#ED7D31"
|
102
|
+
ss:Bold="1"/>
|
103
|
+
</Style>
|
104
|
+
<Style ss:ID="s110">
|
105
|
+
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
|
106
|
+
<Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Color="#FF0000"
|
107
|
+
ss:Underline="Single"/>
|
108
|
+
</Style>
|
109
|
+
</Styles>
|
110
|
+
<Worksheet ss:Name="Sheet1">
|
111
|
+
<Table ss:ExpandedColumnCount="13" ss:ExpandedRowCount="20" x:FullColumns="1"
|
112
|
+
x:FullRows="1" ss:StyleID="s62" ss:DefaultColumnWidth="65"
|
113
|
+
ss:DefaultRowHeight="16">
|
114
|
+
<Column ss:Index="10" ss:StyleID="s62" ss:AutoFitWidth="0" ss:Width="96"/>
|
115
|
+
<Column ss:StyleID="s63" ss:AutoFitWidth="0" ss:Width="173"/>
|
116
|
+
<Column ss:StyleID="s62" ss:AutoFitWidth="0" ss:Width="141"/>
|
117
|
+
<Row ss:AutoFitHeight="0">
|
118
|
+
<Cell ss:MergeAcross="9" ss:MergeDown="4" ss:StyleID="s65"><Data
|
119
|
+
ss:Type="String">Roo::Xls Test of Font Colors</Data></Cell>
|
120
|
+
<Cell ss:MergeDown="6" ss:StyleID="s67"><Data ss:Type="String">This entire COLUMN should be ITALIC and GREEN</Data></Cell>
|
121
|
+
</Row>
|
122
|
+
<Row ss:AutoFitHeight="0" ss:Span="3"/>
|
123
|
+
<Row ss:Index="6" ss:AutoFitHeight="0">
|
124
|
+
<Cell><Data ss:Type="String">(The above should be font "Courier New", size 24)</Data></Cell>
|
125
|
+
</Row>
|
126
|
+
<Row ss:AutoFitHeight="0">
|
127
|
+
<Cell ss:MergeAcross="9" ss:StyleID="s69"><Data ss:Type="String">This font should be BLACK</Data></Cell>
|
128
|
+
</Row>
|
129
|
+
<Row ss:AutoFitHeight="0">
|
130
|
+
<Cell ss:MergeAcross="9" ss:StyleID="s71"><Data ss:Type="String">This font should be RED</Data></Cell>
|
131
|
+
<Cell ss:MergeDown="5" ss:StyleID="s73"><Data ss:Type="String">…except this cell, which should be UNDERLINED and RED</Data></Cell>
|
132
|
+
</Row>
|
133
|
+
<Row ss:AutoFitHeight="0">
|
134
|
+
<Cell ss:MergeAcross="9" ss:StyleID="s75"><Data ss:Type="String">This font should be BLUE</Data></Cell>
|
135
|
+
</Row>
|
136
|
+
<Row ss:AutoFitHeight="0">
|
137
|
+
<Cell ss:MergeAcross="9" ss:StyleID="s77"><Data ss:Type="String">This font should be BOLD</Data></Cell>
|
138
|
+
</Row>
|
139
|
+
<Row ss:AutoFitHeight="0">
|
140
|
+
<Cell ss:MergeAcross="9" ss:StyleID="s79"><Data ss:Type="String">This font should be ITALIC</Data></Cell>
|
141
|
+
</Row>
|
142
|
+
<Row ss:AutoFitHeight="0">
|
143
|
+
<Cell ss:MergeAcross="9" ss:StyleID="s81"><Data ss:Type="String">This font should be UNDERLINED</Data></Cell>
|
144
|
+
</Row>
|
145
|
+
<Row ss:AutoFitHeight="0">
|
146
|
+
<Cell ss:MergeAcross="9" ss:StyleID="s83"><Data ss:Type="String">This font should be BOLD, ITALIC, UNDERLINED, and PURPLE</Data></Cell>
|
147
|
+
</Row>
|
148
|
+
<Row ss:AutoFitHeight="0" ss:StyleID="s100">
|
149
|
+
<Cell ss:MergeAcross="4" ss:StyleID="s97"><Data ss:Type="String">This entire ROW should be BOLD and ORANGE</Data></Cell>
|
150
|
+
<Cell ss:MergeAcross="4" ss:StyleID="s110"><Data ss:Type="String">…except this cell, which should be UNDERLINED and RED</Data></Cell>
|
151
|
+
<Cell ss:MergeDown="5" ss:StyleID="s90"><Data ss:Type="String">As the combination of ROW and COLUMN styles, this cell should be BOLD, ITALIC, and GREEN</Data></Cell>
|
152
|
+
<Cell><Data ss:Type="String">Just row style</Data></Cell>
|
153
|
+
</Row>
|
154
|
+
<Row ss:AutoFitHeight="0">
|
155
|
+
<Cell ss:Index="12" ss:StyleID="s91"/>
|
156
|
+
<Cell ss:StyleID="s91"/>
|
157
|
+
</Row>
|
158
|
+
<Row ss:AutoFitHeight="0">
|
159
|
+
<Cell ss:Index="12" ss:StyleID="s91"/>
|
160
|
+
<Cell ss:StyleID="s91"/>
|
161
|
+
</Row>
|
162
|
+
<Row ss:AutoFitHeight="0">
|
163
|
+
<Cell ss:Index="12" ss:StyleID="s91"/>
|
164
|
+
<Cell ss:StyleID="s91"/>
|
165
|
+
</Row>
|
166
|
+
<Row ss:AutoFitHeight="0">
|
167
|
+
<Cell ss:Index="12" ss:StyleID="s91"/>
|
168
|
+
<Cell ss:StyleID="s91"/>
|
169
|
+
</Row>
|
170
|
+
<Row ss:AutoFitHeight="0">
|
171
|
+
<Cell ss:Index="12" ss:StyleID="s91"/>
|
172
|
+
<Cell ss:StyleID="s91"/>
|
173
|
+
</Row>
|
174
|
+
<Row ss:AutoFitHeight="0">
|
175
|
+
<Cell ss:Index="11"><Data ss:Type="String">Just column style</Data></Cell>
|
176
|
+
<Cell ss:StyleID="s91"/>
|
177
|
+
<Cell ss:StyleID="s91"/>
|
178
|
+
</Row>
|
179
|
+
</Table>
|
180
|
+
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
|
181
|
+
<PageSetup>
|
182
|
+
<Header x:Margin="0.3"/>
|
183
|
+
<Footer x:Margin="0.3"/>
|
184
|
+
<PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
|
185
|
+
</PageSetup>
|
186
|
+
<Unsynced/>
|
187
|
+
<Print>
|
188
|
+
<ValidPrinterInfo/>
|
189
|
+
<VerticalResolution>0</VerticalResolution>
|
190
|
+
</Print>
|
191
|
+
<Selected/>
|
192
|
+
<Panes>
|
193
|
+
<Pane>
|
194
|
+
<Number>3</Number>
|
195
|
+
<ActiveRow>25</ActiveRow>
|
196
|
+
<ActiveCol>7</ActiveCol>
|
197
|
+
</Pane>
|
198
|
+
</Panes>
|
199
|
+
<ProtectObjects>False</ProtectObjects>
|
200
|
+
<ProtectScenarios>False</ProtectScenarios>
|
201
|
+
</WorksheetOptions>
|
202
|
+
</Worksheet>
|
203
|
+
</Workbook>
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roo-xls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Preymesser
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-02-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: roo
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 2.0.
|
21
|
+
version: 2.0.0
|
22
22
|
- - "<"
|
23
23
|
- !ruby/object:Gem::Version
|
24
24
|
version: '3'
|
@@ -28,7 +28,7 @@ dependencies:
|
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version: 2.0.
|
31
|
+
version: 2.0.0
|
32
32
|
- - "<"
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '3'
|
@@ -147,6 +147,8 @@ files:
|
|
147
147
|
- test/files/excel2003_namespace.xml
|
148
148
|
- test/files/false_encoding.xls
|
149
149
|
- test/files/false_encoding.xml
|
150
|
+
- test/files/font_colors.xml
|
151
|
+
- test/files/font_colors_screenshot_in_Mac_Excel_16.10.png
|
150
152
|
- test/files/formula.xls
|
151
153
|
- test/files/formula.xml
|
152
154
|
- test/files/formula_parse_error.xls
|
@@ -184,7 +186,7 @@ files:
|
|
184
186
|
- test/test_excel_2003_xml.rb
|
185
187
|
- test/test_helper.rb
|
186
188
|
- test/test_roo_excel.rb
|
187
|
-
homepage:
|
189
|
+
homepage:
|
188
190
|
licenses:
|
189
191
|
- MIT
|
190
192
|
metadata: {}
|
@@ -204,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
206
|
version: '0'
|
205
207
|
requirements: []
|
206
208
|
rubyforge_project:
|
207
|
-
rubygems_version: 2.
|
209
|
+
rubygems_version: 2.7.6
|
208
210
|
signing_key:
|
209
211
|
specification_version: 4
|
210
212
|
summary: Roo::Excel can access the contents of classic xls files.
|
@@ -239,6 +241,8 @@ test_files:
|
|
239
241
|
- test/files/excel2003_namespace.xml
|
240
242
|
- test/files/false_encoding.xls
|
241
243
|
- test/files/false_encoding.xml
|
244
|
+
- test/files/font_colors.xml
|
245
|
+
- test/files/font_colors_screenshot_in_Mac_Excel_16.10.png
|
242
246
|
- test/files/formula.xls
|
243
247
|
- test/files/formula.xml
|
244
248
|
- test/files/formula_parse_error.xls
|