From 4f9b21248ffdf55cef9f3f9d1da76778ee000775 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 2 May 2014 15:42:25 +0200 Subject: simplify ternary conditions "xxx ? yyy : false" Look for code like: xxx ? yyy : false; Which can be simplified to: xxx && yyy Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d --- xmlsecurity/source/dialogs/certificateviewer.cxx | 4 ++-- xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'xmlsecurity/source/dialogs') diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index d43e4c05881f..296ac47c06e2 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -107,7 +107,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(mpDlg->mxCert, Sequence >()); - bool bCertValid = certStatus == css::security::CertificateValidity::VALID ? true : false; + bool bCertValid = certStatus == css::security::CertificateValidity::VALID; if ( !bCertValid ) { @@ -419,7 +419,7 @@ void CertificateViewerCertPathTP::ActivatePage() //Verify the certificate sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(rCert, Sequence >()); - bool bCertValid = certStatus == css::security::CertificateValidity::VALID ? true : false; + bool bCertValid = certStatus == css::security::CertificateValidity::VALID; pParent = InsertCert( pParent, sName, rCert, bCertValid); } diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 1e471d95cdb4..94a9ba8f0c23 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -348,7 +348,7 @@ short DigitalSignaturesDialog::Execute() IMPL_LINK_NOARG(DigitalSignaturesDialog, SignatureHighlightHdl) { - bool bSel = m_pSignaturesLB->FirstSelected() ? true : false; + bool bSel = m_pSignaturesLB->FirstSelected(); m_pViewBtn->Enable( bSel ); if ( m_pAddBtn->IsEnabled() ) // not read only m_pRemoveBtn->Enable( bSel ); @@ -612,7 +612,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() sal_Int32 certResult = xSecEnv->verifyCertificate(xCert, Sequence >()); - bCertValid = certResult == css::security::CertificateValidity::VALID ? true : false; + bCertValid = certResult == css::security::CertificateValidity::VALID; if ( bCertValid ) nValidCerts++; -- cgit