[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sw/source

Michael Stahl mstahl at redhat.com
Thu Sep 7 14:47:40 UTC 2017


 sw/source/core/text/frmform.cxx |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 7629c51d6793a4c5f31200b2cbbb75ed9074ee6c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Sep 6 23:18:23 2017 +0200

    tdf#112163 sw: avoid crashing in layout on this document
    
    SwTextFrame 0x5dfb7a0 is join locked so doesn't GetFormatted() so
    doesn't have a SwTextLineAccess created; add some defensive programming
    just to make it not crash.
    
    Whether this is the right fix or just a workaround for something going
    wrong in the 179 layout stack frames is beyond my meager knowledge.
    
    In case anybody has an obvious idea, the layout frames that are
    currently being formatted (SwTextFrame or SwTabFrame) are:
    
     #3 0x5dfb7a0 is master of 0x5e56330
    
     #4 0x5e56330
    
     #10 0x5e5f3f0 is follow of 0x5e56330
    
     #19 0x5e60d30 SwTabFrame::Split
    
     #30 0x5e56330
    
     #44 0x5dfb7a0
    
     #53 0x2cefae0 master of 0x5dfb7a0
    
     #57 0x63d1440 SwTabFrame::MakeAll is follow of #58
    
     #58 0x5e106c0 SwTabFrame::MakeAll
    
     #68 0x5e812d0
    
     #77 0x5e11f80 is master of #68
    
     #86 0x2cef600 is master of #77
    
     #90 0x5f86c00 SwTabFrame::MakeAll
    
     #91 0x63d0150 SwTabFrame::MakeAll
    
     #98 SwFlowFrame::MoveFwd
     #101 0x63cf3d0
    
     #110 0x5e05ff0 is master of #101
    
     #119 0x5e0c700 is master of #110
    
     #128 0x5bd0ad0 is master of #119
    
     #136 0x5f8b800 is master of #128
    
     #145 0x86b29a0 is master of #136
    
     #154 0x2c37340 is master of #145
    
     #158 0x5e04ab0 SwTabFrame::MakeAll
    
     #168 0x2c371a0
    
     #173 0x5e16340 SwTabFrame::MakeAll
    
    Change-Id: I716b5faec1512cbf1fbdb04a436da302bd628c51
    (cherry picked from commit 6c8c51231e7415ecc20d1343211acf8382666613)
    Reviewed-on: https://gerrit.libreoffice.org/42040
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index d35ef5bad1b1..e8e798275e68 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1401,10 +1401,17 @@ void SwTextFrame::Format_( SwTextFormatter &rLine, SwTextFormatInfo &rInf,
         {
             if( !pMaster->HasPara() )
                 pMaster->GetFormatted();
-            SwTextSizeInfo aInf( pMaster );
-            SwTextIter aMasterLine( pMaster, &aInf );
-            aMasterLine.Bottom();
-            pLine = aMasterLine.GetCurr();
+            if (!pMaster->HasPara())
+            {   // master could be locked because it's being formatted upstack
+                SAL_WARN("sw", "SwTextFrame::Format_: failed to format master!");
+            }
+            else
+            {
+                SwTextSizeInfo aInf( pMaster );
+                SwTextIter aMasterLine( pMaster, &aInf );
+                aMasterLine.Bottom();
+                pLine = aMasterLine.GetCurr();
+            }
         }
         SwLinePortion* pRest = pLine ?
             rLine.MakeRestPortion(pLine, GetOfst()) : nullptr;


More information about the Libreoffice-commits mailing list