Comments (9)
It seems to me that f5a4e01 only resolves this partially, what about many rows which have two empty cellspans.
from rspreadsheet.
In my tests, I've seen some rows to have unusual size limits, gonna dig into that. I also found yet another issue that content with .fods files is not being parsed correctly, not sure if that is related:
= Rspreadsheet.new("spec/testfile4.fods"); @sheet = r.worksheet(1)
=> #<Rspreadsheet::Worksheet:0x0000555e1aae3210 @itemcache={}, @xmlnode=#<LibXML::XML::Node:0x0000555e1aae3288>>
2.6.3 :008 > @sheet.xmlsubnodes.map{|x| x.content}
=> ["\n \n mew\n \n \n 1,00 €\n \n \n ", "\n \n mew\n \n \n \n 10\n \n \n ", "\n \n mew\n \n \n ", "\n \n mew\n \n \n ", "\n \n mewmew\n \n \n ", "\n \n mew\n \n \n ", "\n \n meow\n \n \n ", "\n \n meow\n \n \n ", "\n \n meow\n \n \n ", "\n \n ", "\n \n \n 1,00 €\n \n \n ", "\n \n ", "\n \n mew\n \n \n ", "\n \n \n \n ", "\n \n \n 1,00 €\n \n \n ", "\n \n ", "\n \n \n ", "\n \n ", "\n \n "]
I don't know how to distinguish between manually created but empty cellspans vs. empty styles being automatically applied to large row/column number. Do you have a suggestions or a test case I could work with?
from rspreadsheet.
I added a bunch of tests to my upstream. .fods file and gnumeric .ods file tests still fail.
It seems like merged cells are counted as individual cells:
[cell1] [merged cell 2+3] [cell4]
would currently behave in returning row.size of 4. I could use some input on how it's supposed to work.
from rspreadsheet.
I fixed the issues with flat ods and gnumeric files by checking against content.strip.empty?
from rspreadsheet.
The way it is supposed to work is that if row=[cell1] [merged cell 2+3] [cell4]
than row.size should be 4. If is more row.width than "number of cells". It is a good point however, it just did not come to my mind, that there can be different approach to this.
from rspreadsheet.
If we go by different ways to approach this, we should make it consistent for merged rows and cells
My question would be how we would name the different functions that act as between merged and unmerged content and which mode would be the default?
from rspreadsheet.
@jglauche Surely the behaviour must be consistent. Is the behaviour different for rows? (Sorry did not have chance to pull your code and hand test it, from diffs it looks good however)
from rspreadsheet.
@gorn no, my current implementation is consistently showing merged cells in any direction as individual items.
from rspreadsheet.
Accepting the oull request
from rspreadsheet.
Related Issues (20)
- FODS support HOT 7
- Setting background color get more cells colorized HOT 13
- Tests failing for ruby >= 2.4.6 HOT 1
- Cells table:covered-table-cell ignored.
- Repeated header rows (contained in table:table-header-rows) are ignored.
- method mispelled: Rspreadsheet::Row#lenght should be #length HOT 1
- Existing formulas do not calculate fields set by rspreadsheet HOT 9
- libxml gem not installed automatically on windows HOT 9
- Header rows are not respected HOT 1
- Rubyzip 1.3.0 and 2.0.0
- rewriting cell addresses in formulas when inserting rows / cells HOT 1
- Randomly crash HOT 1
- Bundler doesn't detect libxml-ruby as a transitive dependency on macOS
- Can we open password protected file HOT 1
- Uncaught exception: cannot load such file -- libxml_ruby even if it's installed. HOT 2
- Problem writing cell with a drop-down list
- Unclear how to set cell number format for date etc.
- Charts in source .ods file cause an error when trying to save. HOT 1
- Iterate worksheets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspreadsheet.