Change to use document locale for integers

This commit is contained in:
Veronica Berglyd Olsen
2024-10-28 20:22:02 +01:00
parent d987246062
commit 9bc1561e01
12 changed files with 37 additions and 43 deletions
+4 -8
View File
@@ -223,14 +223,6 @@ class ToOdt(Tokenizer):
# Setters
##
def setLanguage(self, language: str | None) -> None:
"""Set language for the document."""
if language:
lang, _, country = language.partition("_")
self._dLanguage = lang or self._dLanguage
self._dCountry = country or self._dCountry
return
def setPageLayout(
self, width: float, height: float, top: float, bottom: float, left: float, right: float
) -> None:
@@ -264,6 +256,10 @@ class ToOdt(Tokenizer):
fontWeight = str(intWeight)
fontBold = str(min(intWeight + 300, 900))
lang, _, country = self._dLocale.name().partition("_")
self._dLanguage = lang or self._dLanguage
self._dCountry = country or self._dCountry
self._fontFamily = self._textFont.family()
self._fontSize = self._textFont.pointSize()
self._fontWeight = FONT_WEIGHT_MAP.get(fontWeight, fontWeight)