diff options
Diffstat (limited to 'sw/source/core/txtnode/fntcache.cxx')
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index b4a80b771d96..5b507f0d2b9a 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1353,7 +1353,11 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) { const OUString* pStr = &rInf.GetText(); OUString aStr; + + #ifndef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY OUString aBulletOverlay; + #endif + bool bBullet = rInf.GetBullet(); if( bSymbol ) bBullet = false; @@ -1479,9 +1483,26 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) aStr = rInf.GetText().copy( nCopyStart, nCopyLen ); pStr = &aStr; + #ifdef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY + for (sal_Int32 i = 0; i < aStr.getLength(); ++i) + { + if (CH_BLANK == aStr[i]) + { + /* fdo#72488 Hack: try to see if the space is zero width + * and don't bother with inserting a bullet in this case. + */ + if ((i + nCopyStart + 1 >= rInf.GetLen()) || + pKernArray[i + nCopyStart] != pKernArray[ i + nCopyStart + 1]) + { + aStr = aStr.replaceAt(i, 1, OUString(CH_BULLET)); + } + } + } + #else aBulletOverlay = rInf.GetText().copy( nCopyStart, nCopyLen ); for( sal_Int32 i = 0; i < aBulletOverlay.getLength(); ++i ) + { if( CH_BLANK == aBulletOverlay[ i ] ) { /* fdo#72488 Hack: try to see if the space is zero width @@ -1501,6 +1522,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) { aBulletOverlay = aBulletOverlay.replaceAt(i, 1, OUString(CH_BLANK)); } + } + #endif } sal_Int32 nCnt = rInf.GetText().getLength(); @@ -1724,6 +1747,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) rInf.GetOut().DrawTextArray( aPos, *pStr, pKernArray + nOffs, nTmpIdx + nOffs , nLen - nOffs ); + #ifndef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY if (bBullet) { rInf.GetOut().Push(); @@ -1747,6 +1771,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) pTmpFont->SetStrikeout(aPreviousStrikeout); rInf.GetOut().Pop(); } + #endif } } delete[] pScrArray; |