sw/source/core/txtnode/fntcache.cxx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
New commits: commit 3bcbec1fd0ba9953d445a4076114e4c6d027e45f Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Dec 21 12:10:39 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Dec 21 20:18:38 2021 +0100 move variable to where its set Change-Id: Iff9c47766f325a382198311392c087b2ee150711 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127245 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index e055d8ce3d39..ec871eacb73a 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1487,7 +1487,6 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) bBullet = false; std::vector<sal_Int32> aKernArray; CreateScrFont( *rInf.GetShell(), rInf.GetOut() ); - tools::Long nScrPos; // get screen array std::vector<sal_Int32> aScrArray; @@ -1592,7 +1591,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) } } - nScrPos = aScrArray[ 0 ]; + tools::Long nScrPos = aScrArray[ 0 ]; if( bBullet ) { commit e240ce9a491e2f99d4a00e61a86a1fa46f44d75d Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Dec 21 12:03:57 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Dec 21 20:18:22 2021 +0100 format these two related blocks the same no logic change intended Change-Id: I0bb7f2c5f8ec1c2ff7c8af14f5a62f77411660d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127244 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index faf31191c7e8..e055d8ce3d39 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1689,7 +1689,6 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) for (sal_Int32 i = 1; i < sal_Int32(nCnt); ++i, nKernSum += rInf.GetKern()) { sal_Unicode nCh = rInf.GetText()[sal_Int32(rInf.GetIdx()) + i]; - tools::Long nScr = aScrArray[ i ] - aScrArray[ i - 1 ]; // If there is an (ex-)Space before us, position optimally, @@ -1697,16 +1696,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) // if we _are_ an ex-Space, position us left-aligned to the // printer position. if ( nCh == CH_BLANK ) - { nScrPos = aKernArray[i-1] + nScr; - } else { - if ( cChPrev == CH_BLANK ) - { - nScrPos = aKernArray[i-1] + nScr; - } - else if ( cChPrev == '-' ) + if (cChPrev == CH_BLANK || cChPrev == '-') nScrPos = aKernArray[i-1] + nScr; else { @@ -2049,11 +2042,11 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) sal_Unicode nCh = rInf.GetText()[ sal_Int32(rInf.GetIdx()) + i ]; tools::Long nScr = aScrArray[ i ] - aScrArray[ i - 1 ]; if ( nCh == CH_BLANK ) - nScrPos = aKernArray[i-1]+nScr; + nScrPos = aKernArray[i-1] + nScr; else { if ( nChPrev == CH_BLANK || nChPrev == '-' ) - nScrPos = aKernArray[i-1]+nScr; + nScrPos = aKernArray[i-1] + nScr; else { nScrPos += nScr;