mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
Support merged columns building schedule from ods #2885
Before - https://i.imgur.com/p1l6ugn.png After - https://i.imgur.com/9QZ2YW2.png
This commit is contained in:
@@ -79,10 +79,14 @@ class Scheduler:
|
|||||||
tdi = 0
|
tdi = 0
|
||||||
|
|
||||||
for td in tr.getElementsByType(TableCell):
|
for td in tr.getElementsByType(TableCell):
|
||||||
|
column_span = td.getAttribute("numbercolumnsspanned")
|
||||||
|
column_span = int(column_span) if column_span else 1
|
||||||
|
|
||||||
repeat = td.getAttribute("numbercolumnsrepeated")
|
repeat = td.getAttribute("numbercolumnsrepeated")
|
||||||
repeat = int(repeat) if repeat else 1
|
repeat = int(repeat) if repeat else 1
|
||||||
|
|
||||||
for i in range(0, repeat):
|
for i in range(0, repeat):
|
||||||
width = column_widths[tdi]
|
width = sum(column_widths[tdi:tdi + int(column_span)])
|
||||||
self.svg.add(
|
self.svg.add(
|
||||||
self.svg.rect(
|
self.svg.rect(
|
||||||
insert=(x, y),
|
insert=(x, y),
|
||||||
@@ -94,7 +98,7 @@ class Scheduler:
|
|||||||
if value:
|
if value:
|
||||||
self.add_text(value[0], x + self.padding, y + height - self.padding)
|
self.add_text(value[0], x + self.padding, y + height - self.padding)
|
||||||
x += width
|
x += width
|
||||||
tdi += 1
|
tdi += column_span
|
||||||
|
|
||||||
y += height
|
y += height
|
||||||
total_width = sum(column_widths) + (self.margin * 2)
|
total_width = sum(column_widths) + (self.margin * 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user