summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/fntcache.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-12-21 11:55:09 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-12-21 20:17:32 +0100
commit224a400f7c46548a22060659e74e33db2a02f5a0 (patch)
tree6846295157cfa9975333b64520d2d4116a8c0cfd /sw/source/core/txtnode/fntcache.cxx
parent535c91ea75d154d1f8c5905ef747dd982e565c67 (diff)
split out the block where we add extra space from the kerning adjustment block
so the two independent things are seperated from eachother no logic change intended Change-Id: I55532b58974077286a6b062144eb4872d2c40328 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127243 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/txtnode/fntcache.cxx')
-rw-r--r--sw/source/core/txtnode/fntcache.cxx27
1 files changed, 19 insertions, 8 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 6aa92c330b8f..7fb66120e7e8 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1699,7 +1699,25 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( nCh == CH_BLANK )
{
nScrPos = aKernArray[i-1] + nScr;
+ }
+ else
+ {
+ if ( cChPrev == CH_BLANK )
+ {
+ nScrPos = aKernArray[i-1] + nScr;
+ }
+ else if ( cChPrev == '-' )
+ nScrPos = aKernArray[i-1] + nScr;
+ else
+ {
+ nScrPos += nScr;
+ nScrPos = ( nMul * nScrPos + aKernArray[i] ) / nDiv;
+ }
+ }
+ // Apply SpaceSum
+ if ( nCh == CH_BLANK )
+ {
if ( cChPrev == CH_BLANK )
nSpaceSum += nOtherHalf;
if (i + 1 == sal_Int32(nCnt))
@@ -1711,18 +1729,11 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
{
if ( cChPrev == CH_BLANK )
{
- nScrPos = aKernArray[i-1] + nScr;
// no Pixel is lost:
nSpaceSum += nOtherHalf;
}
- else if ( cChPrev == '-' )
- nScrPos = aKernArray[i-1] + nScr;
- else
- {
- nScrPos += nScr;
- nScrPos = ( nMul * nScrPos + aKernArray[i] ) / nDiv;
- }
}
+
cChPrev = nCh;
aKernArray[i-1] = nScrPos - nScr + nKernSum + nSpaceSum;
// In word line mode and for Arabic, we disabled the half space trick. If a portion