diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-11 21:24:05 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-12 09:54:31 +0100 |
commit | ecf40304b494e1783c09a1a1d55fd6d11894b366 (patch) | |
tree | 0103e495f27f0fc1ce6461d3e8b4b480a2ce8baf | |
parent | f6206be27a8b9afbe682eb0e79f60a6c2eb4e3d4 (diff) |
ofz#6827 drop last anchor pos if it will be joined
Change-Id: Ib36b74b455f741d9dcccbdf244d21453837bda3c
Reviewed-on: https://gerrit.libreoffice.org/51093
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index eb4abe1770a3..bf213496b6d5 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2453,6 +2453,21 @@ bool SwWW8ImplReader::JoinNode(SwPaM &rPam, bool bStealAttr) if (bStealAttr) m_xCtrlStck->StealAttr(rPam.GetPoint()->nNode); + if (m_pLastAnchorPos.get()) + { + //If the last anchor pos is here, then clear the anchor pos. + //This "last anchor pos" is only used for fixing up the + //positions of things anchored to page breaks and here + //we are removing the last paragraph of a frame, so there + //cannot be a page break at this point so we can + //safely reset m_pLastAnchorPos to avoid any dangling + //SwIndex's pointing into the deleted paragraph + SwNodeIndex aLastAnchorPos(m_pLastAnchorPos->nNode); + SwNodeIndex aToBeJoined(aPref, 1); + if (aLastAnchorPos == aToBeJoined) + m_pLastAnchorPos.reset(); + } + pNode->JoinNext(); bRet = true; |