Kaydet (Commit) aa511f1d authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide: convert SwSubFont::DrawText_ to static SwScriptInfo

Change-Id: I7bdcb5f787b6a82def4f7ca5aca29a16b6881e38
üst c323ed0a
...@@ -1213,20 +1213,23 @@ void SwSubFont::DrawText_( SwDrawTextInfo &rInf, const bool bGrey ) ...@@ -1213,20 +1213,23 @@ void SwSubFont::DrawText_( SwDrawTextInfo &rInf, const bool bGrey )
long nSpace = 0; long nSpace = 0;
if( rInf.GetSpace() ) if( rInf.GetSpace() )
{ {
sal_Int32 nTmpEnd = nOldIdx + nOldLen; TextFrameIndex nTmpEnd = nOldIdx + nOldLen;
if (nTmpEnd > oldStr.getLength()) if (nTmpEnd > TextFrameIndex(oldStr.getLength()))
nTmpEnd = oldStr.getLength(); nTmpEnd = TextFrameIndex(oldStr.getLength());
const SwScriptInfo* pSI = rInf.GetScriptInfo(); const SwScriptInfo* pSI = rInf.GetScriptInfo();
const bool bAsianFont = const bool bAsianFont =
( rInf.GetFont() && SwFontScript::CJK == rInf.GetFont()->GetActual() ); ( rInf.GetFont() && SwFontScript::CJK == rInf.GetFont()->GetActual() );
for( sal_Int32 nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp ) for (TextFrameIndex nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp)
{ {
if (CH_BLANK == oldStr[nTmp] || bAsianFont || if (CH_BLANK == oldStr[sal_Int32(nTmp)] || bAsianFont ||
( nTmp + 1 < oldStr.getLength() && pSI && (nTmp + TextFrameIndex(1) < TextFrameIndex(oldStr.getLength())
i18n::ScriptType::ASIAN == pSI->ScriptType( nTmp + 1 ) ) ) && pSI
&& i18n::ScriptType::ASIAN == pSI->ScriptType(nTmp + TextFrameIndex(1))))
{
++nSpace; ++nSpace;
}
} }
// if next portion if a hole portion we do not consider any // if next portion if a hole portion we do not consider any
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment