sw/source/core/text/portxt.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 9d8a54d4b65e9f16dee05c8152cfe4bd68f0b047
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Fri Sep 5 08:13:14 2025 +0200
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Fri Sep 5 22:22:32 2025 +0200

    tdf#167648 sw letter spacing: fix division by zero
    
    /sw/source/core/text/portxt.cxx:351:90: runtime error: division by zero
        #0 0x7f7bf4700824 in SwTextPortion::SetSpacing(SwTextFormatInfo&, 
o3tl::strong_int<int, Tag_TextFrameIndex>, int, short) 
/sw/source/core/text/portxt.cxx:351:90
    
    (<https://ci.libreoffice.org//job/lo_ubsan/3669/>)
    
    Regression from commit 3c53797210bf0a4e3ffb36ed2beac4d5ce229ff2
    "tdf#167648 sw letter spacing: implement minimum letter spacing".
    
    Change-Id: I1dbea7ce855c1f4cb0604e6f9b96b875dd8eb646
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190608
    Reviewed-by: László Németh <nem...@numbertext.org>
    Tested-by: Jenkins

diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index e5af02132e49..a440c0af336f 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -344,6 +344,10 @@ sal_uInt16 SwTextPortion::GetMaxComp(const 
SwTextFormatInfo& rInf) const
 void SwTextPortion::SetSpacing( SwTextFormatInfo &rInf, const TextFrameIndex 
nBreakPos,
                 const sal_Int32 nSpaces, const sal_Int16 nWidthOf10Spaces )
 {
+    // TODO allow letter spacing and glyph scaling in single word lines, too
+    if ( nSpaces == 0 )
+        return;
+
     SvxAdjustItem aAdjustItem =
         
rInf.GetTextFrame()->GetTextNodeForParaProps()->GetSwAttrSet().GetAdjust();
     // width of a single expanded space without letter spacing and glyph 
scaling

Reply via email to