diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-03-09 23:27:25 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-03-10 09:44:56 +0100 |
commit | 5b2fc10f0cc9f15525c7723764a1feebeceb0d5e (patch) | |
tree | 1d4159a006696d3072dc98fc989c3fbd58e32b7a /dbaccess/source/ui/dlg/indexfieldscontrol.cxx | |
parent | 7c693fc3f7218e1ca0c85a0de76ae84226391256 (diff) |
Modernize a bit more dbaccess
mainly by using for-range loops
but also by simplifying some simple algo
Change-Id: If04cd78e62f80f9575e24f3d50ff1e427454da79
Reviewed-on: https://gerrit.libreoffice.org/51019
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'dbaccess/source/ui/dlg/indexfieldscontrol.cxx')
-rw-r--r-- | dbaccess/source/ui/dlg/indexfieldscontrol.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index 1dfa36a4cea4..377913d832e7 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -165,13 +165,11 @@ namespace dbaui { // do not just copy the array, we may have empty field names (which should not be copied) _rFields.resize(m_aFields.size()); - IndexFields::const_iterator aSource = m_aFields.begin(); - IndexFields::const_iterator aSourceEnd = m_aFields.end(); IndexFields::iterator aDest = _rFields.begin(); - for (; aSource != aSourceEnd; ++aSource) - if (!aSource->sFieldName.isEmpty()) + for (auto const& source : m_aFields) + if (!source.sFieldName.isEmpty()) { - *aDest = *aSource; + *aDest = source; ++aDest; } @@ -400,7 +398,7 @@ namespace dbaui else if (sSelectedEntry.isEmpty() && (nCurrentRow == rowCount - 2)) { // in the (last-1)th row, an empty entry has been selected // -> remove the last row - m_aFields.erase(m_aFields.end() - 1); + m_aFields.pop_back(); RowRemoved(GetRowCount() - 1); Invalidate(GetRowRectPixel(nCurrentRow)); } |