rspreadsheet 0.5.1 → 0.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: ac3047fdd7de94000844c46f91f241fac79036f800557a4d0314023aaa9b12d8
4
- data.tar.gz: 3d0de7cac29901e1b6e73a31ba58a29052b31b0ca66d6cb320d2db44a3533875
2
+ SHA1:
3
+ metadata.gz: e4265d988a9cac4a67219e2efba520a137bcc9fe
4
+ data.tar.gz: 1d4e66e3d359d8b5ac8738d801f6088d7e998eca
5
5
  SHA512:
6
- metadata.gz: 66feb6e871c117877b01d22b58a9f25a4fb891f467f87437b3e31b8f1a195e78ee62f2a64616d94d478e424afc4d8b84e2be9857191407e19f7247c4cf669e6e
7
- data.tar.gz: e808d2aaa210afe27d881808e96de826f4ca8cfe5065064cb450e57e900cf7987566d485cb1e13fc07dc6b6c851a4c331db76de7b7063dc1e725212f9ae141a9
6
+ metadata.gz: 5b9ee836a107afe9dd74427b8b3952faa781c69ed9c728b8ae4743ec52ba78f8f969b73cc0a389fda78ade0a2d0850316ae55cd04ff2522e76b73fc11c229e6f
7
+ data.tar.gz: 89f06fd5d0f2cad8964e90f57bc194cf9bcbbdf9ddf9bf90b3e76315c0018249987a3f92488270a79f19a16172a06169d3244f4e720904ffabadbea7445e0166
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://api.travis-ci.org/gorn/rspreadsheet.svg?branch=master)](https://travis-ci.org/gorn/rspreadsheet) [![Coverage Status](https://coveralls.io/repos/gorn/rspreadsheet/badge.svg?branch=master&service=github)](https://coveralls.io/r/gorn/rspreadsheet) [![User opinion wanted](https://img.shields.io/badge/user%20opinion%20wanted-yes-blue.svg)](https://github.com/gorn/rspreadsheet/projects/1)
1
+ [![Build Status](https://api.travis-ci.org/gorn/rspreadsheet.svg?branch=master)](https://travis-ci.org/gorn/rspreadsheet) [![Coverage Status](https://coveralls.io/repos/gorn/rspreadsheet/badge.svg?branch=master&service=github)](https://coveralls.io/r/gorn/rspreadsheet)
2
2
 
3
3
  # rspreadsheet
4
4
 
@@ -109,6 +109,7 @@ class Row < XMLTiedItem
109
109
  def add_row_above
110
110
  parent.add_row_above(rowi)
111
111
  end
112
+ alias :insert_row_above :add_row_above
112
113
 
113
114
  def next_row; relative(+1) end
114
115
  alias :next :next_row
@@ -117,6 +118,10 @@ class Row < XMLTiedItem
117
118
  worksheet.row(self.rowi+rowi_offset)
118
119
  end
119
120
 
121
+ def clone_above_row(target_rowi)
122
+ parent.clone_item_before(rowi, target_rowi)
123
+ end
124
+
120
125
  # @!group Private methods, which should not be called directly
121
126
  # @private
122
127
  # shifts internal represetation of row by diff. This should not be called directly
@@ -156,6 +156,9 @@ module Tools
156
156
  node.nil? ? default : node.attributes.get_attribute_ns(Tools.get_namespace(ns_prefix).href,key) || default
157
157
  end
158
158
  end
159
+ def self.delete_ns_attribute(node,ns_prefix,key)
160
+ set_ns_attribute(node,ns_prefix,key,nil,nil)
161
+ end
159
162
  def self.get_ns_attribute_value(node,ns_prefix,key,default=:undefined_default)
160
163
  if default==:undefined_default
161
164
  Tools.get_ns_attribute(node,ns_prefix,key).andand.value
@@ -1,3 +1,3 @@
1
1
  module Rspreadsheet
2
- VERSION = "0.5.1"
2
+ VERSION = '0.5.3'
3
3
  end
@@ -131,7 +131,7 @@ module XMLTiedArray
131
131
 
132
132
  # # @!group accessing subnodes
133
133
  # returns xmlnode with index
134
- # DOES not respect repeated_attribute
134
+ # does NOT respect repeated_attribute
135
135
  def my_subnode(aindex)
136
136
  raise 'Using method which does not respect repeated_attribute with options that are using it. You probably donot want to do that.' unless subnode_options[:repeated_attribute].nil?
137
137
  return xmlsubnodes[aindex-1]
@@ -157,7 +157,7 @@ module XMLTiedArray
157
157
  else
158
158
  raise IndexError.new("Index #{aindex} out of bounds (1..#{self.size})")
159
159
  end
160
- end
160
+ end
161
161
 
162
162
  def prepare_empty_subnode
163
163
  Tools.prepare_ns_node(
@@ -44,12 +44,14 @@ module XMLTiedArray_WithRepeatableItems
44
44
  end
45
45
 
46
46
  # @!group inserting new subnodes
47
-
48
- def insert_new_empty_subnode_before(aindex)
49
- insert_new_empty_subnode_before_respect_repeatable(aindex)
47
+
48
+ def insert_new_empty_subnode_before_respect_repeatable(aindex)
49
+ new_subnode = prepare_repeated_subnode(1, subnode_options)
50
+ insert_subnode_before_respect_repeatable(new_subnode, aindex)
50
51
  end
52
+ alias :insert_new_empty_subnode_before :insert_new_empty_subnode_before_respect_repeatable
51
53
 
52
- def insert_new_empty_subnode_before_respect_repeatable(aindex)
54
+ def insert_subnode_before_respect_repeatable(subnode,aindex)
53
55
  axmlnode = xmlnode
54
56
  options = subnode_options
55
57
  node,index_range = find_subnode_with_range(aindex)
@@ -58,15 +60,16 @@ module XMLTiedArray_WithRepeatableItems
58
60
  [index_range.begin..aindex-1,aindex..index_range.end].reject {|range| range.size<1}.each do |range| # split original node by cloning
59
61
  clone_before_and_set_repeated_attribute(node,range.size,options)
60
62
  end
61
- node.prev.prev = prepare_repeated_subnode(1, options) # insert new node
62
- node.remove! # remove the original node
63
+ node.prev.prev = subnode # insert subnode
64
+ node.remove! # remove the original node
63
65
  else # insert outbound xmlnode
64
- [index+1..aindex-1,aindex..aindex].reject {|range| range.size<1}.each do |range|
65
- axmlnode << prepare_repeated_subnode(range.size, options)
66
- end
66
+ number_of_preceeding_items = aindex-1-(index+1)+1
67
+ axmlnode << prepare_repeated_subnode(number_of_preceeding_items, options) unless number_of_preceeding_items<1 # insert preceeding cells
68
+ axmlnode << subnode # insert subnode
67
69
  end #TODO: Out of bounds indexes handling
68
70
  return my_subnode(aindex)
69
71
  end
72
+ alias :insert_subnode_before :insert_subnode_before_respect_repeatable
70
73
 
71
74
  def prepare_repeated_subnode(times_repeated,options)
72
75
  result = prepare_empty_subnode
@@ -80,6 +83,13 @@ module XMLTiedArray_WithRepeatableItems
80
83
  node.prev = newnode
81
84
  end
82
85
 
86
+ # takes item on source_index, clones it and inserts it before target_index
87
+ def clone_item_before(source_index, target_index)
88
+ newnode = my_subnode(source_index).copy(true)
89
+ Tools.delete_ns_attribute(newnode,'table',subnode_options[:repeated_attribute])
90
+ insert_subnode_before_respect_repeatable(newnode,target_index)
91
+ end
92
+
83
93
  # detaches subnode with aindex
84
94
  def detach_my_subnode_respect_repeated(aindex)
85
95
  axmlnode = xmlnode
@@ -109,7 +119,6 @@ module XMLTiedArray_WithRepeatableItems
109
119
  (node.attributes[subnode_options[:repeated_attribute]] || 1).to_i
110
120
  end
111
121
 
112
-
113
122
  # clean up item from xml (handle possible detachments) and itemcache. leave the object invalidation on the object
114
123
  # this should not be called from nowhere but XMLTiedItem.delete
115
124
  def delete_subitem(aindex)
data/rspreadsheet.gemspec CHANGED
@@ -28,25 +28,25 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  # runtime dependencies
30
30
  unless package_natively_installed?('ruby-libxml')
31
- spec.add_runtime_dependency 'libxml-ruby', '3.0' # parsing XML files
31
+ spec.add_runtime_dependency 'libxml-ruby', '>=3.0' # parsing XML files
32
32
  end
33
- spec.add_runtime_dependency 'rubyzip', '~>1.1' # opening zip files
34
- spec.add_runtime_dependency 'andand', '~>1.3'
33
+ spec.add_runtime_dependency 'rubyzip', '>=1.3' # opening zip files
34
+ spec.add_runtime_dependency 'andand', '>=1.3'
35
35
 
36
36
  # development dependencies
37
+
38
+ spec.add_development_dependency "bundler", '>= 1.5', '<3' # some 2.5 rubyies contain already bundler 2 included
37
39
  if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.5')
38
40
  # ruby 2.4.5 and up
39
- spec.add_development_dependency "bundler", '>= 1.5', '<3' # some 2.5 rubyies contain already bundler 2 included
40
- spec.add_development_dependency "rake", '~>10.0'
41
+ spec.add_development_dependency "rake", '>=10.0'
41
42
  else
42
43
  # ruby up to 2.4.5
43
- spec.add_development_dependency "bundler", '~> 1.5'
44
44
  spec.add_development_dependency "rake", '~>0.9'
45
45
  end
46
46
  # testig - see http://bit.ly/1n5yM51
47
- spec.add_development_dependency "rspec", '~>2.0' # running tests
48
- spec.add_development_dependency 'pry-nav', '~>0.0' # enables pry 'next', 'step' commands
49
- spec.add_development_dependency "coveralls", '~>0.7' # inspecting coverage of tests
47
+ spec.add_development_dependency "rspec", '>=2.0' # running tests
48
+ spec.add_development_dependency 'pry-nav', '>=0.0' # enables pry 'next', 'step' commands
49
+ spec.add_development_dependency "coveralls", '>=0.7' # inspecting coverage of tests
50
50
 
51
51
 
52
52
  # optional and testing
data/spec/row_spec.rb CHANGED
@@ -270,6 +270,27 @@ describe Rspreadsheet::Row do
270
270
  @row = @sheet1.rows(5)
271
271
  @row.worksheet.should == @sheet1
272
272
  end
273
+ it 'does not skip header rows (issue #43)' do
274
+ @sheet = Rspreadsheet.open('./spec/testfile3-header_rows_and_cells.fods').worksheet(1)
275
+ @sheet.A1.should == 'Cell in header row'
276
+ @sheet.A1.should_not == 'This is first nonheader row, but it is in colheader'
277
+ @sheet.B3.should == 'First completely nonheader cell'
278
+ end
279
+ it 'can be cloned to other row' do
280
+ @sheet2.row(5)[1].should == 5
281
+ @sheet2.row(6)[1].should == 6
282
+
283
+ @sheet2.row(6)[1].should_not == 4
284
+ @sheet2.row(4).clone_above_row(6)
285
+ @sheet2.row(4)[1].should == 4
286
+ @sheet2.row(5)[1].should == 5
287
+ @sheet2.row(6)[1].should == 4
288
+ @sheet2.row(7)[1].should == 6
289
+ @sheet2.row(6)[1].should == @sheet2.row(4)[1]
290
+ @sheet2.row(6)[2].should == @sheet2.row(4)[2]
291
+ @sheet2.row(6)[3].should == @sheet2.row(4)[3]
292
+ @sheet2.row(6).cell(2).formula.should == @sheet2.row(4).cell(2).formula
293
+ end
273
294
  end
274
295
 
275
296
 
@@ -0,0 +1,240 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.spreadsheet">
4
+ <office:meta><meta:creation-date>2019-09-18T16:03:23.906364218</meta:creation-date><meta:generator>LibreOffice/5.2.7.2$Linux_X86_64 LibreOffice_project/20m0$Build-2</meta:generator><dc:date>2019-09-18T16:04:54.802388660</dc:date><meta:editing-duration>PT1M31S</meta:editing-duration><meta:editing-cycles>1</meta:editing-cycles><meta:document-statistic meta:table-count="1" meta:cell-count="4" meta:object-count="0"/></office:meta>
5
+ <office:settings>
6
+ <config:config-item-set config:name="ooo:view-settings">
7
+ <config:config-item config:name="VisibleAreaTop" config:type="int">0</config:config-item>
8
+ <config:config-item config:name="VisibleAreaLeft" config:type="int">0</config:config-item>
9
+ <config:config-item config:name="VisibleAreaWidth" config:type="int">10966</config:config-item>
10
+ <config:config-item config:name="VisibleAreaHeight" config:type="int">1354</config:config-item>
11
+ <config:config-item-map-indexed config:name="Views">
12
+ <config:config-item-map-entry>
13
+ <config:config-item config:name="ViewId" config:type="string">view1</config:config-item>
14
+ <config:config-item-map-named config:name="Tables">
15
+ <config:config-item-map-entry config:name="List1">
16
+ <config:config-item config:name="CursorPositionX" config:type="int">0</config:config-item>
17
+ <config:config-item config:name="CursorPositionY" config:type="int">3</config:config-item>
18
+ <config:config-item config:name="HorizontalSplitMode" config:type="short">0</config:config-item>
19
+ <config:config-item config:name="VerticalSplitMode" config:type="short">0</config:config-item>
20
+ <config:config-item config:name="HorizontalSplitPosition" config:type="int">0</config:config-item>
21
+ <config:config-item config:name="VerticalSplitPosition" config:type="int">0</config:config-item>
22
+ <config:config-item config:name="ActiveSplitRange" config:type="short">2</config:config-item>
23
+ <config:config-item config:name="PositionLeft" config:type="int">0</config:config-item>
24
+ <config:config-item config:name="PositionRight" config:type="int">0</config:config-item>
25
+ <config:config-item config:name="PositionTop" config:type="int">0</config:config-item>
26
+ <config:config-item config:name="PositionBottom" config:type="int">0</config:config-item>
27
+ <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
28
+ <config:config-item config:name="ZoomValue" config:type="int">100</config:config-item>
29
+ <config:config-item config:name="PageViewZoomValue" config:type="int">60</config:config-item>
30
+ <config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>
31
+ </config:config-item-map-entry>
32
+ </config:config-item-map-named>
33
+ <config:config-item config:name="ActiveTable" config:type="string">List1</config:config-item>
34
+ <config:config-item config:name="HorizontalScrollbarWidth" config:type="int">636</config:config-item>
35
+ <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
36
+ <config:config-item config:name="ZoomValue" config:type="int">100</config:config-item>
37
+ <config:config-item config:name="PageViewZoomValue" config:type="int">60</config:config-item>
38
+ <config:config-item config:name="ShowPageBreakPreview" config:type="boolean">false</config:config-item>
39
+ <config:config-item config:name="ShowZeroValues" config:type="boolean">true</config:config-item>
40
+ <config:config-item config:name="ShowNotes" config:type="boolean">true</config:config-item>
41
+ <config:config-item config:name="ShowGrid" config:type="boolean">false</config:config-item>
42
+ <config:config-item config:name="GridColor" config:type="long">12632256</config:config-item>
43
+ <config:config-item config:name="ShowPageBreaks" config:type="boolean">true</config:config-item>
44
+ <config:config-item config:name="HasColumnRowHeaders" config:type="boolean">true</config:config-item>
45
+ <config:config-item config:name="HasSheetTabs" config:type="boolean">true</config:config-item>
46
+ <config:config-item config:name="IsOutlineSymbolsSet" config:type="boolean">true</config:config-item>
47
+ <config:config-item config:name="IsValueHighlightingEnabled" config:type="boolean">false</config:config-item>
48
+ <config:config-item config:name="IsSnapToRaster" config:type="boolean">false</config:config-item>
49
+ <config:config-item config:name="RasterIsVisible" config:type="boolean">false</config:config-item>
50
+ <config:config-item config:name="RasterResolutionX" config:type="int">1000</config:config-item>
51
+ <config:config-item config:name="RasterResolutionY" config:type="int">1000</config:config-item>
52
+ <config:config-item config:name="RasterSubdivisionX" config:type="int">1</config:config-item>
53
+ <config:config-item config:name="RasterSubdivisionY" config:type="int">1</config:config-item>
54
+ <config:config-item config:name="IsRasterAxisSynchronized" config:type="boolean">true</config:config-item>
55
+ </config:config-item-map-entry>
56
+ </config:config-item-map-indexed>
57
+ </config:config-item-set>
58
+ <config:config-item-set config:name="ooo:configuration-settings">
59
+ <config:config-item config:name="SyntaxStringRef" config:type="short">7</config:config-item>
60
+ <config:config-item config:name="IsDocumentShared" config:type="boolean">false</config:config-item>
61
+ <config:config-item config:name="LoadReadonly" config:type="boolean">false</config:config-item>
62
+ <config:config-item config:name="AllowPrintJobCancel" config:type="boolean">true</config:config-item>
63
+ <config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item>
64
+ <config:config-item config:name="IsKernAsianPunctuation" config:type="boolean">false</config:config-item>
65
+ <config:config-item config:name="EmbedFonts" config:type="boolean">false</config:config-item>
66
+ <config:config-item config:name="IsSnapToRaster" config:type="boolean">false</config:config-item>
67
+ <config:config-item config:name="RasterResolutionX" config:type="int">1000</config:config-item>
68
+ <config:config-item config:name="RasterResolutionY" config:type="int">1000</config:config-item>
69
+ <config:config-item config:name="HasSheetTabs" config:type="boolean">true</config:config-item>
70
+ <config:config-item config:name="IsRasterAxisSynchronized" config:type="boolean">true</config:config-item>
71
+ <config:config-item config:name="ShowPageBreaks" config:type="boolean">true</config:config-item>
72
+ <config:config-item config:name="ShowGrid" config:type="boolean">false</config:config-item>
73
+ <config:config-item config:name="ShowNotes" config:type="boolean">true</config:config-item>
74
+ <config:config-item config:name="IsOutlineSymbolsSet" config:type="boolean">true</config:config-item>
75
+ <config:config-item config:name="ShowZeroValues" config:type="boolean">true</config:config-item>
76
+ <config:config-item config:name="SaveVersionOnClose" config:type="boolean">false</config:config-item>
77
+ <config:config-item config:name="GridColor" config:type="long">12632256</config:config-item>
78
+ <config:config-item config:name="RasterIsVisible" config:type="boolean">false</config:config-item>
79
+ <config:config-item config:name="PrinterName" config:type="string">Lobby-A4-Canon-color</config:config-item>
80
+ <config:config-item config:name="LinkUpdateMode" config:type="short">3</config:config-item>
81
+ <config:config-item config:name="RasterSubdivisionX" config:type="int">1</config:config-item>
82
+ <config:config-item config:name="HasColumnRowHeaders" config:type="boolean">true</config:config-item>
83
+ <config:config-item config:name="RasterSubdivisionY" config:type="int">1</config:config-item>
84
+ <config:config-item config:name="AutoCalculate" config:type="boolean">true</config:config-item>
85
+ <config:config-item config:name="PrinterSetup" config:type="base64Binary">swH+/0xvYmJ5LUE0LUNhbm9uLWNvbG9yAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ1VQUzpMb2JieS1BNC1DYW5vbi1jb2xvcgAAAAAAAAAWAAMA2QAAAAAABQAEAAhSAAAEdAAASm9iRGF0YSAxCnByaW50ZXI9TG9iYnktQTQtQ2Fub24tY29sb3IKb3JpZW50YXRpb249UG9ydHJhaXQKY29waWVzPTEKY29sbGF0ZT1mYWxzZQptYXJnaW5kYWp1c3RtZW50PTAsMCwwLDAKY29sb3JkZXB0aD0yNApwc2xldmVsPTAKcGRmZGV2aWNlPTEKY29sb3JkZXZpY2U9MApQUERDb250ZXhEYXRhCklucHV0U2xvdDpBdXRvbWF0aWMARHVwbGV4Ok5vbmUAUGFnZVNpemU6QTQAABIAQ09NUEFUX0RVUExFWF9NT0RFCgBEVVBMRVhfT0ZG</config:config-item>
86
+ <config:config-item config:name="ApplyUserData" config:type="boolean">false</config:config-item>
87
+ <config:config-item config:name="CharacterCompressionType" config:type="short">0</config:config-item>
88
+ </config:config-item-set>
89
+ </office:settings>
90
+ <office:scripts>
91
+ <office:script script:language="ooo:Basic">
92
+ <ooo:libraries xmlns:ooo="http://openoffice.org/2004/office" xmlns:xlink="http://www.w3.org/1999/xlink"/>
93
+ </office:script>
94
+ </office:scripts>
95
+ <office:font-face-decls>
96
+ <style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
97
+ <style:font-face style:name="AR PL SungtiL GB" svg:font-family="&apos;AR PL SungtiL GB&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
98
+ <style:font-face style:name="DejaVu Sans" svg:font-family="&apos;DejaVu Sans&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
99
+ <style:font-face style:name="Lohit Devanagari" svg:font-family="&apos;Lohit Devanagari&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
100
+ </office:font-face-decls>
101
+ <office:styles>
102
+ <style:default-style style:family="table-cell">
103
+ <style:paragraph-properties style:tab-stop-distance="12.5mm"/>
104
+ <style:text-properties style:font-name="Liberation Sans" fo:language="cs" fo:country="CZ" style:font-name-asian="DejaVu Sans" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="DejaVu Sans" style:language-complex="hi" style:country-complex="IN"/>
105
+ </style:default-style>
106
+ <number:number-style style:name="N0">
107
+ <number:number number:min-integer-digits="1"/>
108
+ </number:number-style>
109
+ <number:currency-style style:name="N108P0" style:volatile="true">
110
+ <number:number number:decimal-places="2" loext:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
111
+ <number:text> </number:text>
112
+ <number:currency-symbol number:language="cs" number:country="CZ">Kč</number:currency-symbol>
113
+ </number:currency-style>
114
+ <number:currency-style style:name="N108">
115
+ <style:text-properties fo:color="#ff0000"/>
116
+ <number:text>-</number:text>
117
+ <number:number number:decimal-places="2" loext:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
118
+ <number:text> </number:text>
119
+ <number:currency-symbol number:language="cs" number:country="CZ">Kč</number:currency-symbol>
120
+ <style:map style:condition="value()&gt;=0" style:apply-style-name="N108P0"/>
121
+ </number:currency-style>
122
+ <style:style style:name="Default" style:family="table-cell">
123
+ <style:text-properties style:font-name-asian="AR PL SungtiL GB" style:font-family-asian="&apos;AR PL SungtiL GB&apos;" style:font-family-generic-asian="system" style:font-pitch-asian="variable" style:font-name-complex="Lohit Devanagari" style:font-family-complex="&apos;Lohit Devanagari&apos;" style:font-family-generic-complex="system" style:font-pitch-complex="variable"/>
124
+ </style:style>
125
+ <style:style style:name="Result" style:family="table-cell" style:parent-style-name="Default">
126
+ <style:text-properties fo:font-style="italic" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" fo:font-weight="bold"/>
127
+ </style:style>
128
+ <style:style style:name="Result2" style:family="table-cell" style:parent-style-name="Result" style:data-style-name="N108"/>
129
+ <style:style style:name="Heading" style:family="table-cell" style:parent-style-name="Default">
130
+ <style:table-cell-properties style:text-align-source="fix" style:repeat-content="false"/>
131
+ <style:paragraph-properties fo:text-align="center"/>
132
+ <style:text-properties fo:font-size="16pt" fo:font-style="italic" fo:font-weight="bold"/>
133
+ </style:style>
134
+ <style:style style:name="Heading1" style:family="table-cell" style:parent-style-name="Heading">
135
+ <style:table-cell-properties style:rotation-angle="90"/>
136
+ </style:style>
137
+ </office:styles>
138
+ <office:automatic-styles>
139
+ <style:style style:name="co1" style:family="table-column">
140
+ <style:table-column-properties fo:break-before="auto" style:column-width="87.08mm"/>
141
+ </style:style>
142
+ <style:style style:name="co2" style:family="table-column">
143
+ <style:table-column-properties fo:break-before="auto" style:column-width="22.58mm"/>
144
+ </style:style>
145
+ <style:style style:name="ro1" style:family="table-row">
146
+ <style:table-row-properties style:row-height="4.52mm" fo:break-before="auto" style:use-optimal-row-height="true"/>
147
+ </style:style>
148
+ <style:style style:name="ta1" style:family="table" style:master-page-name="Default">
149
+ <style:table-properties table:display="true" style:writing-mode="lr-tb"/>
150
+ </style:style>
151
+ <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default">
152
+ <style:text-properties style:font-name="Liberation Sans" style:font-name-asian="AR PL SungtiL GB" style:font-name-complex="Lohit Devanagari"/>
153
+ </style:style>
154
+ <style:page-layout style:name="pm1">
155
+ <style:page-layout-properties style:writing-mode="lr-tb"/>
156
+ <style:header-style>
157
+ <style:header-footer-properties fo:min-height="7.5mm" fo:margin-left="0mm" fo:margin-right="0mm" fo:margin-bottom="2.5mm"/>
158
+ </style:header-style>
159
+ <style:footer-style>
160
+ <style:header-footer-properties fo:min-height="7.5mm" fo:margin-left="0mm" fo:margin-right="0mm" fo:margin-top="2.5mm"/>
161
+ </style:footer-style>
162
+ </style:page-layout>
163
+ <style:page-layout style:name="pm2">
164
+ <style:page-layout-properties style:writing-mode="lr-tb"/>
165
+ <style:header-style>
166
+ <style:header-footer-properties fo:min-height="7.5mm" fo:margin-left="0mm" fo:margin-right="0mm" fo:margin-bottom="2.5mm" fo:border="2.49pt solid #000000" fo:padding="0.18mm" fo:background-color="#c0c0c0">
167
+ <style:background-image/>
168
+ </style:header-footer-properties>
169
+ </style:header-style>
170
+ <style:footer-style>
171
+ <style:header-footer-properties fo:min-height="7.5mm" fo:margin-left="0mm" fo:margin-right="0mm" fo:margin-top="2.5mm" fo:border="2.49pt solid #000000" fo:padding="0.18mm" fo:background-color="#c0c0c0">
172
+ <style:background-image/>
173
+ </style:header-footer-properties>
174
+ </style:footer-style>
175
+ </style:page-layout>
176
+ </office:automatic-styles>
177
+ <office:master-styles>
178
+ <style:master-page style:name="Default" style:page-layout-name="pm1">
179
+ <style:header>
180
+ <text:p><text:sheet-name>???</text:sheet-name></text:p>
181
+ </style:header>
182
+ <style:header-left style:display="false"/>
183
+ <style:footer>
184
+ <text:p>Stránka <text:page-number>1</text:page-number></text:p>
185
+ </style:footer>
186
+ <style:footer-left style:display="false"/>
187
+ </style:master-page>
188
+ <style:master-page style:name="Report" style:page-layout-name="pm2">
189
+ <style:header>
190
+ <style:region-left>
191
+ <text:p><text:sheet-name>???</text:sheet-name> (<text:title>???</text:title>)</text:p>
192
+ </style:region-left>
193
+ <style:region-right>
194
+ <text:p><text:date style:data-style-name="N2" text:date-value="2019-09-18">00.00.0000</text:date>, <text:time style:data-style-name="N2" text:time-value="16:15:31.823489375">00:00:00</text:time></text:p>
195
+ </style:region-right>
196
+ </style:header>
197
+ <style:header-left style:display="false"/>
198
+ <style:footer>
199
+ <text:p>Stránka <text:page-number>1</text:page-number> / <text:page-count>99</text:page-count></text:p>
200
+ </style:footer>
201
+ <style:footer-left style:display="false"/>
202
+ </style:master-page>
203
+ </office:master-styles>
204
+ <office:body>
205
+ <office:spreadsheet>
206
+ <table:calculation-settings table:case-sensitive="false" table:automatic-find-labels="false" table:use-regular-expressions="false" table:use-wildcards="true">
207
+ <table:iteration table:maximum-difference="0.0001"/>
208
+ </table:calculation-settings>
209
+ <table:table table:name="List1" table:style-name="ta1">
210
+ <table:table-header-columns>
211
+ <table:table-column table:style-name="co1" table:default-cell-style-name="Default"/>
212
+ </table:table-header-columns>
213
+ <table:table-column table:style-name="co2" table:default-cell-style-name="Default"/>
214
+ <table:table-header-rows>
215
+ <table:table-row table:style-name="ro1">
216
+ <table:table-cell office:value-type="string" calcext:value-type="string">
217
+ <text:p>Cell in header row</text:p>
218
+ </table:table-cell>
219
+ <table:table-cell/>
220
+ </table:table-row>
221
+ <table:table-row table:style-name="ro1">
222
+ <table:table-cell office:value-type="string" calcext:value-type="string">
223
+ <text:p>Row is also header row</text:p>
224
+ </table:table-cell>
225
+ <table:table-cell/>
226
+ </table:table-row>
227
+ </table:table-header-rows>
228
+ <table:table-row table:style-name="ro1">
229
+ <table:table-cell office:value-type="string" calcext:value-type="string">
230
+ <text:p>This is first nonheader row, but it is in colheader</text:p>
231
+ </table:table-cell>
232
+ <table:table-cell table:style-name="ce1" office:value-type="string" calcext:value-type="string">
233
+ <text:p>First completely nonheader cell</text:p>
234
+ </table:table-cell>
235
+ </table:table-row>
236
+ </table:table>
237
+ <table:named-expressions/>
238
+ </office:spreadsheet>
239
+ </office:body>
240
+ </office:document>
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspreadsheet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub A.Těšínský
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-19 00:00:00.000000000 Z
11
+ date: 2019-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.1'
19
+ version: '1.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.1'
26
+ version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: andand
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
@@ -64,54 +64,54 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '10.0'
67
+ version: '0.9'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '10.0'
74
+ version: '0.9'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rspec
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - "~>"
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: '2.0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - "~>"
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '2.0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: pry-nav
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - "~>"
93
+ - - ">="
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0.0'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - "~>"
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0.0'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: coveralls
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - "~>"
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0.7'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - "~>"
114
+ - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0.7'
117
117
  description: Manipulating LibreOffice Calc (OpenDocument Spreadsheet) files with Ruby.
@@ -178,6 +178,7 @@ files:
178
178
  - spec/testfile1.fods
179
179
  - spec/testfile1.ods
180
180
  - spec/testfile2-images.ods
181
+ - spec/testfile3-header_rows_and_cells.fods
181
182
  - spec/tools_spec.rb
182
183
  - spec/workbook_spec.rb
183
184
  - spec/worksheet_spec.rb
@@ -202,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
203
  version: '0'
203
204
  requirements: []
204
205
  rubyforge_project:
205
- rubygems_version: 2.7.6.2
206
+ rubygems_version: 2.5.2.1
206
207
  signing_key:
207
208
  specification_version: 4
208
209
  summary: Manipulating LibreOffice Calc (OpenDocument Spreadsheet) files from Ruby
@@ -227,6 +228,7 @@ test_files:
227
228
  - spec/testfile1.fods
228
229
  - spec/testfile1.ods
229
230
  - spec/testfile2-images.ods
231
+ - spec/testfile3-header_rows_and_cells.fods
230
232
  - spec/tools_spec.rb
231
233
  - spec/workbook_spec.rb
232
234
  - spec/worksheet_spec.rb