diff options
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 13 |
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 ); } } } |