sw/source/core/docnode/node2lay.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit df89de9f9d02df5def41f5b8422514704d42cbde
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Jan 29 17:36:41 2025 +0100
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Tue Feb 11 16:15:01 2025 +0100

    tdf#156348 sw: fix crash on converting text to table with SwSetExpField
    
    The problem is that the table node only gets a SwFrameFormat assigned at
    the end of the operation after all the nodes have been split etc., and
    moving a field into a newly split node calls
    sw::FindNeighbourFrameForNode() which needs to handle table node without
    SwFrameFormat now when going backwards (not when going forwards because
    the table node is always before the nodes in the table).
    
    (regression from commit 9dc6e2c9062725ef1f9d7e321cae5f4dbe8ca749)
    
    Change-Id: Ia0c1f7d7b14f525aa8de4a2b6492c39b59f31052
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180914
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins
    (cherry picked from commit b5967157b37904219865fd847b20938b3ccfbd72)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180919
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>
    (cherry picked from commit 23d225dac8f717bea8e960e4c2130963db7f3920)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181106
    Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/sw/source/core/docnode/node2lay.cxx 
b/sw/source/core/docnode/node2lay.cxx
index 312ce2dff440..3efaea7f08ff 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -115,7 +115,12 @@ static SwNode* GoPreviousWithFrame(SwNodeIndex *pIdx, 
SwFlowFrame const**const p
             // frame as the caller's one
             pFound = SwIterator<SwFrame, SwContentNode, 
sw::IteratorMode::UnwrapMulti>(*static_cast<SwContentNode*>(pNd)).First();
         else if ( pNd->IsTableNode() )
-            pFound = 
SwIterator<SwFrame,SwFormat>(*static_cast<SwTableNode*>(pNd)->GetTable().GetFrameFormat()).First();
+        {
+            if (SwFrameFormat *const 
pFormat{static_cast<SwTableNode*>(pNd)->GetTable().GetFrameFormat()})
+            {
+                pFound = SwIterator<SwFrame,SwFormat>(*pFormat).First();
+            }
+        }
         else if( pNd->IsStartNode() && !pNd->IsSectionNode() )
         {
             pNd = nullptr;

Reply via email to