diff options
author | Noel Grandin <noel@peralex.com> | 2013-12-04 11:26:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-12-04 11:29:14 +0200 |
commit | b273106226ab7e21f68b9e0470e8b28b27f6b726 (patch) | |
tree | fe92cf8be49dfe25692e40442654715cf5a10349 /vcl | |
parent | 79eab004dca8413cf99ea688291083df2d146230 (diff) |
convert OutputDevice::HasGlyphs from xub_StrLen->sal_Int32
Change-Id: Ic8f0ae3d263d6cb02e6faa7226db0241681fc45f
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 12 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index dc39598df9a8..ff17d68a6acf 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -7710,14 +7710,16 @@ sal_Bool OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const return sal_True; } -xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const OUString& rStr, - xub_StrLen nIndex, xub_StrLen nLen ) const +sal_Int32 OutputDevice::HasGlyphs( const Font& rTempFont, const OUString& rStr, + sal_Int32 nIndex, sal_Int32 nLen ) const { if( nIndex >= rStr.getLength() ) return nIndex; - sal_Int32 nEnd = nIndex + nLen; - if( nIndex+nLen > rStr.getLength() ) + sal_Int32 nEnd; + if( nLen == -1 ) nEnd = rStr.getLength(); + else + nEnd = std::min( rStr.getLength(), nIndex + nLen ); DBG_ASSERT( nIndex < nEnd, "StartPos >= EndPos?" ); DBG_ASSERT( nEnd <= rStr.getLength(), "String too short" ); @@ -7737,7 +7739,7 @@ xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const OUString& rStr, if( ! aFontCharMap.HasChar( rStr[i] ) ) return nIndex; - return STRING_LEN; + return -1; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 1ef62c1d36cb..2aa08ef09fc8 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -441,8 +441,7 @@ bool Window::ImplCheckUIFont( const Font& rFont ) aTestText += aButtonStr; } - const int nFirstChar = HasGlyphs( rFont, aTestText ); - const bool bUIFontOk = (nFirstChar >= aTestText.getLength()); + const bool bUIFontOk = ( HasGlyphs( rFont, aTestText ) == -1 ); return bUIFontOk; } |