summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-21 11:15:01 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-12-07 13:08:56 +0100
commit3a1839f8c92e3c759fc4e91713bd5dea93c59871 (patch)
treea56bb04105b5251ffbd42042fcea7eec4cccc738
parent44e3444ec0d5e6fc71c7cc6beb61c3cedc16fbd6 (diff)
sw_redlinehide_4a: fix the number handling in SwEditShell::GetScriptType()
This is really to complicated & should be simplified, but while it seems reasonable to assume that a frame always exists (or that nodes without frames should be skipped), there needs to be a way to update a SwScriptInfo if it turns out to be invalid... Change-Id: I185733c2e1e93b0c4d2453eeb3ea48cd4b9b6779 (cherry picked from commit 025ebb415e7dd2d91e6be7b3a913ef78dca7c9a6)
-rw-r--r--sw/source/core/edit/edattr.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index b2c2eab75197..678363ccad81 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -599,15 +599,15 @@ static bool lcl_IsNoEndTextAttrAtPos(SwRootFrame const& rLayout,
if ( bNum )
{
bRet = false;
-
- if (sw::IsParaPropsNode(rLayout, rTNd) && rTNd.IsInList())
+ SwTextNode const*const pPropsNode(sw::GetParaPropsNode(rLayout, rTNd));
+ if (pPropsNode->IsInList())
{
- OSL_ENSURE( rTNd.GetNumRule(),
+ OSL_ENSURE( pPropsNode->GetNumRule(),
"<lcl_IsNoEndTextAttrAtPos(..)> - no list style found at text node. Serious defect." );
- const SwNumRule* pNumRule = rTNd.GetNumRule();
+ const SwNumRule* pNumRule = pPropsNode->GetNumRule();
if(pNumRule)
{
- int nListLevel = rTNd.GetActualListLevel();
+ int nListLevel = pPropsNode->GetActualListLevel();
if (nListLevel < 0)
nListLevel = 0;
@@ -621,7 +621,7 @@ static bool lcl_IsNoEndTextAttrAtPos(SwRootFrame const& rLayout,
if ( SVX_NUM_CHAR_SPECIAL == rNumFormat.GetNumberingType() )
sExp = OUString(rNumFormat.GetBulletChar());
else
- sExp = rTNd.GetNumString();
+ sExp = pPropsNode->GetNumString(true, MAXLEVEL, &rLayout);
}
}
}
@@ -741,6 +741,9 @@ SvtScriptType SwEditShell::GetScriptType() const
if (nEndPos > rText.getLength())
nEndPos = rText.getLength();
+ bool const isUntilEnd(pScriptInfo
+ ? pFrame->MapViewToModelPos(TextFrameIndex(pFrame->GetText().getLength())) <= *pEnd
+ : rText.getLength() == nEndPos);
sal_uInt16 nScript;
while( nChg < nEndPos )
{
@@ -753,8 +756,10 @@ SvtScriptType SwEditShell::GetScriptType() const
rText, nChg );
if (!lcl_IsNoEndTextAttrAtPos(*GetLayout(), *pTNd, nChg, nRet, true,
- 0 == nChg && rText.getLength() == nEndPos))
+ TextFrameIndex(0) == iChg && isUntilEnd))
+ {
nRet |= lcl_SetScriptFlags( nScript );
+ }
if( (SvtScriptType::LATIN | SvtScriptType::ASIAN |
SvtScriptType::COMPLEX) == nRet )