diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-18 08:27:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-18 09:46:28 +0200 |
commit | 5fb66ae5595b7435e8954df31473fad15a74b8c2 (patch) | |
tree | 3b3f0ce3eafa10557a7e78b10851c97ee16c7ebf /vcl | |
parent | 181a1b36ac728e3a43e054496ceb53fd3315abdb (diff) |
clang-tidy readability-simplify-boolean-expr
Change-Id: I78fa01a6c803dec782488490b730af3a11814d64
Reviewed-on: https://gerrit.libreoffice.org/61902
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 20 | ||||
-rw-r--r-- | vcl/source/outdev/textline.cxx | 10 | ||||
-rw-r--r-- | vcl/unx/generic/app/i18n_ic.cxx | 8 |
4 files changed, 12 insertions, 34 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index b701185d6c3a..b15446522b35 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -357,13 +357,9 @@ bool TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) bool TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent ) { - if( rKeyEvent.GetCharCode() >= 32 && rKeyEvent.GetCharCode() != 127 && + return rKeyEvent.GetCharCode() >= 32 && rKeyEvent.GetCharCode() != 127 && KEY_MOD1 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) && // (ssa) #i45714#: - KEY_MOD2 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) ) // check for Ctrl and Alt separately - { - return true; - } - return false; + KEY_MOD2 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT); // check for Ctrl and Alt separately } void TextEngine::ImpInitDoc() diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 150a85877809..d3496adc4f1e 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -5243,9 +5243,7 @@ bool PDFWriterImpl::emitCatalog() aLine.append( ">>\n" "endobj\n\n" ); - CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); - - return true; + return writeBuffer( aLine.getStr(), aLine.getLength() ); } #if HAVE_FEATURE_NSS @@ -5317,10 +5315,7 @@ bool PDFWriterImpl::emitSignature() aLine.append(" >>\nendobj\n\n" ); - if (!writeBuffer( aLine.getStr(), aLine.getLength() )) - return false; - - return true; + return writeBuffer( aLine.getStr(), aLine.getLength() ); } bool PDFWriterImpl::finalizeSignature() @@ -5393,8 +5388,7 @@ bool PDFWriterImpl::finalizeSignature() CHECK_RETURN( (osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, m_nSignatureContentOffset)) ); m_aFile.write(aCMSHexBuffer.getStr(), aCMSHexBuffer.getLength(), nWritten); - CHECK_RETURN( (osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, nOffset)) ); - return true; + return osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, nOffset); } #endif //HAVE_FEATURE_NSS @@ -5923,9 +5917,7 @@ bool PDFWriterImpl::emitTrailer() aLine.append( static_cast<sal_Int64>(nXRefOffset) ); aLine.append( "\n" "%%EOF\n" ); - CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); - - return true; + return writeBuffer( aLine.getStr(), aLine.getLength() ); } struct AnnotationSortEntry @@ -8861,9 +8853,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject ) aLine.append( " 0 R\n" ">>\n" "endobj\n\n" ); - CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); - - return true; + return writeBuffer( aLine.getStr(), aLine.getLength() ); } void PDFWriterImpl::writeJPG( JPGEmit& rObject ) diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index 2034a54beb8a..de65574e1ac9 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -41,13 +41,9 @@ bool OutputDevice::ImplIsUnderlineAbove( const vcl::Font& rFont ) if ( !rFont.IsVertical() ) return false; - if( (LANGUAGE_JAPANESE == rFont.GetLanguage()) || - (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage()) ) - { - // the underline is right for Japanese only - return true; - } - return false; + // the underline is right for Japanese only + return (LANGUAGE_JAPANESE == rFont.GetLanguage()) || + (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage()); } void OutputDevice::ImplInitTextLineSize() diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx index 5dc4f6c435b3..87c84b5c44ef 100644 --- a/vcl/unx/generic/app/i18n_ic.cxx +++ b/vcl/unx/generic/app/i18n_ic.cxx @@ -468,12 +468,8 @@ SalI18N_InputContext::GetWeightingOfIMStyle( XIMStyle nStyle ) bool SalI18N_InputContext::IsSupportedIMStyle( XIMStyle nStyle ) const { - if ( (nStyle & mnSupportedPreeditStyle) - && (nStyle & g_nSupportedStatusStyle) ) - { - return true; - } - return false; + return (nStyle & mnSupportedPreeditStyle) + && (nStyle & g_nSupportedStatusStyle); } bool |