sw/source/core/text/inftxt.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 4acedb794c1ba0de24f2c8703e07d7f2d5143bdb
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Jun 25 15:22:56 2024 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Jun 25 17:31:09 2024 +0200

    tdf#161721 sw: text formatting: TabOverMargin allow 55cm of crazy
    
    Also remove the limitation to a single text portion after tab, seems it
    was overly cautious.
    
    Change-Id: I07da5fdc97d84a056db87c8b74cdfc5bca85cf1d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169521
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index e27af27ac5eb..a8222328e1ae 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -2005,11 +2005,10 @@ SwTwips SwTextFormatInfo::GetLineWidth()
         if (pLastTab->GetWhichPor() == PortionType::TabLeft)
             nLineWidth = nTextFrameWidth - pLastTab->GetTabPos();
     }
-    else if (GetLast() == pLastTab)
+    else
     {   // tdf#158658 Put content after tab into margin like Word.
-        // FIXME using Width() is entirely arbitrary here, Word adds even more
-        // width but not infinitely much.
-        nLineWidth = std::max(Width(), nLineWidth);
+        // Try to limit the paragraph to 55.87cm, it's max tab pos in Word UI.
+        nLineWidth = o3tl::toTwips(558, o3tl::Length::mm) - X();
     }
     return nLineWidth;
 }

Reply via email to