sw/inc/pam.hxx | 2 +- sw/source/filter/ww8/ww8par5.cxx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
New commits: commit 06767a5394f1dfba71c4f0a2a07daa5664bdbd01 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Wed Oct 9 14:31:43 2019 +0200 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Thu Oct 10 12:52:20 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> 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 cddefb0002da..e39d0416c431 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -532,6 +532,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