ru_excel 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ru_excel/biff_records.rb +8 -8
- data/lib/ru_excel/style.rb +3 -3
- data/lib/ru_excel/unicode_utils.rb +4 -4
- data/ru_excel.gemspec +56 -0
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
@@ -341,7 +341,7 @@ module Excel
|
|
341
341
|
|
342
342
|
=begin
|
343
343
|
This record specifies if the formulas in the workbook can use natural
|
344
|
-
language formulas
|
344
|
+
language formulas”. This type of formula can refer to cells by its
|
345
345
|
content or the content of the column or row header cell.
|
346
346
|
|
347
347
|
Record USESELFS, BIFF8
|
@@ -597,7 +597,7 @@ module Excel
|
|
597
597
|
49 Text @
|
598
598
|
=end
|
599
599
|
def numberFormatRecord(idx, fmtstr)
|
600
|
-
get_biff_data(0x041E, [ idx
|
600
|
+
get_biff_data(0x041E, [ idx ].pack('v') + upack2(fmtstr))
|
601
601
|
end
|
602
602
|
|
603
603
|
|
@@ -1050,7 +1050,7 @@ module Excel
|
|
1050
1050
|
[9] 1 Not used (BIFF5-BIFF8 only, not written
|
1051
1051
|
in BIFF2-BIFF4)
|
1052
1052
|
|
1053
|
-
If the panes are frozen, pane
|
1053
|
+
If the panes are frozen, pane 0 is always active, regardless
|
1054
1054
|
of the cursor position. The correct identifiers for all possible
|
1055
1055
|
combinations of visible panes are shown in the following pictures.
|
1056
1056
|
|
@@ -1413,10 +1413,10 @@ module Excel
|
|
1413
1413
|
=begin
|
1414
1414
|
This record is part of the Calculation Settings Block.
|
1415
1415
|
It stores which method is used to show cell addresses in formulas.
|
1416
|
-
The
|
1417
|
-
i.e.
|
1418
|
-
The
|
1419
|
-
i.e.
|
1416
|
+
The “RC” mode uses numeric indexes for rows and columns,
|
1417
|
+
i.e. “R(1)C(-1)”, or “R1C1:R2C2”.
|
1418
|
+
The “A1” mode uses characters for columns and numbers for rows,
|
1419
|
+
i.e. “B1”, or “$A$1:$B$2”.
|
1420
1420
|
|
1421
1421
|
Record REFMODE, BIFF2-BIFF8
|
1422
1422
|
|
@@ -1457,7 +1457,7 @@ module Excel
|
|
1457
1457
|
#class SaveRecalcRecord < BiffRecord
|
1458
1458
|
=begin
|
1459
1459
|
This record is part of the Calculation Settings Block.
|
1460
|
-
It contains the
|
1460
|
+
It contains the “Recalculate before save” option in
|
1461
1461
|
Excel's calculation settings dialogue.
|
1462
1462
|
|
1463
1463
|
Record SAVERECALC, BIFF3-BIFF8
|
data/lib/ru_excel/style.rb
CHANGED
@@ -94,7 +94,7 @@ module Excel
|
|
94
94
|
def _add_style(style)
|
95
95
|
num_format_str = style.num_format_str
|
96
96
|
num_format_idx = @_num_formats[num_format_str] ||=
|
97
|
-
|
97
|
+
164 + @_num_formats.length - Std_num_fmt_list.length
|
98
98
|
font = style.font
|
99
99
|
font_idx = @_fonts[font] ||= @_fonts.length + 1
|
100
100
|
xf = [font_idx, num_format_idx, style.alignment, style.borders, style.pattern, style.protection]
|
@@ -118,8 +118,8 @@ module Excel
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def _all_num_formats
|
121
|
-
formats = @_num_formats.select{|k, v| v
|
122
|
-
formats.map
|
121
|
+
formats = @_num_formats.to_a.select{|k, v| v>163}
|
122
|
+
formats = formats.map{|fmtstr, fmtidx| BiffRecord.numberFormatRecord(fmtidx, fmtstr)}
|
123
123
|
formats.join('')
|
124
124
|
end
|
125
125
|
|
@@ -32,8 +32,8 @@ Offset Size Contents
|
|
32
32
|
[2 or 3] 2 (optional, only if richtext=1) Number of Rich-Text formatting runs (rt)
|
33
33
|
[var.] 4 (optional, only if phonetic=1) Size of Asian phonetic settings block (in bytes, sz)
|
34
34
|
var. ln or
|
35
|
-
2
|
36
|
-
[var.] 4
|
35
|
+
2·ln Character array (8-bit characters or 16-bit characters, dependent on ccompr)
|
36
|
+
[var.] 4·rt (optional, only if richtext=1) List of rt formatting runs
|
37
37
|
[var.] sz (optional, only if phonetic=1) Asian Phonetic Settings Block
|
38
38
|
=end
|
39
39
|
|
@@ -53,10 +53,10 @@ module Excel
|
|
53
53
|
def upack2(str)
|
54
54
|
begin
|
55
55
|
ustr = Excel::ICONV[:check_ascii].iconv(str)
|
56
|
-
[str.length, 0].pack('
|
56
|
+
[str.length, 0].pack('vC')+str
|
57
57
|
rescue Iconv::IllegalSequence
|
58
58
|
ustr = u2bytes(str)
|
59
|
-
[ustr.length / 2, 1].pack('
|
59
|
+
[ustr.length / 2, 1].pack('vC')+ustr
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
data/ru_excel.gemspec
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{ru_excel}
|
8
|
+
s.version = "0.0.7"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Sokolov Yura aka funny_falcon"]
|
12
|
+
s.date = %q{2011-06-24}
|
13
|
+
s.description = %q{Port of pyExcelerator tunned for faster .xls generation}
|
14
|
+
s.email = %q{funny.falcon@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
"README",
|
20
|
+
"Rakefile",
|
21
|
+
"VERSION",
|
22
|
+
"examples/big-16Mb_test.rb",
|
23
|
+
"examples/test_multiline.rb",
|
24
|
+
"examples/test_utf8.rb",
|
25
|
+
"lib/ru_excel.rb",
|
26
|
+
"lib/ru_excel/biff_records.rb",
|
27
|
+
"lib/ru_excel/bitmap.rb",
|
28
|
+
"lib/ru_excel/cell.rb",
|
29
|
+
"lib/ru_excel/column.rb",
|
30
|
+
"lib/ru_excel/compound_doc.rb",
|
31
|
+
"lib/ru_excel/deco.rb",
|
32
|
+
"lib/ru_excel/excel_magic.rb",
|
33
|
+
"lib/ru_excel/formatting.rb",
|
34
|
+
"lib/ru_excel/row.rb",
|
35
|
+
"lib/ru_excel/style.rb",
|
36
|
+
"lib/ru_excel/unicode_utils.rb",
|
37
|
+
"lib/ru_excel/workbook.rb",
|
38
|
+
"lib/ru_excel/worksheet.rb",
|
39
|
+
"ru_excel.gemspec"
|
40
|
+
]
|
41
|
+
s.homepage = %q{http://github.com/funny-falcon/ru_excel}
|
42
|
+
s.require_paths = ["lib"]
|
43
|
+
s.rubyforge_project = %q{ru-excel}
|
44
|
+
s.rubygems_version = %q{1.7.2}
|
45
|
+
s.summary = %q{Fast writting of MsExcel files (port of pyExcelerator)}
|
46
|
+
|
47
|
+
if s.respond_to? :specification_version then
|
48
|
+
s.specification_version = 3
|
49
|
+
|
50
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
51
|
+
else
|
52
|
+
end
|
53
|
+
else
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ru_excel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Sokolov Yura aka funny_falcon
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-06-24 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: Port of pyExcelerator tunned for faster .xls generation
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- lib/ru_excel/unicode_utils.rb
|
43
43
|
- lib/ru_excel/workbook.rb
|
44
44
|
- lib/ru_excel/worksheet.rb
|
45
|
+
- ru_excel.gemspec
|
45
46
|
homepage: http://github.com/funny-falcon/ru_excel
|
46
47
|
licenses: []
|
47
48
|
|