diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-10-13 08:23:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-13 11:19:24 +0200 |
commit | 8f1f2ba78de1cd71447b6a387b701ebfb917df79 (patch) | |
tree | 348ec245f38a28a1b9beba2335def219cd81d6af | |
parent | 4ce92931bf406fb467934374af1188927f34a972 (diff) |
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.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
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 ); } } } |