From 33801bb8a10e851703c9e9c4afa6ded7fda063ec Mon Sep 17 00:00:00 2001 From: Jake Wilkins Date: Tue, 27 Jan 2015 16:51:22 -0600 Subject: [PATCH] Respect the 'number-columns-repeated' attribute --- lib/ods.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ods.rb b/lib/ods.rb index 40f7738..97e4a2d 100644 --- a/lib/ods.rb +++ b/lib/ods.rb @@ -152,8 +152,12 @@ def cols @cols = [] no = 'A' xpath('table:table-cell').each{|cell| - @cols << Cell.new(cell, no) - no.succ! + repeated = cell.attributes['number-columns-repeated'] + count = (repeated && repeated.value.to_i) || 1 + 1.upto(count) do + @cols << Cell.new(cell, no) + no.succ! + end } @cols end