summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2013-12-08 22:30:28 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-12-09 16:50:30 +0000
commitb79b4b88c5eb6b0fe4092b5eb98f3088f316f7b2 (patch)
treeb35685cbf35194ffc5003d9c30b8174f3bf2287d /sw
parent37ed490fd7bfef1863b26d0f791cba1a04811459 (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: I3803a2097b7c9dab1fb53b24404e8550c5bf537e Reviewed-on: https://gerrit.libreoffice.org/7005 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/txtnode/fntcache.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 80b2ea8e6249..0857604c137d 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1531,7 +1531,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));
+ }
}
xub_StrLen nCnt = rInf.GetText().getLength();