diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-10-09 14:31:43 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-10-10 12:52:20 +0200 |
commit | 06767a5394f1dfba71c4f0a2a07daa5664bdbd01 (patch) | |
tree | 219c390ec714020ef7449529a8ffc20d4f0edead | |
parent | 0f18a52b0d4aab218f6a87c33508915b3b7d08b7 (diff) |
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.stahl@cib.de>
-rw-r--r-- | sw/inc/pam.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 6 |
2 files changed, 7 insertions, 1 deletions
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( |