diff options
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/dtrans/X11_selection.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/generic/print/common_gfx.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/printer/ppdparser.cxx | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 605670ff3b7a..e0c257c45eb2 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -70,6 +70,7 @@ #include <comphelper/solarmutex.hxx> #include <cppuhelper/supportsservice.hxx> +#include <algorithm> #define DRAG_EVENT_MASK ButtonPressMask |\ ButtonReleaseMask |\ @@ -1932,12 +1933,12 @@ bool SelectionManager::handleSendPropertyNotify( XPropertyEvent const & rNotify IncrementalTransfer& rInc = inc_it->second; int nBytes = rInc.m_aData.getLength() - rInc.m_nBufferPos; - nBytes = (nBytes > m_nIncrementalThreshold) ? m_nIncrementalThreshold : nBytes; + nBytes = std::min(nBytes, m_nIncrementalThreshold); if( nBytes < 0 ) // sanity check nBytes = 0; #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "pushing %d bytes: \"%.*s\"...\n", - nBytes, nBytes > 32 ? 32 : nBytes, + nBytes, std::min(nBytes, 32), (const unsigned char*)rInc.m_aData.getConstArray()+rInc.m_nBufferPos ); #endif @@ -2939,7 +2940,7 @@ int SelectionManager::getXdndVersion( ::Window aWindow, ::Window& rProxy ) XFree( pBytes ); } - nVersion = nVersion > nXdndProtocolRevision ? nXdndProtocolRevision : nVersion; + nVersion = std::min<int>(nVersion, nXdndProtocolRevision); return nVersion; } diff --git a/vcl/unx/generic/print/common_gfx.cxx b/vcl/unx/generic/print/common_gfx.cxx index b0bad19cc41b..0bd2ffa2ea82 100644 --- a/vcl/unx/generic/print/common_gfx.cxx +++ b/vcl/unx/generic/print/common_gfx.cxx @@ -1029,7 +1029,7 @@ PrinterGfx::PSShowGlyph (const unsigned char nGlyphId) if( nLW == 0 ) nLW = maVirtualStatus.mnTextHeight; else - nLW = nLW < maVirtualStatus.mnTextHeight ? nLW : maVirtualStatus.mnTextHeight; + nLW = std::min(nLW, maVirtualStatus.mnTextHeight); psp::getValueOfDouble( pBuffer, static_cast<double>(nLW) / 30.0 ); } diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 8611141b424b..335b72db59de 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -143,7 +143,7 @@ namespace psp { OString aStr( pEnvLocale ); sal_Int32 nLen = aStr.getLength(); - aLoc.Language = OStringToOUString( aStr.copy( 0, nLen > 2 ? 2 : nLen ), RTL_TEXTENCODING_MS_1252 ); + aLoc.Language = OStringToOUString( aStr.copy( 0, std::min(nLen, 2) ), RTL_TEXTENCODING_MS_1252 ); if( nLen >=5 && aStr[2] == '_' ) aLoc.Country = OStringToOUString( aStr.copy( 3, 2 ), RTL_TEXTENCODING_MS_1252 ); else |