sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 4 ++++ sw/source/core/text/txttab.cxx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
New commits: commit d7a7ac3581290f9d4820d01d0a64269fc47d00f6 Author: Justin Luth <justin_l...@sil.org> AuthorDate: Wed Jun 16 15:33:06 2021 +0200 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Sat Jun 19 19:56:15 2021 +0200 tdf#142404 DOCX c15: fix centering when TabOverSpacing I didn't notice the need for making the same exclusion that TabOverMargin made for centering when 7.2 got the new TabOverSpacing compat flag. But now I see it is still needed. Change-Id: Ia8069b5566eaf6dcdac6ff10ee0c60b849c5fa2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117339 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117446 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 5899bd703ccc..5666c3f1b1d1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -242,6 +242,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf142404_tabOverSpacingC15, "tdf142404_ sal_Int32 nHeight = parseDump("//page[1]/body/txt[2]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_MESSAGE("4 lines high", 1100 < nHeight); CPPUNIT_ASSERT_MESSAGE("4 lines high", nHeight < 1300); + + CPPUNIT_ASSERT_EQUAL(OUString("A centered tab positioned at"), parseDump("//page[1]/body/txt[3]/Text[1]", "Portion")); + sal_Int32 nLineWidth = parseDump("//page[1]/body/txt[3]/Text[2]", "nWidth").toInt32(); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Big tab: full paragraph area used", 737, nLineWidth, 100); } DECLARE_OOXMLEXPORT_TEST(testTdf139580, "tdf139580.odt") diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index e12d31c64251..66136b0c9fce 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -499,7 +499,7 @@ bool SwTabPortion::PostFormat( SwTextFormatInfo &rInf ) // centered tabs are problematic: // We have to detect how much fits into the line. sal_uInt16 nNewWidth = nPorWidth /2; - if( !bTabOverMargin && nNewWidth > rInf.Width() - nRight ) + if (!bTabOverMargin && !bTabOverSpacing && nNewWidth > rInf.Width() - nRight) nNewWidth = nPorWidth - (rInf.Width() - nRight); nPorWidth = nNewWidth; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits