sw/inc/pam.hxx                   |    2 +-
 sw/source/filter/ww8/ww8par5.cxx |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 15955a47ffc8bd0414630ed2a56049d21aaababc
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Wed Oct 9 14:31:43 2019 +0200
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Oct 11 11:37:14 2019 +0200

    sw: WW8: do not create fieldmark with start in frame and end in body
    
    Actually the start and end must have the same start node; presumably
    CheckNodesRange(..., true) does that.
    
    Change-Id: I04b34b593a4383b565289254bdb756d95c2b7916
    Reviewed-on: https://gerrit.libreoffice.org/80594
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 06767a5394f1dfba71c4f0a2a07daa5664bdbd01)
    Reviewed-on: https://gerrit.libreoffice.org/80625
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 202d28f79400..dac13d9637e7 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -277,7 +277,7 @@ public:
 
 SW_DLLPUBLIC std::ostream &operator <<(std::ostream& s, const SwPaM& pam);
 
-bool CheckNodesRange( const SwNodeIndex&, const SwNodeIndex&, bool bChkSection 
);
+SW_DLLPUBLIC bool CheckNodesRange(const SwNodeIndex&, const SwNodeIndex&, bool 
bChkSection);
 
 #endif // INCLUDED_SW_INC_PAM_HXX
 
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 13144f9bccac..914ada2dc3be 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -531,6 +531,12 @@ sal_uInt16 SwWW8ImplReader::End_Field()
         case 70:
         if (bUseEnhFields && m_pPaM!=nullptr && m_pPaM->GetPoint()!=nullptr) {
             SwPosition aEndPos = *m_pPaM->GetPoint();
+            if (!::CheckNodesRange(m_aFieldStack.back().GetPtNode(),
+                        aEndPos.nNode, true))
+            {   // example ofz7322-1.doc
+                SAL_INFO("sw.ww8", "skipping field with invalid node range");
+                break;
+            }
             SwPaM aFieldPam( m_aFieldStack.back().GetPtNode(), 
m_aFieldStack.back().GetPtContent(), aEndPos.nNode, 
aEndPos.nContent.GetIndex());
             IDocumentMarkAccess* pMarksAccess = m_rDoc.getIDocumentMarkAccess( 
);
             IFieldmark *pFieldmark = pMarksAccess->makeFieldBookmark(
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to