summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-11 21:24:05 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-12 12:43:00 +0100
commit1a6dceee2ac1e334804de31fb6c387a41706b1c4 (patch)
tree993b92625d0c724043d027d2a4310e697d0c705e /sw
parent1dfb747f3c12881f54c2c826eaf0aaa938883a54 (diff)
ofz#6827 drop last anchor pos if it will be joined
Change-Id: Ib36b74b455f741d9dcccbdf244d21453837bda3c Reviewed-on: https://gerrit.libreoffice.org/51099 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 3678807b542f..1d88c6fac4e8 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2438,6 +2438,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;