[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - editeng/qa editeng/source

Szymon Kłos szymon.klos at collabora.com
Wed Apr 11 21:49:33 UTC 2018


 editeng/qa/unit/core-test.cxx       |    2 +-
 editeng/source/editeng/impedit3.cxx |   11 ++++-------
 2 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 4661cd9d17e3f2dc619cb888efde54eb6cf5219a
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Fri Mar 23 19:51:37 2018 +0100

    tdf#116536 Fix bullet position with linespacing > 100
    
    Change-Id: I862246d9c69e754bdd883787fe42c7d61a1a53d3
    Reviewed-on: https://gerrit.libreoffice.org/51790
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    (cherry picked from commit 596fd41b9b19e28bab0c84e3821f79cb5d468f24)
    Reviewed-on: https://gerrit.libreoffice.org/52149
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 65be718d67bc..80284cda452c 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -198,7 +198,7 @@ void Test::testLineSpacing()
 
     // Check the first line
     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)));
 }
 
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index b1cc81eeafe0..cbb9d8a37877 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1415,14 +1415,11 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
                 else if ( rLSItem.GetPropLineSpace() && ( rLSItem.GetPropLineSpace() != 100 ) )
                 {
                     sal_uInt16 nTxtHeight = pLine->GetHeight();
-                    sal_Int32 nTxtHeightProp = nTxtHeight * rLSItem.GetPropLineSpace() / 100;
-                    sal_Int32 nHeightProp = pLine->GetHeight() * rLSItem.GetPropLineSpace() / 100;
+                    sal_Int32 nPropTextHeight = nTxtHeight * rLSItem.GetPropLineSpace() / 100;
                     // The Ascent has to be adjusted for the difference:
-                    long nDiff = ( pLine->GetHeight() - nTxtHeightProp ) * 4 / 5;
-                    if ( nDiff > pLine->GetMaxAscent() )
-                        nDiff = pLine->GetMaxAscent() * 4 / 5;
-                    pLine->SetMaxAscent( static_cast<sal_uInt16>( pLine->GetMaxAscent() - nDiff ) ); // 80%
-                    pLine->SetHeight( static_cast<sal_uInt16>( nHeightProp ), nTxtHeightProp );
+                    long nDiff = pLine->GetHeight() - nPropTextHeight;
+                    pLine->SetMaxAscent( static_cast<sal_uInt16>( pLine->GetMaxAscent() - nDiff ) );
+                    pLine->SetHeight( static_cast<sal_uInt16>( nPropTextHeight ), nTxtHeight );
                 }
             }
         }


More information about the Libreoffice-commits mailing list