diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-09-13 21:13:16 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-09-14 07:02:39 +0200 |
commit | 94e5443c05f3ed47d51465b91d5312a7d010b716 (patch) | |
tree | d535e4ae914ab0552907d56b552f9cc6cbee1f83 | |
parent | 8c20d5d4ad6f3e8c672337e3ba67be45a1ccb7c2 (diff) |
Fix warning out-of-range value from the DatasourceType selection
Fix warn:dbaccess.ui.generalpage:19437:19437:dbaccess/source/ui/dlg/generalpage.cxx:405:
Got out-of-range value '2147483647' from the DatasourceType selection ListBox's GetSelectedEntryPos():
no corresponding URL prefix
Just Launch Base and select "Open an existing database file" and see this log
If there's nothing to display, we get 2147483647 which corresponds to LISTBOX_ENTRY_NOTFOUND
Change-Id: Iaab680695d9816c6375d9ef04f02845890f99dda
Reviewed-on: https://gerrit.libreoffice.org/60464
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Tested-by: Jenkins
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 129583a7f8e3..e3efcaaedaf3 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -400,6 +400,8 @@ namespace dbaui { // get the type from the entry data const sal_Int32 nSelected = _rBox.GetSelectedEntryPos(); + if ( nSelected == LISTBOX_ENTRY_NOTFOUND) + return; if (static_cast<size_t>(nSelected) >= m_aURLPrefixes.size() ) { SAL_WARN("dbaccess.ui.generalpage", "Got out-of-range value '" << nSelected << "' from the DatasourceType selection ListBox's GetSelectedEntryPos(): no corresponding URL prefix"); |