[Libreoffice-commits] core.git: editeng/qa editeng/source

Szymon Kłos szymon.klos at collabora.com
Fri Mar 9 15:45:42 UTC 2018


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

New commits:
commit 4b59a110ddd1f02cfa0f677c68c6ef0ee1f3295d
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Fri Mar 9 14:48:49 2018 +0100

    tdf#116101 Correct position for linespacing > 100%
    
    Change-Id: Ia3d90d521e03ed59312d1603b2cf5e5680b00781
    Reviewed-on: https://gerrit.libreoffice.org/51005
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 44d3e7a7a82d..7e1ccef61824 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -226,7 +226,7 @@ void Test::testLineSpacing()
 
     // Check the first line
     ParagraphInfos aInfo2 = aEditEngine.GetParagraphInfos(0);
-    CPPUNIT_ASSERT_EQUAL(sal_uInt16(269), aInfo2.nFirstLineMaxAscent);
+    CPPUNIT_ASSERT_EQUAL(sal_uInt16(295), 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 cbb8c2b3d3d9..01eb56b577fd 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1467,7 +1467,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
                     long nDiff = pLine->GetHeight() - nH;
                     if ( nDiff > pLine->GetMaxAscent() )
                         nDiff = pLine->GetMaxAscent();
-                    pLine->SetMaxAscent( static_cast<sal_uInt16>( pLine->GetMaxAscent() - nDiff ) * 4 / 5 ); // 80%
+                    pLine->SetMaxAscent( static_cast<sal_uInt16>( pLine->GetMaxAscent() * 4 / 5 - nDiff ) ); // 80%
                     pLine->SetHeight( static_cast<sal_uInt16>(nH), nTxtHeight );
                 }
             }


More information about the Libreoffice-commits mailing list