Remove redundant if-checks
This commit is contained in:
@@ -236,32 +236,31 @@ class ToDocX(Tokenizer):
|
||||
self._pars.append(par)
|
||||
|
||||
# Styles
|
||||
if tStyle is not None:
|
||||
if tStyle & BlockFmt.LEFT:
|
||||
par.setAlignment("left")
|
||||
elif tStyle & BlockFmt.RIGHT:
|
||||
par.setAlignment("right")
|
||||
elif tStyle & BlockFmt.CENTRE:
|
||||
par.setAlignment("center")
|
||||
elif tStyle & BlockFmt.JUSTIFY:
|
||||
par.setAlignment("both")
|
||||
if tStyle & BlockFmt.LEFT:
|
||||
par.setAlignment("left")
|
||||
elif tStyle & BlockFmt.RIGHT:
|
||||
par.setAlignment("right")
|
||||
elif tStyle & BlockFmt.CENTRE:
|
||||
par.setAlignment("center")
|
||||
elif tStyle & BlockFmt.JUSTIFY:
|
||||
par.setAlignment("both")
|
||||
|
||||
if tStyle & BlockFmt.PBB:
|
||||
par.setPageBreakBefore(True)
|
||||
if tStyle & BlockFmt.PBA:
|
||||
par.setPageBreakAfter(True)
|
||||
if tStyle & BlockFmt.PBB:
|
||||
par.setPageBreakBefore(True)
|
||||
if tStyle & BlockFmt.PBA:
|
||||
par.setPageBreakAfter(True)
|
||||
|
||||
if tStyle & BlockFmt.Z_BTM:
|
||||
par.setMarginBottom(0.0)
|
||||
if tStyle & BlockFmt.Z_TOP:
|
||||
par.setMarginTop(0.0)
|
||||
if tStyle & BlockFmt.Z_BTM:
|
||||
par.setMarginBottom(0.0)
|
||||
if tStyle & BlockFmt.Z_TOP:
|
||||
par.setMarginTop(0.0)
|
||||
|
||||
if tStyle & BlockFmt.IND_T:
|
||||
par.setIndentFirst(True)
|
||||
if tStyle & BlockFmt.IND_L:
|
||||
par.setMarginLeft(bIndent)
|
||||
if tStyle & BlockFmt.IND_R:
|
||||
par.setMarginRight(bIndent)
|
||||
if tStyle & BlockFmt.IND_T:
|
||||
par.setIndentFirst(True)
|
||||
if tStyle & BlockFmt.IND_L:
|
||||
par.setMarginLeft(bIndent)
|
||||
if tStyle & BlockFmt.IND_R:
|
||||
par.setMarginRight(bIndent)
|
||||
|
||||
# Process Text Types
|
||||
if tType == BlockTyp.TEXT:
|
||||
|
||||
@@ -171,7 +171,7 @@ class ToHtml(Tokenizer):
|
||||
|
||||
# Styles
|
||||
aStyle = []
|
||||
if tStyle is not None and self._cssStyles:
|
||||
if self._cssStyles:
|
||||
if tStyle & BlockFmt.LEFT:
|
||||
aStyle.append("text-align: left;")
|
||||
elif tStyle & BlockFmt.RIGHT:
|
||||
|
||||
@@ -408,30 +408,29 @@ class ToOdt(Tokenizer):
|
||||
|
||||
# Styles
|
||||
oStyle = ODTParagraphStyle("New")
|
||||
if tStyle is not None:
|
||||
if tStyle & BlockFmt.LEFT:
|
||||
oStyle.setTextAlign("left")
|
||||
elif tStyle & BlockFmt.RIGHT:
|
||||
oStyle.setTextAlign("right")
|
||||
elif tStyle & BlockFmt.CENTRE:
|
||||
oStyle.setTextAlign("center")
|
||||
elif tStyle & BlockFmt.JUSTIFY:
|
||||
oStyle.setTextAlign("justify")
|
||||
if tStyle & BlockFmt.LEFT:
|
||||
oStyle.setTextAlign("left")
|
||||
elif tStyle & BlockFmt.RIGHT:
|
||||
oStyle.setTextAlign("right")
|
||||
elif tStyle & BlockFmt.CENTRE:
|
||||
oStyle.setTextAlign("center")
|
||||
elif tStyle & BlockFmt.JUSTIFY:
|
||||
oStyle.setTextAlign("justify")
|
||||
|
||||
if tStyle & BlockFmt.PBB:
|
||||
oStyle.setBreakBefore("page")
|
||||
if tStyle & BlockFmt.PBA:
|
||||
oStyle.setBreakAfter("page")
|
||||
if tStyle & BlockFmt.PBB:
|
||||
oStyle.setBreakBefore("page")
|
||||
if tStyle & BlockFmt.PBA:
|
||||
oStyle.setBreakAfter("page")
|
||||
|
||||
if tStyle & BlockFmt.Z_BTM:
|
||||
oStyle.setMarginBottom("0.000cm")
|
||||
if tStyle & BlockFmt.Z_TOP:
|
||||
oStyle.setMarginTop("0.000cm")
|
||||
if tStyle & BlockFmt.Z_BTM:
|
||||
oStyle.setMarginBottom("0.000cm")
|
||||
if tStyle & BlockFmt.Z_TOP:
|
||||
oStyle.setMarginTop("0.000cm")
|
||||
|
||||
if tStyle & BlockFmt.IND_L:
|
||||
oStyle.setMarginLeft(self._fBlockIndent)
|
||||
if tStyle & BlockFmt.IND_R:
|
||||
oStyle.setMarginRight(self._fBlockIndent)
|
||||
if tStyle & BlockFmt.IND_L:
|
||||
oStyle.setMarginLeft(self._fBlockIndent)
|
||||
if tStyle & BlockFmt.IND_R:
|
||||
oStyle.setMarginRight(self._fBlockIndent)
|
||||
|
||||
# Process Text Types
|
||||
if tType == BlockTyp.TEXT:
|
||||
|
||||
Reference in New Issue
Block a user