Skip to content

Commit 9a811c4

Browse files
committed
no style bug fix
crash when no column style applied fixed added size to style tuple to prevent accidental compression
1 parent be263fc commit 9a811c4

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

pyexcelerate/Style.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def _binary_operation(self, other, operation):
107107
)
108108

109109
def _to_tuple(self):
110-
return (self._font, self._fill, self._format, self._alignment, self._borders)
110+
return (self._font, self._fill, self._format, self._alignment, self._borders, self._size)
111111

112112

113113
def __str__(self):

pyexcelerate/templates/xl/worksheets/sheet.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</sheetView>
77
</sheetViews>
88
<sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/>
9-
<cols>{% for x, column in worksheet.col_styles %}{{ worksheet.get_col_xml_string(x) }}</col>{% endfor %}</cols>
9+
{% if worksheet.col_styles %}<cols>{% for x, column in worksheet.col_styles %}{{ worksheet.get_col_xml_string(x) }}</col>{% endfor %}</cols>{% endif %}
1010
<sheetData>{% for x, row in worksheet.get_xml_data() %}{{ worksheet.get_row_xml_string(x) }}{% for cell in row %}{{ cell }}{% endfor %}</row>{% endfor %}</sheetData>
1111
{% if worksheet.merges.__len__() > 0 %}<mergeCells>{% for merge in worksheet.merges %}<mergeCell ref="{{ merge.__str__() }}"/>{% endfor %}</mergeCells>{% endif %}
1212
<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" />

pyexcelerate/tests - Shortcut.lnk

-1.72 KB
Binary file not shown.

0 commit comments

Comments
 (0)