summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-08-22 21:21:19 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-09-06 12:08:41 +0200
commit5a7b392d004fe69afe3378a11458e2164ecd4106 (patch)
tree86505528e8ff8b341ead32a64857255cda9304a4
parent26ec2061fa3d96f1b1c77beab09537fb2f69f87a (diff)
sal_uInt16: constify, simplify, avoid temporaries
Change-Id: I4eaf9910eec073fad5dac6722661383253912c10
-rw-r--r--sw/source/core/txtnode/swfont.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index ee98443f1e0f..d7c57b72db2f 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -473,7 +473,7 @@ sal_uInt16 SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent ) const
const long nAscent = nOldAscent +
( (long) nOrgHeight * GetEscapement() ) / 100L;
if ( nAscent>0 )
- return ( std::max( sal_uInt16 (nAscent), nOrgAscent ));
+ return std::max<sal_uInt16>( nAscent, nOrgAscent );
}
return nOrgAscent;
}
@@ -1025,8 +1025,9 @@ sal_uInt16 SwSubFont::CalcEscHeight( const sal_uInt16 nOldHeight,
{
long nDescent = nOldHeight - nOldAscent -
( (long) nOrgHeight * GetEscapement() ) / 100L;
- const sal_uInt16 nDesc = ( nDescent>0 ) ? std::max ( sal_uInt16(nDescent),
- sal_uInt16(nOrgHeight - nOrgAscent) ) : nOrgHeight - nOrgAscent;
+ const sal_uInt16 nDesc = nDescent>0
+ ? std::max<sal_uInt16>( nDescent, nOrgHeight - nOrgAscent)
+ : nOrgHeight - nOrgAscent;
return ( nDesc + CalcEscAscent( nOldAscent ) );
}
return nOrgHeight;
@@ -1043,12 +1044,9 @@ short SwSubFont::_CheckKerning( )
sal_uInt16 SwSubFont::GetAscent( SwViewShell *pSh, const OutputDevice& rOut )
{
- sal_uInt16 nAscent;
SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh );
- nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut );
- if( GetEscapement() )
- nAscent = CalcEscAscent( nAscent );
- return nAscent;
+ const sal_uInt16 nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut );
+ return GetEscapement() ? CalcEscAscent( nAscent ) : nAscent;
}
sal_uInt16 SwSubFont::GetHeight( SwViewShell *pSh, const OutputDevice& rOut )
@@ -1414,7 +1412,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos )
{
long nOfst;
- sal_uInt16 nDir = UnMapDirection(
+ const sal_uInt16 nDir = UnMapDirection(
GetOrientation(), rInf.GetFrm() && rInf.GetFrm()->IsVertical() );
switch ( GetEscapement() )