summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-08-31 14:35:49 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-09-06 12:12:26 +0200
commite24a3daf040410bd9fb2eb6cdd7095a659427441 (patch)
tree1ca2d9907f6fba626e380a75551d3ce64807e0b4
parentdc925031190414ecf0fc09afb5b7e2ecfe7df95e (diff)
Use more proper types, constify, avoid unneeded conversions
Change-Id: I7f1f587c39b9221363e90aea2cf7ed468ce5aac0
-rw-r--r--sw/source/core/text/pormulti.cxx22
-rw-r--r--sw/source/core/text/pormulti.hxx2
2 files changed, 12 insertions, 12 deletions
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index ebd76e1e4a65..8aa72f74f382 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -103,7 +103,7 @@ void SwMultiPortion::CalcSize( SwTxtFormatter& rLine, SwTxtFormatInfo &rInf )
sal_uInt16 nTmp = ((SwDoubleLinePortion*)this)->GetBrackets()->nHeight;
if( nTmp > Height() )
{
- sal_uInt16 nAdd = ( nTmp - Height() ) / 2;
+ const sal_uInt16 nAdd = ( nTmp - Height() ) / 2;
GetRoot().SetAscent( GetRoot().GetAscent() + nAdd );
GetRoot().Height( GetRoot().Height() + nAdd );
Height( nTmp );
@@ -329,7 +329,7 @@ void SwDoubleLinePortion::PaintBracket( SwTxtPaintInfo &rInf,
sal_Unicode cCh = bOpen ? pBracket->cPre : pBracket->cPost;
if( !cCh )
return;
- sal_uInt16 nChWidth = bOpen ? PreWidth() : PostWidth();
+ const sal_uInt16 nChWidth = bOpen ? PreWidth() : PostWidth();
if( !nChWidth )
return;
if( !bOpen )
@@ -411,7 +411,7 @@ void SwDoubleLinePortion::FormatBrackets( SwTxtFormatInfo &rInf, SwTwips& nMaxWi
pTmpFnt->SetActual( pBracket->nPostScript );
SwFontSave aSave( rInf, pTmpFnt );
SwPosSize aSize = rInf.GetTxtSize( aStr );
- sal_uInt16 nTmpAsc = rInf.GetAscent();
+ const sal_uInt16 nTmpAsc = rInf.GetAscent();
if( nTmpAsc > pBracket->nAscent )
{
pBracket->nHeight += nTmpAsc - pBracket->nAscent;
@@ -637,7 +637,7 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo &rInf )
}
sal_uInt16 nLeft = 0; // the space in front of the first letter
sal_uInt16 nRight = 0; // the space at the end of the last letter
- sal_uInt16 nSub = 0;
+ sal_Int32 nSub = 0;
switch ( nAdjustment )
{
case 1: nRight = static_cast<sal_uInt16>(nLineDiff / 2); // no break
@@ -1304,8 +1304,8 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
// old values must be saved and restored at the end
sal_Int32 nOldLen = GetInfo().GetLen();
- sal_uInt16 nOldX = sal_uInt16(GetInfo().X());
- long nOldY = GetInfo().Y();
+ const SwTwips nOldX = GetInfo().X();
+ const SwTwips nOldY = GetInfo().Y();
sal_Int32 nOldIdx = GetInfo().GetIdx();
SwSpaceManipulator aManip( GetInfo(), rMulti );
@@ -1338,7 +1338,7 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
GetInfo().SetIdx( nTmpOldIdx );
}
- sal_uInt16 nTmpX = sal_uInt16(GetInfo().X());
+ const SwTwips nTmpX = GetInfo().X();
SwLineLayout* pLay = &rMulti.GetRoot();// the first line of the multiportion
SwLinePortion* pPor = pLay->GetFirstPortion();//first portion of these line
@@ -1624,14 +1624,14 @@ bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
SwMultiPortion& rMulti )
{
SwTwips nMaxWidth = rInf.Width();
- sal_uInt16 nOldX = 0;
+ SwTwips nOldX = 0;
if( rMulti.HasBrackets() )
{
sal_Int32 nOldIdx = rInf.GetIdx();
rInf.SetIdx( ((SwDoubleLinePortion&)rMulti).GetBrackets()->nStart );
SeekAndChg( rInf );
- nOldX = sal_uInt16(GetInfo().X());
+ nOldX = GetInfo().X();
((SwDoubleLinePortion&)rMulti).FormatBrackets( rInf, nMaxWidth );
rInf.SetIdx( nOldIdx );
}
@@ -2254,7 +2254,7 @@ SwTxtCursorSave::SwTxtCursorSave( SwTxtCursor* pTxtCursor,
{
bSpaceChg = pMulti->ChgSpaceAdd( pTxtCursor->pCurr, nSpaceAdd );
- sal_uInt16 nSpaceCnt;
+ sal_Int32 nSpaceCnt;
if ( pMulti->IsDouble() )
{
pTxtCursor->SetPropFont( 50 );
@@ -2284,7 +2284,7 @@ SwTxtCursorSave::~SwTxtCursorSave()
{
if( bSpaceChg )
SwDoubleLinePortion::ResetSpaceAdd( pTxtCrsr->pCurr );
- pTxtCrsr->pCurr->Width( sal_uInt16(nWidth) );
+ pTxtCrsr->pCurr->Width( nWidth );
pTxtCrsr->pCurr = pCurr;
pTxtCrsr->nStart = nStart;
pTxtCrsr->SetPropFont( nOldProp );
diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx
index ca6d8045e0e3..850d323b1d7c 100644
--- a/sw/source/core/text/pormulti.hxx
+++ b/sw/source/core/text/pormulti.hxx
@@ -236,8 +236,8 @@ class SwTxtCursorSave
{
SwTxtCursor* pTxtCrsr;
SwLineLayout* pCurr;
- SwTwips nWidth;
sal_Int32 nStart;
+ sal_uInt16 nWidth;
sal_uInt8 nOldProp;
bool bSpaceChg;
public: