diff options
| author | Randy Morgan <[email protected]> | 2012-03-31 20:17:55 -0700 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-03-31 20:17:55 -0700 |
| commit | b11537d6cb1835a509f1a9f6e8dcd0fc3a910c6b (patch) | |
| tree | 87e2a54623b28e45703eb360abf50130827d3419 /lib | |
| parent | 2156d67a49cc231201acc7c5526d15e1cd057324 (diff) | |
| parent | 8190b1428774e0dac398d43e9c97e5476126073b (diff) | |
| download | caxlsx-b11537d6cb1835a509f1a9f6e8dcd0fc3a910c6b.tar.gz caxlsx-b11537d6cb1835a509f1a9f6e8dcd0fc3a910c6b.zip | |
Merge pull request #72 from joekain/perf
Build self_hash up from INLINE_STYLES
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 015c4b91..13140786 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -226,7 +226,8 @@ module Axlsx # equality comparison to test value, type and inline style attributes # this is how we work out if the cell needs to be added or already exists in the shared strings table def shareable_hash - self_hash = self.instance_values.reject { |key, val| !INLINE_STYLES.include?(key) } + self_hash = {} + INLINE_STYLES.each { |style| self_hash[style] = self.instance_variable_get("@" + style) } self_hash['color'] = self_hash['color'].instance_values if self_hash['color'] self_hash end |
