diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-05-04 10:47:12 +0900 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-05-06 14:41:26 +0000 |
commit | 7d8b03256e851f2436c05a56df5f3f61c957ff70 (patch) | |
tree | 8553710dd1a0e45891fb0b3359dc12db3e08917a /dbaccess/source/ui/tabledesign/TableController.cxx | |
parent | f1097c868afe618d99f13c28418d5df23983601d (diff) |
dbaccess: simplify code by using std::any_of/std::none_of
Change-Id: I03ed512ba20206ed38428efe324f54f79abe1933
Reviewed-on: https://gerrit.libreoffice.org/15616
Tested-by: Jenkins <ci@libreoffice.org>
Tested-by: David Tardon <dtardon@redhat.com>
Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx')
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index bb7df8cd65f8..8c7bb1fe3b46 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -197,18 +197,16 @@ FeatureState OTableController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = impl_isModified(); if ( aReturn.bEnabled ) { - ::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aIter = ::std::find_if(m_vRowList.begin(),m_vRowList.end(), - ::boost::mem_fn(&OTableRow::isValid)); - aReturn.bEnabled = aIter != m_vRowList.end(); + aReturn.bEnabled = ::std::any_of(m_vRowList.begin(),m_vRowList.end(), + ::boost::mem_fn(&OTableRow::isValid)); } break; case ID_BROWSER_SAVEASDOC: aReturn.bEnabled = isConnected() && isEditable(); if ( aReturn.bEnabled ) { - ::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aIter = ::std::find_if(m_vRowList.begin(),m_vRowList.end(), - ::boost::mem_fn(&OTableRow::isValid)); - aReturn.bEnabled = aIter != m_vRowList.end(); + aReturn.bEnabled = ::std::any_of(m_vRowList.begin(),m_vRowList.end(), + ::boost::mem_fn(&OTableRow::isValid)); } break; @@ -230,9 +228,8 @@ FeatureState OTableController::GetState(sal_uInt16 _nId) const ); if ( aReturn.bEnabled ) { - ::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aIter = ::std::find_if(m_vRowList.begin(),m_vRowList.end(), - ::boost::mem_fn(&OTableRow::isValid)); - aReturn.bEnabled = aIter != m_vRowList.end(); + aReturn.bEnabled = ::std::any_of(m_vRowList.begin(),m_vRowList.end(), + ::boost::mem_fn(&OTableRow::isValid)); } break; default: @@ -559,9 +556,8 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti bool bCheck = true; if ( isModified() ) { - ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aIter = ::std::find_if(m_vRowList.begin(),m_vRowList.end(), - ::boost::mem_fn(&OTableRow::isValid)); - if ( aIter != m_vRowList.end() ) + if ( ::std::any_of(m_vRowList.begin(),m_vRowList.end(), + ::boost::mem_fn(&OTableRow::isValid)) ) { ScopedVclPtrInstance<MessageDialog> aQry(getView(), "TableDesignSaveModifiedDialog", "dbaccess/ui/tabledesignsavemodifieddialog.ui"); |