diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-05-23 14:29:42 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-06-08 21:51:31 +0200 |
commit | 4b41e73978920854a6898ec8de122cfd95de20f7 (patch) | |
tree | 9dc827ce8913264a8ec6627a87b9eee601c525bb /sw/source/core/edit/editsh.cxx | |
parent | e721f9582cdf285d0b42af841f679a70bcada636 (diff) |
sw_redlinehide: SwScriptInfo must be inited with MergedPara
Change-Id: Ie7c9e6aa960ec5d3ac90f1aef0ea6c2a7f7cb92b
Diffstat (limited to 'sw/source/core/edit/editsh.cxx')
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 2d206ba1d935..b5f8dbc1cee8 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -135,19 +135,27 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) if ( ! pSI ) { // seems to be an empty paragraph. - Point aPt; - SwContentFrame* pFrame = - static_cast<SwTextNode&>(rNode).getLayoutFrame( GetLayout(), &aPt, pTmpCursor->GetPoint(), - false ); + Point aPt; // why ??? + SwTextFrame *const pFrame = static_cast<SwTextFrame*>( + static_cast<SwTextNode&>(rNode).getLayoutFrame( + GetLayout(), &aPt, pTmpCursor->GetPoint(), false)); SwScriptInfo aScriptInfo; - aScriptInfo.InitScriptInfo( static_cast<SwTextNode&>(rNode), pFrame->IsRightToLeft() ); + aScriptInfo.InitScriptInfo(static_cast<SwTextNode&>(rNode), + pFrame->GetMergedPara(), pFrame->IsRightToLeft()); nLevel = aScriptInfo.DirType( nPrevPos ); } else { - if ( COMPLETE_STRING != pSI->GetInvalidityA() ) - pSI->InitScriptInfo( static_cast<SwTextNode&>(rNode) ); + if (TextFrameIndex(COMPLETE_STRING) != pSI->GetInvalidityA()) + { + // note: if pSI was found, there must be a frame + SwTextFrame *const pFrame = static_cast<SwTextFrame*>( + static_cast<SwTextNode&>(rNode).getLayoutFrame( + GetLayout(), nullptr, pTmpCursor->GetPoint(), false)); + // mystery why this doesn't use the other overload? + pSI->InitScriptInfo(static_cast<SwTextNode&>(rNode), pFrame->GetMergedPara()); + } nLevel = pSI->DirType( nPrevPos ); } |