sw/qa/extras/layout/data/min-wtf.rtf | 42 +++++++++++++++++++++++++++++++++ sw/qa/extras/layout/layout3.cxx | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+)
New commits: commit 116facc2909708ef32f90c61a4481d71b9138b6d Author: Michael Stahl <[email protected]> AuthorDate: Fri Oct 24 20:01:13 2025 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Mon Oct 27 12:00:50 2025 +0100 sw: text formatting: add test for per-line paragraph properties like Word Test for commit 0849ddd0b1b3c384c5f3de8fe0bbb9df558fa786 Change-Id: Ia26286593b3e7f21799a86b1762ab30421941fad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192957 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins diff --git a/sw/qa/extras/layout/data/min-wtf.rtf b/sw/qa/extras/layout/data/min-wtf.rtf new file mode 100644 index 000000000000..1a38c504c369 --- /dev/null +++ b/sw/qa/extras/layout/data/min-wtf.rtf @@ -0,0 +1,42 @@ +{ tf1deflang1025nsinsicpg1252\uc1deff0\deff0\stshfdbch0\stshfloch31506\stshfhich31506\stshfbi31506\deflang2057\deflangfe1028 hemelang3079 hemelangfe0 hemelangcs0{onttbl{0bidi roman charset0prq2{\*\panose 02020603050405020304}Times New Roman{\*alt Arial};} +{1bidi swisscharset0prq2{\*\panose 020b0604020202020204}Arial{\*alt Arial};} +{dbminor31505bidi nilcharset136prq2{\*\panose 02010601000101010101}PMingLiU{\*alt Arial Unicode MS};} +{himinor31506bidi swisscharset0prq2{\*\panose 020f0502020204030204}Calibri;} +} +{\*\defchp 31506s22\lang3079\langfe1033\langnp3079\langfenp1033 }{\*\defpap \ql \li0 i0\sa200\sl276\slmult1 +\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 } oqfpromote {\stylesheet{\ql \li0 i0\sa200\sl276\slmult1\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 tlchcs1 f0fs22lang1025 \ltrchcs0 +1s23\lang3079\langfe1033+\s15\ql \li0 i0\widctlpar qc x4536 qr x9072\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 tlchcs1 f0fs22lang1025 \ltrchcs0 1s23\lang3079\langfe1033+\sbasedon0 \snext15 \slink17 \sunhideused header;}{\*+\paperw11906\paperh16838\margl1417\margr1417\margt1417\margb1134\gutter0\ltrsect +\deftab708\widowctrltnbjenddoc\hyphhotz425 rackmoves0 rackformatting1\donotembedsysfont1 elyonvml0\donotembedlingdata0\grfdocevents0 alidatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0 +\showxmlerrors1 oxlattoyenxpshrtn oultrlspc\dntblnsbdb ospaceforul ormshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1417\dgvorigin1417\dghshow1\dgvshow1 +\jexpandiewkind1iewscale100\pgbrdrhead\pgbrdrfoot\splytwnine tnlytwnine\htmautsp olnhtadjtbl\useltbalnlntblind\lytcalctblwd\lyttblrtgr\lnbrkrule obrkwrptbl\snaptogridincellllowfieldendsel\wrppunct +sianbrkrule sidroot6514785 ewtblstyruls ogrowautofit\usenormstyforlist oindnmbrtselnbrelev ocxsptable\indrlsweleven oafcnsttblfelev\utinl\hwelev\spltpgpar otcvasp otbrkcnstfrctbl otvatxbx\krnprsnet+{\*\wgrffmtfilter 2450} ofeaturethrottle1\ilfomacatclnup0 +\ltrpar \sectd \ltrsect\pgnrestart\linex0\headery708ootery708+ qc x4536 qr x9072\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 tlchcs1 f0fs22lang1025 \ltrchcs0 1s23\lang3079\langfe1033+\par }}{\headerr \ltrpar \pard\plain \ltrpar\s15\qc \li0 i0\widctlpar qc x4536 qr x9072\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 tlch cs1 f0fs22lang1025 \ltrchcs0 +1s23\lang3079\langfe1033+\par \line \line \line \line \line \line \line +\par }\pard\plain \ltrpar\ql \li0 i0\widctlpar\wrapdefaultaautodjustright in0\lin0\itap0 tlchcs1 f0fs22lang1025 \ltrchcs0 1 s23\lang3079\langfe1033+s16 \line \line \line \line \line }{ tlchcs1 bf0fs12 \ltrchcs0 s16 \line }{ tlchcs1 f0fs16 \ltrchcs0 s16 \line +\par \line +\par }{ tlchcs1 f1 \ltrchcs0 1s16 +\par }\pard \ltrpar\qr \li1418 i0\sa1600\sl480\slmult1\widctlpar\wrapdefault aautodjustright in0\lin1418\itap0 { tlchcs1 f1 \ltrchcs0 1 s16\lang2057\langfe1033\langnp2057 a\line n\line v ab \line d +}{ tlchcs1 f1 \ltrchcs0 1s16\lang2057\langfe1033\langnp2057 +\par }\pard \ltrpar\ql \li0 i0\sa200\sl276\slmult1\keepn\widctlpar x2835\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 { tlchcs1 f1 \ltrchcs0 1s16\lang2057\langfe1033\langnp2057 a + ab c\line x ab y +\par }\pard \ltrpar\ql \li0 i0\sa200\sl276\slmult1\keepn\widctlpar\wrapdefaultspalphaspnum aautodjustright in0\lin0\itap0 { tlchcs1 f1 \ltrchcs0 1 s16\lang2057\langfe1033\langnp2057 +\par }\pard \ltrpar\ql \li0 i0\widctlpar\wrapdefaultaautodjustright in0\lin0\itap0 { tlchcs1 f1 \ltrchcs0 1s16\lang2057\langfe1033\langnp2057 +\par }\pard \ltrpar\ql \li0 i0\sa200\sl276\slmult1\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 { tlchcs1 bf0fs12 \ltrchcs0 s16\lang2057\langfe1033\langnp2057 +\par }\pard\plain \ltrpar\s15\qc \li0 i0\widctlpar qc x4536 qr x9072\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 tlchcs1 f0fs22lang1025 \ltrchcs0 1s23\lang3079\langfe1033+ tlchcs1 f0fs16 \ltrchcs0 s16\lang2057\langfe1033\langnp2057 +\par }\pard\plain \ltrpar\qc \li0 i0\widctlpar\wrapdefaultspalphaspnum aautodjustright in0\lin0\itap0 tlchcs1 f0fs22lang1025 \ltrchcs0 1 s23\lang3079\langfe1033+\ltrchcs0 [text] }{ tlchcs1 f0 \ltrchcs0 \lang2057\langfe1033\langnp2057 +\par }} +\pard\plain \ltrpar\ql \li0 i0\widctlpar\wrapdefaultaautodjustright in0\lin0\itap0 + tlchcs1 f0fs22lang1025 \ltrchcs0 1 s23\lang3079\langfe1033+\hichf0\dbchf31505\loch0 Xxxxxxxxxxxxxxxx xxx xxxx}{ tlchcs1 f0fs24 \ltrchcs0 s24\lang2057\langfe1028\lochf0\hichf0\dbchf31505\langnp2057\langfenp1028 +\par } +} diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index 9ad3c18412fd..a53ed0ada4ee 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -496,6 +496,50 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf162725) assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testHiddenParagraphMarkPerLineProperties) +{ + createSwDoc("min-wtf.rtf"); + + // ensure paragraphs are merged by hidden formatting + SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); + SwViewOption aViewOptions(*pWrtShell->GetViewOptions()); + aViewOptions.SetViewMetaChars(false); + pWrtShell->ApplyViewOptions(aViewOptions); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + assertXPath(pXmlDoc, "/root/page[1]/header/txt", 3); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[1]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[2]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[3]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[4]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[5]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout", 5); + // the problem was that this was 1656 due to using wrong line spacing for last line + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/infos/bounds", "height", u"1499"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[4]/SwFixPortion", + "type", u"PortionType::TabLeft"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[4]/SwFixPortion", + "width", u"532"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[5]/SwFixPortion", + "type", u"PortionType::TabLeft"); + // the problem was that this was 626 (same tab position as previous line) + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[5]/SwFixPortion", + "width", u"2755"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout", 0); + // this one was also wrong (1968) due to wrong spacing-below + assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds", "height", u"411"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout[1]", "height", + u"265"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout", 1); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/infos/bounds", "height", u"492"); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf161810) { createSwDoc("tdf161810.fodt");
