diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-10-12 16:31:31 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-10 19:47:00 +0100 |
commit | a761b1a661fd8068084f9cd74d47b9b8016740de (patch) | |
tree | 373c0e60898774b6bb07f45a81dd0d9e7ec7025e | |
parent | 3e2f36f773f1c0dd492aa84f0971e7838b2488a5 (diff) |
sw_redlinehide_3: fix SwAttrIter::SeekFwd()
This never called Rst() in the loops because the m_nPosition wasn't updated.
Change-Id: I5a9cf47d9fe6d92bb7fccf255acbbd22f04b7f47
-rw-r--r-- | sw/source/core/text/itratr.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/text/itratr.hxx | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 7e1c7e4e1bfb..d1c0141cca5b 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -260,7 +260,7 @@ bool SwAttrIter::SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFo } // AMA: New AttrIter Nov 94 -void SwAttrIter::SeekFwd( const sal_Int32 nNewPos ) +void SwAttrIter::SeekFwd(const sal_Int32 nOldPos, const sal_Int32 nNewPos) { SwpHints const*const pHints(m_pTextNode->GetpSwpHints()); SwTextAttr *pTextAttr; @@ -276,7 +276,7 @@ void SwAttrIter::SeekFwd( const sal_Int32 nNewPos ) { // Close the TextAttributes, whose StartPos were before or at // the old nPos and are currently open - if (pTextAttr->GetStart() <= m_nPosition) Rst( pTextAttr ); + if (pTextAttr->GetStart() <= nOldPos) Rst( pTextAttr ); m_nEndIndex++; } } @@ -320,14 +320,15 @@ bool SwAttrIter::Seek(TextFrameIndex const nNewPos) sal_Int32 nPos(m_nPosition); do { + sal_Int32 const nOldPos(nPos); nPos = GetNextAttrImpl(m_pTextNode, m_nStartIndex, m_nEndIndex, nPos); if (nPos <= m_pTextNode->Len()) { - SeekFwd(nPos); + SeekFwd(nOldPos, nPos); } else { - SeekFwd(m_pTextNode->Len()); + SeekFwd(nOldPos, m_pTextNode->Len()); } } while (nPos < m_pTextNode->Len()); @@ -399,21 +400,22 @@ bool SwAttrIter::Seek(TextFrameIndex const nNewPos) sal_Int32 nPos(m_nPosition); do { + sal_Int32 const nOldPos(nPos); nPos = GetNextAttrImpl(m_pTextNode, m_nStartIndex, m_nEndIndex, nPos); if (nPos <= newPos.second) { - SeekFwd(nPos); + SeekFwd(nOldPos, nPos); } else { - SeekFwd(newPos.second); + SeekFwd(nOldPos, newPos.second); } } while (nPos < newPos.second); } else { - SeekFwd(newPos.second); + SeekFwd(m_nPosition, newPos.second); } } diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx index 99741c87b965..959436609608 100644 --- a/sw/source/core/text/itratr.hxx +++ b/sw/source/core/text/itratr.hxx @@ -63,7 +63,7 @@ private: const SwTextNode* m_pTextNode; sw::MergedPara const* m_pMergedPara; - void SeekFwd( const sal_Int32 nPos ); + void SeekFwd(sal_Int32 nOldPos, sal_Int32 nNewPos); void SetFnt( SwFont* pNew ) { m_pFont = pNew; } void InitFontAndAttrHandler(SwTextNode const& rTextNode, OUString const& rText, bool const* pbVertLayout); |