[Libreoffice-commits] core.git: sw/source

Mike mikekaganski at hotmail.com
Thu Apr 30 01:28:40 PDT 2015


 sw/source/core/text/frmform.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 8a08f68669f9acfe98dadcca4af6519164a17000
Author: Mike <mikekaganski at hotmail.com>
Date:   Mon Apr 27 01:27:05 2015 +1000

    tdf#66141: SwTxtFrm::FormatQuick(bool) endless loop
    
    If a line happens to be invisible (e.g. in too thin cell of a table)
    then aLine.FormatLine(nStart) returns nStart, and
    aLine.Insert( new SwLineLayout() ) is executed until OOM.
    
    Change-Id: I9b12cf2f1f3f1987cd8ce380b1d85196ffe95e5e
    Reviewed-on: https://gerrit.libreoffice.org/15542
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index abec386..7ad55d7 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1918,8 +1918,11 @@ bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
                       ? GetFollow()->GetOfst() : aInf.GetTxt().getLength();
     do
     {
-        nStart = aLine.FormatLine( nStart );
-        if( aInf.IsNewLine() || (!aInf.IsStop() && nStart < nEnd) )
+        sal_Int32 nShift = aLine.FormatLine(nStart) - nStart;
+        nStart += nShift;
+        if ((nShift != 0) // Check for special case: line is invisible,
+                          // like in too thin table cell: tdf#66141
+         && (aInf.IsNewLine() || (!aInf.IsStop() && nStart < nEnd)))
             aLine.Insert( new SwLineLayout() );
     } while( aLine.Next() );
 


More information about the Libreoffice-commits mailing list