diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-08-31 23:07:04 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-09-06 12:12:29 +0200 |
commit | 7ea772887bee9dde7aeb6fa3673496c7b44f525c (patch) | |
tree | 1278bf1b4adcd2d2ea78b51843de29964fe33592 | |
parent | bbf64c7802ad729082434abb03a5851b5e6b3bb0 (diff) |
Use arithmetic instead of while loop
Change-Id: I35738f09ec562815f74643a547505efb6d9a0bfe
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index e4bfb8527245..94156d55a581 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1699,10 +1699,8 @@ void SwTxtFormatter::CalcRealHeight( bool bNewLine ) const bool bRubyTop = ! pGrid->GetRubyTextBelow(); nLineHeight = nGridWidth + nRubyHeight; - const sal_uInt16 nLineDist = nLineHeight; - - while ( pCurr->Height() > nLineHeight ) - nLineHeight = nLineHeight + nLineDist; + const sal_uInt16 nAmpRatio = (pCurr->Height() + nLineHeight - 1)/nLineHeight; + nLineHeight *= nAmpRatio; const sal_uInt16 nAsc = pCurr->GetAscent() + ( bRubyTop ? |