sw/source/core/access/accpara.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
New commits: commit 019d80b59e555747b6d17dfc938e5e4b31be6482 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Jan 21 16:20:29 2023 +0000 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Jan 25 08:56:28 2023 +0000 rhbz#2162862 null pFrame during teardown Change-Id: Iad2de93f0400b0ec49dae4c3d6979957784114f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145935 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 2e3b1a683f490384bedd925cb57dc9bc9f5c6cf1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145952 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index aea0d2b3518f..8121d1c62389 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -431,15 +431,18 @@ bool SwAccessibleParagraph::HasCursor() void SwAccessibleParagraph::UpdatePortionData() { // obtain the text frame - OSL_ENSURE( GetFrame() != nullptr, "The text frame has vanished!" ); - OSL_ENSURE( GetFrame()->IsTextFrame(), "The text frame has mutated!" ); const SwTextFrame* pFrame = static_cast<const SwTextFrame*>( GetFrame() ); - - // build new portion data - m_pPortionData.reset( new SwAccessiblePortionData( - pFrame, GetMap()->GetShell()->GetViewOptions()) ); - pFrame->VisitPortions( *m_pPortionData ); - + OSL_ENSURE( pFrame != nullptr, "The text frame has vanished!" ); + if (!pFrame) + ClearPortionData(); + else + { + OSL_ENSURE( pFrame->IsTextFrame(), "The text frame has mutated!" ); + // build new portion data + m_pPortionData.reset( new SwAccessiblePortionData( + pFrame, GetMap()->GetShell()->GetViewOptions()) ); + pFrame->VisitPortions( *m_pPortionData ); + } OSL_ENSURE( m_pPortionData != nullptr, "UpdatePortionData() failed" ); }