diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2013-12-08 22:30:28 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-09 09:01:00 +0000 |
commit | 02ce734450559c9353ca7f42b2519239220dd265 (patch) | |
tree | 09f0960e2dd225324d37fd6bc6286db6125e7890 | |
parent | 56211a166ab25d80de84c2cccce22be15a9be051 (diff) |
fdo#72488: Broken text when showing visible space
Turning on showing nonprinting characters replaces the space with bullet
character, but still draws the text with the original kern array, this
works fine until there are ligatures involving the space character as
the number of glyphs after replacing the space with the bullet will be
different and the kern array will be completely off.
This is a hack that gives up on replacing the space with a bullet when
its width is zero, not sure if it would interfere with other legitimate
uses.
Change-Id: I5ed17132ead7cd141a4e8b0372e37541c163be30
Reviewed-on: https://gerrit.libreoffice.org/6995
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 3ea5be795b7a..a1b0eebbd882 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1569,7 +1569,13 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) for( sal_Int32 i = 0; i < aStr.getLength(); ++i ) if( CH_BLANK == aStr[ i ] ) - aStr = aStr.replaceAt(i, 1, OUString(CH_BULLET)); + { + /* fdo#72488 Hack: try to see if the space is zero width + * and don't bother with inserting a bullet in this case. + */ + if (pKernArray[i + nCopyStart] != pKernArray[ i + nCopyStart + 1]) + aStr = aStr.replaceAt(i, 1, OUString(CH_BULLET)); + } } sal_Int32 nCnt = rInf.GetText().getLength(); |