summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-03-09 14:48:49 +0100
committerAndras Timar <andras.timar@collabora.com>2018-03-13 14:08:45 +0100
commit3b05be050d4cadfa37e7e4db052ba2e070d0bbc1 (patch)
treea0c3d9ad21099ba971f85d3ee718615f68e46a49 /editeng/source
parent641d763caeb1c6c554569927f245261e0c6c7a06 (diff)
tdf#116101 Correct bullet position for linespacing > 100%
Change-Id: Ia900636d4013ab2a9c893c8246391db867fe1543 Reviewed-on: https://gerrit.libreoffice.org/51017 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/51167 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/editeng/impedit3.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index e021aac81082..01050ab5d3c8 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1416,15 +1416,14 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
else if ( rLSItem.GetPropLineSpace() && ( rLSItem.GetPropLineSpace() != 100 ) )
{
sal_uInt16 nTxtHeight = pLine->GetHeight();
- sal_Int32 nH = nTxtHeight;
- nH *= rLSItem.GetPropLineSpace();
- nH /= 100;
+ sal_Int32 nTxtHeightProp = nTxtHeight * rLSItem.GetPropLineSpace() / 100;
+ sal_Int32 nHeightProp = pLine->GetHeight() * rLSItem.GetPropLineSpace() / 100;
// The Ascent has to be adjusted for the difference:
- long nDiff = pLine->GetHeight() - nH;
+ long nDiff = ( pLine->GetHeight() - nTxtHeightProp ) * 4 / 5;
if ( nDiff > pLine->GetMaxAscent() )
- nDiff = pLine->GetMaxAscent();
- pLine->SetMaxAscent( (sal_uInt16)( pLine->GetMaxAscent() - nDiff ) * 4 / 5 ); // 80%
- pLine->SetHeight( (sal_uInt16)nH, nTxtHeight );
+ nDiff = pLine->GetMaxAscent() * 4 / 5;
+ pLine->SetMaxAscent( static_cast<sal_uInt16>( pLine->GetMaxAscent() - nDiff ) ); // 80%
+ pLine->SetHeight( static_cast<sal_uInt16>( nHeightProp ), nTxtHeightProp );
}
}
}