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

2018-04-10 Thread Szymon Kłos
 editeng/qa/unit/core-test.cxx   |2 +-
 editeng/source/editeng/impedit3.cxx |   11 ---
 2 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit e3bcaf133db6c78b0a7baeada6f7692a12e07cb2
Author: Szymon Kłos 
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 
Reviewed-by: Szymon Kłos 
(cherry picked from commit 596fd41b9b19e28bab0c84e3821f79cb5d468f24)
Reviewed-on: https://gerrit.libreoffice.org/52148
Reviewed-by: Miklos Vajna 

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 5e18be53aa17..b16781ff9441 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -218,7 +218,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(aEditEngine.GetLineHeight(0)));
 }
 
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 7058233308ee..352386410d5f 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1460,14 +1460,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( 
pLine->GetMaxAscent() - nDiff ) ); // 80%
-pLine->SetHeight( static_cast( nHeightProp ), 
nTxtHeightProp );
+long nDiff = pLine->GetHeight() - nPropTextHeight;
+pLine->SetMaxAscent( static_cast( 
pLine->GetMaxAscent() - nDiff ) );
+pLine->SetHeight( static_cast( nPropTextHeight 
), nTxtHeight );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-13 Thread Szymon Kłos
 editeng/qa/unit/core-test.cxx   |4 ++--
 editeng/source/editeng/impedit3.cxx |   13 ++---
 2 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 97dd69362dc4924cf837843bc949ba8ffec0d063
Author: Szymon Kłos 
Date:   Fri Mar 9 14:48:49 2018 +0100

tdf#116101 Correct bullet position for linespacing > 100%

Change-Id: Ia900636d4013ab2a9c893c8246391db867fe1543
Reviewed-on: https://gerrit.libreoffice.org/51017
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/51086
Reviewed-by: Andras Timar 

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index c65b1c2f391e..5e18be53aa17 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -218,8 +218,8 @@ 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)382, 
(sal_uInt16)aEditEngine.GetLineHeight(0));
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(311), aInfo2.nFirstLineMaxAscent);
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(382), 
static_cast(aEditEngine.GetLineHeight(0)));
 }
 
 void Test::testConstruction()
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index f1afb90ea0b8..7058233308ee 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1460,15 +1460,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( 
pLine->GetMaxAscent() - nDiff ) ); // 80%
+pLine->SetHeight( static_cast( nHeightProp ), 
nTxtHeightProp );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits