[Libreoffice-commits] core.git: dbaccess/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 14 05:03:03 UTC 2018


 dbaccess/source/ui/dlg/generalpage.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 94e5443c05f3ed47d51465b91d5312a7d010b716
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Thu Sep 13 21:13:16 2018 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Fri Sep 14 07:02:39 2018 +0200

    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 at mamane.lu>
    Tested-by: Jenkins

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");


More information about the Libreoffice-commits mailing list