[Libreoffice-commits] .: Branch 'libreoffice-3-6' - editeng/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Oct 1 10:23:38 PDT 2012
editeng/source/editeng/editdoc.hxx | 2 +-
editeng/source/editeng/impedit3.cxx | 17 +++++------------
2 files changed, 6 insertions(+), 13 deletions(-)
New commits:
commit 618795f83936a1d07ba3cd415f041b1698623bba
Author: Jan Holesovsky <kendy at suse.cz>
Date: Mon Sep 24 12:22:54 2012 -0400
n#707779: Fix overflowing of left margin value in editeng when negative.
Change-Id: I9d39a9cfacf07aa596d047aee66c71b5ac6008ec
(cherry picked from commit d953cc27fc5da5e612b1dc4c29707c09d17fc643)
Signed-off-by: Thorsten Behrens <tbehrens at suse.com>
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index a97fcec..d952e6a 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -535,7 +535,7 @@ public:
sal_uInt16 GetLen() const { return nEnd - nStart; }
sal_uInt16 GetStartPosX() const { return nStartPosX; }
- void SetStartPosX( sal_uInt16 start ) { nStartPosX = start; }
+ void SetStartPosX( long start ) { if (start > 0) nStartPosX = start; else nStartPosX = 0; }
Size CalcTextSize( ParaPortion& rParaPortion );
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 87cdda8..e4025ac 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1414,11 +1414,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY )
{
long n = ( nMaxLineWidth - aTextSize.Width() ) / 2;
n += nStartX; // Indentation is kept.
- if ( n > 0 )
- pLine->SetStartPosX( (sal_uInt16)n );
- else
- pLine->SetStartPosX( 0 );
-
+ pLine->SetStartPosX( n );
}
break;
case SVX_ADJUST_RIGHT:
@@ -1427,24 +1423,21 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY )
// the blank must not be displayed!
long n = nMaxLineWidth - aTextSize.Width();
n += nStartX; // Indentation is kept.
- if ( n > 0 )
- pLine->SetStartPosX( (sal_uInt16)n );
- else
- pLine->SetStartPosX( 0 );
+ pLine->SetStartPosX( n );
}
break;
case SVX_ADJUST_BLOCK:
{
bool bDistLastLine = (GetJustifyMethod(nPara) == SVX_JUSTIFY_METHOD_DISTRIBUTE);
long nRemainingSpace = nMaxLineWidth - aTextSize.Width();
- pLine->SetStartPosX( (sal_uInt16)nStartX );
+ pLine->SetStartPosX( nStartX );
if ( nRemainingSpace > 0 && (!bEOC || bDistLastLine) )
ImpAdjustBlocks( pParaPortion, pLine, nRemainingSpace );
}
break;
default:
{
- pLine->SetStartPosX( (sal_uInt16)nStartX ); // FI, LI
+ pLine->SetStartPosX( nStartX ); // FI, LI
}
break;
}
@@ -1467,7 +1460,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY )
if ( GetTextRanger() )
{
if ( nTextXOffset )
- pLine->SetStartPosX( (sal_uInt16) ( pLine->GetStartPosX() + nTextXOffset ) );
+ pLine->SetStartPosX( pLine->GetStartPosX() + nTextXOffset );
if ( nTextExtraYOffset )
{
pLine->SetHeight( (sal_uInt16) ( pLine->GetHeight() + nTextExtraYOffset ), 0, pLine->GetHeight() );
More information about the Libreoffice-commits
mailing list