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/sqlmessage.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/sqlmessage.cxx')
-rw-r--r-- | dbaccess/source/ui/dlg/sqlmessage.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index e7f8811da03e..490b2d014a70 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -326,13 +326,11 @@ OExceptionChainDialog::OExceptionChainDialog(vcl::Window* pParent, const Excepti bool bHave22018 = false; size_t elementPos = 0; - for ( ExceptionDisplayChain::const_iterator loop = m_aExceptions.begin(); - loop != m_aExceptions.end(); - ++loop, ++elementPos - ) + for (auto const& elem : m_aExceptions) { - lcl_insertExceptionEntry( *m_pExceptionList, elementPos, *loop ); - bHave22018 = loop->sSQLState == "22018"; + lcl_insertExceptionEntry(*m_pExceptionList, elementPos, elem); + bHave22018 = elem.sSQLState == "22018"; + ++elementPos; } // if the error has the code 22018, then add an additional explanation @@ -575,12 +573,9 @@ void OSQLMessageBox::impl_addDetailsButton() { // even if the text fits into what we can display, we might need to details button // if there is more non-trivial information in the errors than the mere messages - for ( ExceptionDisplayChain::const_iterator error = m_pImpl->aDisplayInfo.begin(); - error != m_pImpl->aDisplayInfo.end(); - ++error - ) + for (auto const& error : m_pImpl->aDisplayInfo) { - if ( lcl_hasDetails( *error ) ) + if ( lcl_hasDetails(error) ) { bMoreDetailsAvailable = true; break; |