Kaydet (Commit) 5a7b392d authored tarafından Matteo Casalin's avatar Matteo Casalin

sal_uInt16: constify, simplify, avoid temporaries

Change-Id: I4eaf9910eec073fad5dac6722661383253912c10
üst 26ec2061
...@@ -473,7 +473,7 @@ sal_uInt16 SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent ) const ...@@ -473,7 +473,7 @@ sal_uInt16 SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent ) const
const long nAscent = nOldAscent + const long nAscent = nOldAscent +
( (long) nOrgHeight * GetEscapement() ) / 100L; ( (long) nOrgHeight * GetEscapement() ) / 100L;
if ( nAscent>0 ) if ( nAscent>0 )
return ( std::max( sal_uInt16 (nAscent), nOrgAscent )); return std::max<sal_uInt16>( nAscent, nOrgAscent );
} }
return nOrgAscent; return nOrgAscent;
} }
...@@ -1025,8 +1025,9 @@ sal_uInt16 SwSubFont::CalcEscHeight( const sal_uInt16 nOldHeight, ...@@ -1025,8 +1025,9 @@ sal_uInt16 SwSubFont::CalcEscHeight( const sal_uInt16 nOldHeight,
{ {
long nDescent = nOldHeight - nOldAscent - long nDescent = nOldHeight - nOldAscent -
( (long) nOrgHeight * GetEscapement() ) / 100L; ( (long) nOrgHeight * GetEscapement() ) / 100L;
const sal_uInt16 nDesc = ( nDescent>0 ) ? std::max ( sal_uInt16(nDescent), const sal_uInt16 nDesc = nDescent>0
sal_uInt16(nOrgHeight - nOrgAscent) ) : nOrgHeight - nOrgAscent; ? std::max<sal_uInt16>( nDescent, nOrgHeight - nOrgAscent)
: nOrgHeight - nOrgAscent;
return ( nDesc + CalcEscAscent( nOldAscent ) ); return ( nDesc + CalcEscAscent( nOldAscent ) );
} }
return nOrgHeight; return nOrgHeight;
...@@ -1043,12 +1044,9 @@ short SwSubFont::_CheckKerning( ) ...@@ -1043,12 +1044,9 @@ short SwSubFont::_CheckKerning( )
sal_uInt16 SwSubFont::GetAscent( SwViewShell *pSh, const OutputDevice& rOut ) sal_uInt16 SwSubFont::GetAscent( SwViewShell *pSh, const OutputDevice& rOut )
{ {
sal_uInt16 nAscent;
SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh ); SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh );
nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); const sal_uInt16 nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut );
if( GetEscapement() ) return GetEscapement() ? CalcEscAscent( nAscent ) : nAscent;
nAscent = CalcEscAscent( nAscent );
return nAscent;
} }
sal_uInt16 SwSubFont::GetHeight( SwViewShell *pSh, const OutputDevice& rOut ) sal_uInt16 SwSubFont::GetHeight( SwViewShell *pSh, const OutputDevice& rOut )
...@@ -1414,7 +1412,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) ...@@ -1414,7 +1412,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos )
{ {
long nOfst; long nOfst;
sal_uInt16 nDir = UnMapDirection( const sal_uInt16 nDir = UnMapDirection(
GetOrientation(), rInf.GetFrm() && rInf.GetFrm()->IsVertical() ); GetOrientation(), rInf.GetFrm() && rInf.GetFrm()->IsVertical() );
switch ( GetEscapement() ) switch ( GetEscapement() )
......
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