diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:25:26 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:36:20 +0200 |
commit | 6cb8d552eb3cffbdad47a6e00f4c4b55e9497171 (patch) | |
tree | 6931c0d198cb7d564b88ef315ead3195b693f9c3 /dbaccess | |
parent | 4f4859b62ea5f72248a0daba88654a67108ebf6e (diff) |
loplugin:simplifybool
Change-Id: I77d80494ab99b4cd70f623798389f8dc35772d8a
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/RowSetBase.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlComponent.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppController.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppControllerDnD.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppDetailView.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/control/TableGrantCtrl.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbwiz.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbwizsetup.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WCPage.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinTableView.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/QueryDesignView.cxx | 2 |
11 files changed, 12 insertions, 13 deletions
diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 941d8802b4d9..09c98474f4c9 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -195,7 +195,7 @@ sal_Bool SAL_CALL ORowSetBase::wasNull( ) throw(SQLException, RuntimeException, bool ORowSetBase::impl_wasNull() { - return ((m_nLastColumnIndex != -1) && !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->is()) ? ((*m_aCurrentRow)->get())[m_nLastColumnIndex].isNull() : true; + return !((m_nLastColumnIndex != -1) && !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->is()) || ((*m_aCurrentRow)->get())[m_nLastColumnIndex].isNull(); } const ORowSetValue& ORowSetBase::getValue(sal_Int32 columnIndex) diff --git a/dbaccess/source/filter/xml/xmlComponent.cxx b/dbaccess/source/filter/xml/xmlComponent.cxx index 3fd01d4f5afa..9d0bfd65f25d 100644 --- a/dbaccess/source/filter/xml/xmlComponent.cxx +++ b/dbaccess/source/filter/xml/xmlComponent.cxx @@ -73,7 +73,7 @@ OXMLComponent::OXMLComponent( ODBFilter& rImport m_sName = m_sName.replace( '/', '_' ); break; case XML_TOK_AS_TEMPLATE: - m_bAsTemplate = (sValue == s_sTRUE ? true : false); + m_bAsTemplate = sValue == s_sTRUE; break; } } diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index f97686b12728..5b504edc7d89 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -589,7 +589,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const break; case ID_BROWSER_CUT: aReturn.bEnabled = !isDataSourceReadOnly() && getContainer()->getSelectionCount() >= 1; - aReturn.bEnabled = aReturn.bEnabled && ( (ID_BROWSER_CUT == _nId && getContainer()->getElementType() == E_TABLE) ? getContainer()->isCutAllowed() : true); + aReturn.bEnabled = aReturn.bEnabled && ( !(ID_BROWSER_CUT == _nId && getContainer()->getElementType() == E_TABLE) || getContainer()->isCutAllowed() ); break; case ID_BROWSER_PASTE: switch( getContainer()->getElementType() ) diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 39e4ecf1d85b..4f4da2f070d0 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -232,7 +232,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec || ( eResult == svtools::QUERYDELETE_YES ); if ( bUserConfirmedDelete - && ( ( _eType == E_QUERY ) ? m_pSubComponentManager->closeSubFrames( *aThisRound, _eType ) : true ) + && ( _eType != E_QUERY || m_pSubComponentManager->closeSubFrames( *aThisRound, _eType ) ) ) { try diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index 256f0ed61905..aebcd5d3d35d 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -639,9 +639,8 @@ void OApplicationDetailView::impl_createPage( ElementType _eType, const Referenc // enable the pane as a whole, depending on the availability of the first command OSL_ENSURE( !rData.aTasks.empty(), "OApplicationDetailView::impl_createPage: no tasks at all!?" ); - bool bEnabled = rData.aTasks.empty() - ? false - : getBorderWin().getView()->getCommandController().isCommandEnabled( rData.aTasks[0].sUNOCommand ); + bool bEnabled = !rData.aTasks.empty() + && getBorderWin().getView()->getCommandController().isCommandEnabled( rData.aTasks[0].sUNOCommand ); getTasksWindow().Enable( bEnabled ); m_aContainer.setTitle( rData.nTitleId ); diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index 68159f616baa..122f230d4afb 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -276,7 +276,7 @@ void OTableGrantControl::InitController( CellControllerRef& /*rController*/, lon { // get the privileges from the user TTablePrivilegeMap::const_iterator aFind = findPrivilege(nRow); - m_pCheckCell->GetBox().Check(aFind != m_aPrivMap.end() ? isAllowed(nColumnId,aFind->second.nRights) : false); + m_pCheckCell->GetBox().Check(aFind != m_aPrivMap.end() && isAllowed(nColumnId,aFind->second.nRights)); } } diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index 67ff416c3d0e..f39d0dba2454 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -288,7 +288,7 @@ TabPage* ODbTypeWizDialog::createPage(WizardState _nState) static_cast<OGenericAdministrationPage*>(pPage)->SetAdminDialog(this,this); pPage->SetText(ModuleRes(nStringId)); defaultButton( _nState == START_PAGE ? WZB_NEXT : WZB_FINISH ); - enableButtons( WZB_FINISH, _nState == START_PAGE ? false : true); + enableButtons( WZB_FINISH, _nState != START_PAGE); pPage->Show(); } return pPage; diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index e07d25477f79..6a9f3c814928 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -559,7 +559,7 @@ TabPage* ODbTypeWizDialogSetup::createPage(WizardState _nState) defaultButton( _nState == PAGE_DBSETUPWIZARD_FINAL ? WZB_FINISH : WZB_NEXT ); enableButtons( WZB_FINISH, _nState == PAGE_DBSETUPWIZARD_FINAL ); - enableButtons( WZB_NEXT, _nState == PAGE_DBSETUPWIZARD_FINAL ? false : true); + enableButtons( WZB_NEXT, _nState != PAGE_DBSETUPWIZARD_FINAL ); pPage->Show(); } return pPage; diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index b4056a4f354f..9856a3d8e185 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -150,7 +150,7 @@ IMPL_LINK( OCopyTable, KeyClickHdl, Button*, /*pButton*/ ) bool OCopyTable::LeavePage() { - m_pParent->m_bCreatePrimaryKeyColumn = (m_bPKeyAllowed && m_pCB_PrimaryColumn->IsEnabled()) ? m_pCB_PrimaryColumn->IsChecked() : false; + m_pParent->m_bCreatePrimaryKeyColumn = m_bPKeyAllowed && m_pCB_PrimaryColumn->IsEnabled() && m_pCB_PrimaryColumn->IsChecked(); m_pParent->m_aKeyName = m_pParent->m_bCreatePrimaryKeyColumn ? m_pEdKeyName->GetText() : OUString(); m_pParent->setUseHeaderLine( m_pCB_UseHeaderLine->IsChecked() ); diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index c26f187575d4..8b0c63d177b8 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -1183,7 +1183,7 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab if ((!pLhs || pLhs->ExistsAConn()) && (!pRhs || pRhs->ExistsAConn())) { - bool bFoundStart = _rpFirstAfter ? false : true; + bool bFoundStart = _rpFirstAfter == nullptr; ::std::vector<OTableConnection*>::const_iterator aIter = m_vTableConnection.begin(); ::std::vector<OTableConnection*>::const_iterator aEnd = m_vTableConnection.end(); diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 82e40213244c..dba71c0e72cb 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -1291,7 +1291,7 @@ namespace eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pChild,nLevel,bHaving,bAddOrOnOneLine); else { - eErrorCode = GetANDCriteria(_pView,_pSelectionBrw,pChild, nLevel,bHaving, i == 0 ? false : bAddOrOnOneLine); + eErrorCode = GetANDCriteria(_pView,_pSelectionBrw,pChild, nLevel,bHaving, i != 0 && bAddOrOnOneLine); if ( !bAddOrOnOneLine) nLevel++; } |