diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-06-01 20:40:15 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-06-14 16:19:05 +0200 |
commit | 2cb3a977a797ddece91a20c5a6798403b9d5fde9 (patch) | |
tree | 9eccef65b39103498849be6f7fd385284b728ab5 /sw | |
parent | bf60a61695e017c10873be15fc4fbae6dc87db9d (diff) |
sw_redlinehide: SwXFlatParagraphIterator::getNextPara() iterate ...
... the MergedPara here.
Change-Id: I1a76c9d4a13277987218426a787b5b1b421d36ea
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unoflatpara.cxx | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 425e894e60ac..a39cf00dee4c 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -39,6 +39,7 @@ #include <unotextrange.hxx> #include <pagefrm.hxx> #include <cntfrm.hxx> +#include <txtfrm.hxx> #include <rootfrm.hxx> #include <poolfmt.hxx> #include <pagedesc.hxx> @@ -396,16 +397,46 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara() while( pCnt && pCurrentPage->IsAnLower( pCnt ) ) { - SwTextNode* pTextNode = pCnt->GetNode()->GetTextNode(); - - if ( pTextNode && - ((mnType == text::TextMarkupType::SPELLCHECK && - pTextNode->IsWrongDirty()) || - (mnType == text::TextMarkupType::PROOFREADING && - pTextNode->IsGrammarCheckDirty())) ) + if (pCnt->IsTextFrame()) { - pRet = pTextNode; - break; + SwTextFrame const*const pText(static_cast<SwTextFrame const*>(pCnt)); + if (sw::MergedPara const*const pMergedPara = pText->GetMergedPara() + ) + { + SwTextNode * pTextNode(nullptr); + for (auto const& e : pMergedPara->extents) + { + if (e.pNode != pTextNode) + { + pTextNode = e.pNode; + if ((mnType == text::TextMarkupType::SPELLCHECK + && pTextNode->IsWrongDirty()) || + (mnType == text::TextMarkupType::PROOFREADING + && pTextNode->IsGrammarCheckDirty())) + { + pRet = pTextNode; + break; + } + } + } + } + else + { + SwTextNode const*const pTextNode(pText->GetTextNodeFirst()); + if ((mnType == text::TextMarkupType::SPELLCHECK + && pTextNode->IsWrongDirty()) || + (mnType == text::TextMarkupType::PROOFREADING + && pTextNode->IsGrammarCheckDirty())) + + { + pRet = const_cast<SwTextNode*>(pTextNode); + } + } + + if (pRet) + { + break; + } } pCnt = pCnt->GetNextContentFrame(); |