diff options
author | Noel Grandin <noel@peralex.com> | 2014-05-02 15:42:25 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-05-05 12:47:48 +0200 |
commit | 4f9b21248ffdf55cef9f3f9d1da76778ee000775 (patch) | |
tree | b059d288339a68aa4c3901f1100e99b04d05a23d /vcl/unx/generic | |
parent | b4107411900f5bb4c215e2d9db09fc2b2b82939b (diff) |
simplify ternary conditions "xxx ? yyy : false"
Look for code like:
xxx ? yyy : false;
Which can be simplified to:
xxx && yyy
Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r-- | vcl/unx/generic/dtrans/X11_selection.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salvd.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/printer/ppdparser.cxx | 7 |
4 files changed, 5 insertions, 8 deletions
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index a476957b45ef..0d7889b51bb4 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -4023,7 +4023,7 @@ void SelectionManagerHolder::initialize( const Sequence< Any >& arguments ) thro sal_Bool SelectionManagerHolder::isDragImageSupported() throw(std::exception) { - return m_xRealDragSource.is() ? m_xRealDragSource->isDragImageSupported() : false; + return m_xRealDragSource.is() && m_xRealDragSource->isDragImageSupported(); } sal_Int32 SelectionManagerHolder::getDefaultCursor( sal_Int8 dragAction ) throw(std::exception) diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index bbc2b369fcbe..d99c406df8a8 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -113,7 +113,7 @@ X11SalGraphics::X11SalGraphics() #if ENABLE_GRAPHITE // check if graphite fonts have been disabled static const char* pDisableGraphiteStr = getenv( "SAL_DISABLE_GRAPHITE" ); - bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : false; + bDisableGraphite_ = pDisableGraphiteStr && (pDisableGraphiteStr[0]!='0'); #endif pBrushGC_ = NULL; diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx index 56aa036c8266..cd0d0b5c0aeb 100644 --- a/vcl/unx/generic/gdi/salvd.cxx +++ b/vcl/unx/generic/gdi/salvd.cxx @@ -156,7 +156,7 @@ bool X11SalVirtualDevice::Init( SalDisplay *pDisplay, pGraphics_->Init( this, pColormap, bDeleteColormap ); - return hDrawable_ != None ? true : false; + return hDrawable_ != None; } X11SalVirtualDevice::X11SalVirtualDevice() : diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index d51577dd029a..3a818d242a50 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -821,10 +821,7 @@ const PPDKey* PPDParser::getKey( const OUString& rKey ) const bool PPDParser::hasKey( const PPDKey* pKey ) const { - return - pKey ? - ( m_aKeys.find( pKey->getKey() ) != m_aKeys.end() ? true : false ) : - false; + return pKey && ( m_aKeys.find( pKey->getKey() ) != m_aKeys.end() ); } static sal_uInt8 getNibble( sal_Char cChar ) @@ -1676,7 +1673,7 @@ bool PPDContext::resetValue( const PPDKey* pKey, bool bDefaultable ) if( ! pResetValue && bDefaultable ) pResetValue = pKey->getDefaultValue(); - bool bRet = pResetValue ? ( setValue( pKey, pResetValue ) == pResetValue ? true : false ) : false; + bool bRet = pResetValue && ( setValue( pKey, pResetValue ) == pResetValue ); return bRet; } |