Parse text indentation in the tokenizer instead

This commit is contained in:
Veronica Berglyd Olsen
2024-05-27 00:26:53 +02:00
parent 206ca6040e
commit ee137b6ffd
2 changed files with 17 additions and 9 deletions
+1 -7
View File
@@ -438,7 +438,6 @@ class ToOdt(Tokenizer):
self._result = "" # Not used, but cleared just in case
xText = self._xText
pIndent = True
for tType, _, tText, tFormat, tStyle in self._tokens:
# Styles
@@ -455,7 +454,6 @@ class ToOdt(Tokenizer):
if tStyle & self.A_PBB:
oStyle.setBreakBefore("page")
if tStyle & self.A_PBA:
oStyle.setBreakAfter("page")
@@ -469,16 +467,12 @@ class ToOdt(Tokenizer):
if tStyle & self.A_IND_R:
oStyle.setMarginRight(self._fBlockIndent)
if not self._indentFirst and tType in self.L_SKIP_INDENT:
pIndent = False
# Process Text Types
if tType == self.T_TEXT:
if self._firstIndent and pIndent and oStyle.isUnaligned():
if tStyle & self.A_IND_T:
self._addTextPar(xText, S_FIND, oStyle, tText, tFmt=tFormat)
else:
self._addTextPar(xText, S_TEXT, oStyle, tText, tFmt=tFormat)
pIndent = True
elif tType == self.T_TITLE:
# Title must be text:p