[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Aug 13 13:36:55 UTC 2018


 sw/source/filter/ww8/ww8par2.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 8e7620584ff81813f97d24192d01830834fece4d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 13 12:55:45 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Aug 13 15:36:34 2018 +0200

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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);
     }


More information about the Libreoffice-commits mailing list