summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-13 12:55:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-08-13 15:36:34 +0200
commit8e7620584ff81813f97d24192d01830834fece4d (patch)
treef3140291f5f58b9f895f332301c8e6d4fba9a42e /sw
parent3f9f000bbeefe38af1d5bad540bb070df034aac4 (diff)
ofz#9858 Bad-cast
use a SwUnoCursor for the LastAnchorPos around here Change-Id: I9b2b18e88aa0816e3386d7b95b4fd386d13af77f Reviewed-on: https://gerrit.libreoffice.org/58927 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index d3a694546758..d1378edf6aac 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -71,6 +71,7 @@
#include <frmatr.hxx>
#include <itabenum.hxx>
+#include <unocrsr.hxx>
#include <iostream>
#include <memory>
@@ -198,8 +199,12 @@ sal_uInt16 SwWW8ImplReader::End_Footnote()
sChar += OUStringLiteral1(pText->GetText()[--nPos]);
m_pPaM->SetMark();
--m_pPaM->GetMark()->nContent;
+ std::shared_ptr<SwUnoCursor> xLastAnchorCursor(m_pLastAnchorPos ? m_rDoc.CreateUnoCursor(*m_pLastAnchorPos) : nullptr);
+ m_pLastAnchorPos.reset();
m_rDoc.getIDocumentContentOperations().DeleteRange( *m_pPaM );
m_pPaM->DeleteMark();
+ if (xLastAnchorCursor)
+ m_pLastAnchorPos.reset(new SwPosition(*xLastAnchorCursor->GetPoint()));
SwFormatFootnote aFootnote(rDesc.meType == MAN_EDN);
pFN = pText->InsertItem(aFootnote, nPos, nPos);
}