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