sw/source/filter/html/swhtml.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
New commits: commit 8f1f2ba78de1cd71447b6a387b701ebfb917df79 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Thu Oct 13 08:23:48 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Oct 13 11:19:24 2022 +0200 rearrange node logic here so we don't have to touch SwPosition.nContent. Part of the process of hiding the internals of SwPosition Change-Id: I02fed4998b68edaca4ef3014bc64cca85af7fcdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141279 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 438f19829935..804fbb743e9e 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -826,9 +826,12 @@ void SwHTMLParser::Continue( HtmlTokenId nToken ) pCursorSh->SetMark(); pCursorSh->ClearMark(); } - m_pPam->GetBound().nContent.Assign( nullptr, 0 ); - m_pPam->GetBound(false).nContent.Assign( nullptr, 0 ); - m_xDoc->GetNodes().Delete( m_pPam->GetPoint()->GetNode() ); + SwNode& rDelNode = m_pPam->GetPoint()->GetNode(); + // move so we don't have a dangling SwContentIndex to the deleted node + m_pPam->GetPoint()->Adjust(SwNodeOffset(1)); + if (m_pPam->HasMark()) + m_pPam->GetMark()->Adjust(SwNodeOffset(1)); + m_xDoc->GetNodes().Delete( rDelNode ); } } }