diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-08-16 19:50:56 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-09-03 10:58:34 +0200 |
commit | 1632f2a42eaf4c6bdcea9616b3ebc324ecdc30a3 (patch) | |
tree | 24105ed7877480f4c94c7a7b1b6feef2db7c2e24 /vcl/source | |
parent | fd81523328891c69ee7cb28bf22308225da42744 (diff) |
SalLayout GetTextWidth return DeviceCoordinate
Change-Id: I5b995e54992213e95845e60169238270863e9a7e
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index de39d873788c..471d298de687 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -916,24 +916,23 @@ DeviceCoordinate GenericSalLayout::FillDXArray( DeviceCoordinate* pCharWidths ) if( !GetCharWidths( pCharWidths ) ) return 0; - long nWidth = GetTextWidth(); - return nWidth; + return GetTextWidth(); } // the text width is the maximum logical extent of all glyphs -long GenericSalLayout::GetTextWidth() const +DeviceCoordinate GenericSalLayout::GetTextWidth() const { if( m_GlyphItems.empty() ) return 0; // initialize the extent - long nMinPos = 0; - long nMaxPos = 0; + DeviceCoordinate nMinPos = 0; + DeviceCoordinate nMaxPos = 0; for( GlyphVector::const_iterator pG = m_GlyphItems.begin(), end = m_GlyphItems.end(); pG != end ; ++pG ) { // update the text extent with the glyph extent - long nXPos = pG->maLinearPos.X(); + DeviceCoordinate nXPos = pG->maLinearPos.X(); if( nMinPos > nXPos ) nMinPos = nXPos; nXPos += pG->mnNewWidth - pG->mnXOffset; @@ -941,7 +940,7 @@ long GenericSalLayout::GetTextWidth() const nMaxPos = nXPos; } - long nWidth = nMaxPos - nMinPos; + DeviceCoordinate nWidth = nMaxPos - nMinPos; return nWidth; } @@ -1081,10 +1080,10 @@ void GenericSalLayout::ApplyDXArray( ImplLayoutArgs& rArgs ) } } -void GenericSalLayout::Justify( long nNewWidth ) +void GenericSalLayout::Justify( DeviceCoordinate nNewWidth ) { nNewWidth *= mnUnitsPerPixel; - int nOldWidth = GetTextWidth(); + DeviceCoordinate nOldWidth = GetTextWidth(); if( !nOldWidth || nNewWidth==nOldWidth ) return; |