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:31 +0100
commitc59f03b33abaacf82672f4276356e7ce75223bbb (patch)
tree2b701dad60ddb88d85f7733f31cf695454f73ce1 /editeng/source
parent6a5f15d2b35a5a6e3ae0a1fa534facfe7e92bb3c (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/51217 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 75e400ae98da..6f9f133a6807 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 );
}
}
}