Fix issue #145 when no text on front of a wrapper (#147)

When no text was on the front of a wrapper, the back wrapper text and tab were not in the proper location.
This was due to exiting the routine without doing the self.canvas.restoreState().
Cleaned up the code to be easier to read and to exit cleanly.
This commit is contained in:
Wendel Voigt 2017-02-10 15:36:28 -06:00 committed by Peter
parent c4c44bfbea
commit c843e5970d

View File

@ -782,21 +782,17 @@ class DividerDrawer(object):
usedHeight += 15 usedHeight += 15
# Figure out what text is to be printed on this divider # Figure out what text is to be printed on this divider
if divider_text == "blank": descriptions = None
# blank divider, no need to go on if divider_text == "card" and card.description:
return
elif divider_text == "rules":
# Add the extra rules text to the divider
if card.extra:
descriptions = card.extra
else:
# Asked for rules and they don't exist, so don't print anything
return
elif divider_text == "card":
# Add the card text to the divider # Add the card text to the divider
descriptions = card.description descriptions = card.description
else: elif divider_text == "rules" and card.extra:
# Don't know what was asked, so don't print anything # Add the extra rules text to the divider
descriptions = card.extra
if descriptions is None:
# No text to print, so exit early and cleanly
self.canvas.restoreState()
return return
s = getSampleStyleSheet()['BodyText'] s = getSampleStyleSheet()['BodyText']