From 45b470be8809a6cc08a58031af7c3cfe75a13311 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 6 Nov 2018 16:57:15 +0100 Subject: sw_redlinehide_3: adapt SwEditShell::GetScriptType() Change-Id: Iffb09b9145b72a1ac8710e41a0a7d7ad3abe5c33 --- sw/source/core/edit/edattr.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 197b22e821bb..98366e1b8f0f 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -565,7 +565,8 @@ static SvtScriptType lcl_SetScriptFlags( sal_uInt16 nType ) } } -static bool lcl_IsNoEndTextAttrAtPos( const SwTextNode& rTNd, sal_Int32 nPos, +static bool lcl_IsNoEndTextAttrAtPos(SwRootFrame const& rLayout, + const SwTextNode& rTNd, sal_Int32 const nPos, SvtScriptType &rScrpt, bool bInSelection, bool bNum ) { bool bRet = false; @@ -576,7 +577,7 @@ static bool lcl_IsNoEndTextAttrAtPos( const SwTextNode& rTNd, sal_Int32 nPos, { bRet = false; - if ( rTNd.IsInList() ) + if (sw::IsParaPropsNode(rLayout, rTNd) && rTNd.IsInList()) { OSL_ENSURE( rTNd.GetNumRule(), " - no list style found at text node. Serious defect." ); @@ -686,7 +687,7 @@ SvtScriptType SwEditShell::GetScriptType() const else nScript = SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() ); - if( !lcl_IsNoEndTextAttrAtPos( *pTNd, nPos, nRet, false, false )) + if (!lcl_IsNoEndTextAttrAtPos(*GetLayout(), *pTNd, nPos, nRet, false, false)) nRet |= lcl_SetScriptFlags( nScript ); } } @@ -728,7 +729,7 @@ SvtScriptType SwEditShell::GetScriptType() const g_pBreakIt->GetBreakIter()->getScriptType( rText, nChg ); - if( !lcl_IsNoEndTextAttrAtPos( *pTNd, nChg, nRet, true, + if (!lcl_IsNoEndTextAttrAtPos(*GetLayout(), *pTNd, nChg, nRet, true, 0 == nChg && rText.getLength() == nEndPos)) nRet |= lcl_SetScriptFlags( nScript ); -- cgit v1.2.3