Skip to content

Commit

Permalink
Minor refactor to pattern handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcnamara committed Sep 4, 2022
1 parent 379ca24 commit b092100
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xlsxwriter/workbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,13 +1030,13 @@ def _prepare_fills(self):
xf_format.fg_color = xf_format.bg_color
xf_format.bg_color = tmp

if (xf_format.pattern == 0 and xf_format.bg_color != 0
if (xf_format.pattern <= 1 and xf_format.bg_color != 0
and xf_format.fg_color == 0):
xf_format.fg_color = xf_format.bg_color
xf_format.bg_color = 0
xf_format.pattern = 1

if (xf_format.pattern == 0 and xf_format.bg_color == 0
if (xf_format.pattern <= 1 and xf_format.bg_color == 0
and xf_format.fg_color != 0):
xf_format.pattern = 1

Expand Down

0 comments on commit b092100

Please sign in to comment.