[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/source
Khaled Hosny
khaledhosny at eglug.org
Mon Dec 9 08:50:38 PST 2013
sw/source/core/txtnode/fntcache.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 8351eb25302a28c70ef5b2aaa1189db949dcf443
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Sun Dec 8 22:30:28 2013 +0200
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: If5a929dd6acffe018dc26f15ba31c9f91294d256
Reviewed-on: https://gerrit.libreoffice.org/7004
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 0f882dc..0ccbbc6 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();
More information about the Libreoffice-commits
mailing list