summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-06-01 20:40:15 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-06-08 19:40:36 +0200
commit877315c9a3fea4420f6a42b86ae8bb087cf81c42 (patch)
tree5e18d8e4abf06d1142a81398f77e01438b3c6d88
parentdd26a21c950dccbc8537332424d88b9e35d0b64e (diff)
sw_redlinehide: SwXFlatParagraphIterator::getNextPara() iterate ...
... the MergedPara here. Change-Id: I1a76c9d4a13277987218426a787b5b1b421d36ea
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx49
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();