Kaydet (Commit) 6b7c32ea authored tarafından Szymon Kłos's avatar Szymon Kłos Kaydeden (comit) Andras Timar

tdf#116536 Fix bullet position with linespacing > 100

Change-Id: I862246d9c69e754bdd883787fe42c7d61a1a53d3
Reviewed-on: https://gerrit.libreoffice.org/51790Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSzymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit 596fd41b)
Reviewed-on: https://gerrit.libreoffice.org/52148Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit e3bcaf13)
üst 1c7ff7be
...@@ -223,7 +223,7 @@ void Test::testLineSpacing() ...@@ -223,7 +223,7 @@ void Test::testLineSpacing()
// Check the first line // Check the first line
ParagraphInfos aInfo2 = aEditEngine.GetParagraphInfos(0); ParagraphInfos aInfo2 = aEditEngine.GetParagraphInfos(0);
CPPUNIT_ASSERT_EQUAL(sal_uInt16(311), aInfo2.nFirstLineMaxAscent); CPPUNIT_ASSERT_EQUAL(sal_uInt16(337), aInfo2.nFirstLineMaxAscent);
CPPUNIT_ASSERT_EQUAL(sal_uInt16(382), static_cast<sal_uInt16>(aEditEngine.GetLineHeight(0))); CPPUNIT_ASSERT_EQUAL(sal_uInt16(382), static_cast<sal_uInt16>(aEditEngine.GetLineHeight(0)));
} }
......
...@@ -1460,14 +1460,11 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) ...@@ -1460,14 +1460,11 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
else if ( rLSItem.GetPropLineSpace() && ( rLSItem.GetPropLineSpace() != 100 ) ) else if ( rLSItem.GetPropLineSpace() && ( rLSItem.GetPropLineSpace() != 100 ) )
{ {
sal_uInt16 nTxtHeight = pLine->GetHeight(); sal_uInt16 nTxtHeight = pLine->GetHeight();
sal_Int32 nTxtHeightProp = nTxtHeight * rLSItem.GetPropLineSpace() / 100; sal_Int32 nPropTextHeight = nTxtHeight * rLSItem.GetPropLineSpace() / 100;
sal_Int32 nHeightProp = pLine->GetHeight() * rLSItem.GetPropLineSpace() / 100;
// The Ascent has to be adjusted for the difference: // The Ascent has to be adjusted for the difference:
long nDiff = ( pLine->GetHeight() - nTxtHeightProp ) * 4 / 5; long nDiff = pLine->GetHeight() - nPropTextHeight;
if ( nDiff > pLine->GetMaxAscent() ) pLine->SetMaxAscent( static_cast<sal_uInt16>( pLine->GetMaxAscent() - nDiff ) );
nDiff = pLine->GetMaxAscent() * 4 / 5; pLine->SetHeight( static_cast<sal_uInt16>( nPropTextHeight ), nTxtHeight );
pLine->SetMaxAscent( static_cast<sal_uInt16>( pLine->GetMaxAscent() - nDiff ) ); // 80%
pLine->SetHeight( static_cast<sal_uInt16>( nHeightProp ), nTxtHeightProp );
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment