From ed431aa30fee68551b3dcaf6c8879a9d39d0ec7b Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:40:44 +0100 Subject: [PATCH] Update tests --- novelwriter/constants.py | 2 +- novelwriter/formats/todocx.py | 1 + .../fmtToDocX_SaveDocument_document.xml | 46 +++++++++---------- .../fmtToDocX_SaveDocument_styles.xml | 22 ++++----- .../reference/fmtToOdt_SaveFlat_document.fodt | 26 +++++------ tests/reference/fmtToOdt_SaveFull_styles.xml | 20 ++++---- .../mBuildDocBuild_HTML5_Lorem_Ipsum.htm | 14 +++--- .../mBuildDocBuild_HTML5_Lorem_Ipsum.json | 18 ++++---- ...uildDocBuild_OpenDocument_Lorem_Ipsum.fodt | 26 +++++------ tests/test_formats/test_fmt_todocx.py | 2 +- tests/test_formats/test_fmt_toodt.py | 4 -- 11 files changed, 89 insertions(+), 92 deletions(-) diff --git a/novelwriter/constants.py b/novelwriter/constants.py index 2c54ad25..dc4a44eb 100644 --- a/novelwriter/constants.py +++ b/novelwriter/constants.py @@ -126,7 +126,7 @@ class nwStyles: "TT": (0.00, 0.60), # Text margins (top, bottom) "SP": (1.20, 1.20), # Separator margins (top, bottom) "MT": (0.00, 0.60), # Meta margins (top, bottom) - "FT": (1.20, 0.40), # Footnote margins (left, bottom) + "FT": (1.40, 0.40), # Footnote margins (left, bottom) } diff --git a/novelwriter/formats/todocx.py b/novelwriter/formats/todocx.py index 6410a5e9..42d42bc5 100644 --- a/novelwriter/formats/todocx.py +++ b/novelwriter/formats/todocx.py @@ -1166,6 +1166,7 @@ class DocXParagraph: _wTag("before"): str(int(20.0 * firstFloat(self._topMargin, style.before))), _wTag("after"): str(int(20.0 * firstFloat(self._bottomMargin, style.after))), _wTag("line"): str(int(20.0 * firstFloat(style.line, style.size))), + _wTag("lineRule"): "auto", }) if indent: xmlSubElem(pPr, _wTag("ind"), attrib=indent) diff --git a/tests/reference/fmtToDocX_SaveDocument_document.xml b/tests/reference/fmtToDocX_SaveDocument_document.xml index 132468c6..4f4be68f 100644 --- a/tests/reference/fmtToDocX_SaveDocument_document.xml +++ b/tests/reference/fmtToDocX_SaveDocument_document.xml @@ -231,7 +231,7 @@ - + @@ -254,7 +254,7 @@ - + @@ -277,7 +277,7 @@ - + @@ -331,7 +331,7 @@ - + @@ -354,7 +354,7 @@ - + @@ -377,7 +377,7 @@ - + @@ -472,7 +472,7 @@ - + @@ -495,7 +495,7 @@ - + @@ -518,7 +518,7 @@ - + @@ -634,7 +634,7 @@ - + @@ -657,7 +657,7 @@ - + @@ -680,7 +680,7 @@ - + @@ -734,7 +734,7 @@ - + @@ -757,7 +757,7 @@ - + @@ -780,7 +780,7 @@ - + @@ -875,7 +875,7 @@ - + @@ -898,7 +898,7 @@ - + @@ -921,7 +921,7 @@ - + @@ -1035,7 +1035,7 @@ - + @@ -1058,7 +1058,7 @@ - + @@ -1081,7 +1081,7 @@ - + @@ -1197,7 +1197,7 @@ - + @@ -1230,7 +1230,7 @@ - + diff --git a/tests/reference/fmtToDocX_SaveDocument_styles.xml b/tests/reference/fmtToDocX_SaveDocument_styles.xml index f730b33a..112ea3ba 100644 --- a/tests/reference/fmtToDocX_SaveDocument_styles.xml +++ b/tests/reference/fmtToDocX_SaveDocument_styles.xml @@ -18,7 +18,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -118,7 +118,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -141,8 +141,8 @@ - - + + diff --git a/tests/reference/fmtToOdt_SaveFlat_document.fodt b/tests/reference/fmtToOdt_SaveFlat_document.fodt index 0b500e35..a8cc3808 100644 --- a/tests/reference/fmtToOdt_SaveFlat_document.fodt +++ b/tests/reference/fmtToOdt_SaveFlat_document.fodt @@ -1,13 +1,13 @@ - 2024-10-29T23:24:19 - novelWriter/2.6a3 + 2024-11-13T20:28:36 + novelWriter/2.6b1 Jane Smith 1234 P42DT12H34M56S Test Project - 2024-10-29T23:24:19 + 2024-11-13T20:28:36 Jane Smith @@ -22,7 +22,7 @@ - + @@ -30,45 +30,45 @@ - + - + - + - + - + - + - + - + - + diff --git a/tests/reference/fmtToOdt_SaveFull_styles.xml b/tests/reference/fmtToOdt_SaveFull_styles.xml index 9b34773a..87323ee1 100644 --- a/tests/reference/fmtToOdt_SaveFull_styles.xml +++ b/tests/reference/fmtToOdt_SaveFull_styles.xml @@ -12,7 +12,7 @@ - + @@ -20,45 +20,45 @@ - + - + - + - + - + - + - + - + - + diff --git a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm index 8e9a6b32..8632ec97 100644 --- a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm +++ b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm @@ -5,16 +5,16 @@ Lorem Ipsum diff --git a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json index b4a31f8d..8ad0ccc8 100644 --- a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json +++ b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json @@ -2,22 +2,22 @@ "meta": { "projectName": "Lorem Ipsum", "novelAuthor": "lipsum.com", - "buildTime": 1730136403, - "buildTimeStr": "2024-10-28 18:26:43" + "buildTime": 1731526420, + "buildTimeStr": "2024-11-13 20:33:40" }, "text": { "css": [ "body {color: #000000; font-family: 'Arial'; font-size: 12pt; font-weight: 400; font-style: normal;}", - "p {text-align: left; line-height: 150%; margin-top: 0.00em; margin-bottom: 0.76em;}", + "p {text-align: left; line-height: 150%; margin-top: 0.00em; margin-bottom: 0.60em;}", "a {color: #4271ae;}", "mark {background: #ffffa6;}", "h1, h2, h3, h4 {color: #4271ae; page-break-after: avoid;}", - "h1 {margin-top: 1.85em; margin-bottom: 0.65em;}", - "h2 {margin-top: 2.18em; margin-bottom: 0.65em;}", - "h3 {margin-top: 1.53em; margin-bottom: 0.65em;}", - "h4 {margin-top: 1.53em; margin-bottom: 0.65em;}", - ".title {font-size: 2.5em; margin-top: 1.85em; margin-bottom: 0.65em;}", - ".sep {text-align: center; margin-top: 1.53em; margin-bottom: 1.53em;}" + "h1 {margin-top: 1.50em; margin-bottom: 0.60em;}", + "h2 {margin-top: 1.50em; margin-bottom: 0.60em;}", + "h3 {margin-top: 1.20em; margin-bottom: 0.60em;}", + "h4 {margin-top: 1.20em; margin-bottom: 0.60em;}", + ".title {font-size: 2.5em; margin-top: 1.50em; margin-bottom: 0.60em;}", + ".sep {text-align: center; margin-top: 1.20em; margin-bottom: 1.20em;}" ], "html": [ [ diff --git a/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt b/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt index 9f61c7a4..c95b67ee 100644 --- a/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt +++ b/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt @@ -1,13 +1,13 @@ - 2024-10-29T09:41:30 - novelWriter/2.6a3 + 2024-11-13T20:33:59 + novelWriter/2.6b1 lipsum.com 50 P0DT0H40M48S Lorem Ipsum - 2024-10-29T09:41:30 + 2024-11-13T20:33:59 lipsum.com @@ -22,7 +22,7 @@ - + @@ -30,45 +30,45 @@ - + - + - + - + - + - + - + - + - + diff --git a/tests/test_formats/test_fmt_todocx.py b/tests/test_formats/test_fmt_todocx.py index 2ae740ba..53e9fd58 100644 --- a/tests/test_formats/test_fmt_todocx.py +++ b/tests/test_formats/test_fmt_todocx.py @@ -395,7 +395,7 @@ def testFmtToDocX_ParagraphFormatting(mockGUI): doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( '' - '' + '' 'Hello World' ) diff --git a/tests/test_formats/test_fmt_toodt.py b/tests/test_formats/test_fmt_toodt.py index 3c9aa8f7..7267bf3a 100644 --- a/tests/test_formats/test_fmt_toodt.py +++ b/tests/test_formats/test_fmt_toodt.py @@ -803,10 +803,6 @@ def testFmtToOdt_SaveFlat(mockGUI, fncPath, tstPaths, ipsumText): odt._isNovel = True odt.setHeaderFormat(nwHeadFmt.DOC_AUTO, 1) assert odt._headerFormat == nwHeadFmt.DOC_AUTO - odt.setFirstLineIndent(True, 1.4, False) - assert odt._firstIndent is True - assert odt._fTextIndent == "0.499cm" - assert odt._indentFirst is False odt.setPageLayout(148, 210, 20, 18, 17, 15) assert odt._mDocWidth == "14.800cm"