diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-05-19 16:12:18 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-05-31 11:18:13 +0200 |
commit | 0587784ee2948350f05a7f7a64cc25d3b8c00ec3 (patch) | |
tree | d2f97f1de1a9de88cac9253280a17ca8be0982df | |
parent | sw: fix crash in GotoNextLayoutTextFrame/GotoPrevLayoutTextFrame (diff) | |
download | core-0587784ee2948350f05a7f7a64cc25d3b8c00ec3.tar.gz core-0587784ee2948350f05a7f7a64cc25d3b8c00ec3.zip |
sw: fix crash in DocumentLayoutManager::CopyLayoutFormat
See https://crashreport.libreoffice.org/stats/signature/sw::DocumentLayoutManager::CopyLayoutFormat(SwFrameFormat%20const%20&,SwFormatAnchor%20const%20&,bool,bool)
Change-Id: I1680bb79be4c1eb2ff18ed46dfa286da5e729e63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152015
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
(cherry picked from commit 77bc0d1d7c0b895d089fa7ac2f7ca5221345b71a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152102
(cherry picked from commit 05d8be5c4a13be63cfbea58954f1b0c4d8a9837f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152211
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r-- | sw/source/core/doc/DocumentLayoutManager.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index e0366bdd3a0b..75c8e86acdb2 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -454,8 +454,9 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat( { SwNode* pAnchorNode = rNewAnchor.GetAnchorNode(); SwFormatFlyCnt aFormat( pDest ); - pAnchorNode->GetTextNode()->InsertItem( - aFormat, rNewAnchor.GetAnchorContentOffset(), 0 ); + assert(pAnchorNode->GetTextNode() && "sw.core: text node expected"); + if (SwTextNode *pTextNd = pAnchorNode->GetTextNode()) + pTextNd->InsertItem( aFormat, rNewAnchor.GetAnchorContentOffset(), 0 ); } if( bMakeFrames ) |