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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 16 15:05:46 UTC 2018


 vcl/source/window/dlgctrl.cxx |   21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

New commits:
commit 5b554b31827ca378e1ff8beef8d4a9fef539bf4d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Oct 16 14:14:08 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Oct 16 17:04:57 2018 +0200

    coverity#1440300 rework to silence Using invalid iterator
    
    Change-Id: Icf887a54f0e999c633e4e3f514086c29842427fc
    Reviewed-on: https://gerrit.libreoffice.org/61835
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index c46106f7665e..ccfb6a17c840 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -538,17 +538,20 @@ namespace
             ++aI;
 
         aI = std::find_if(aI, rGroup.end(), isSuitableDestination);
-        if (aI == rGroup.end())
+        if (aI != rGroup.end())
         {
-            aI = std::find_if(rGroup.begin(), aStart, isSuitableDestination);
-            if (aI == aStart)
-                return false;
+            vcl::Window *pWindow = *aI;
+            pWindow->ImplControlFocus( GetFocusFlags::CURSOR | GetFocusFlags::Forward );
+            return true;
         }
-
-        vcl::Window *pWindow = *aI;
-
-        pWindow->ImplControlFocus( GetFocusFlags::CURSOR | GetFocusFlags::Forward );
-        return true;
+        aI = std::find_if(rGroup.begin(), aStart, isSuitableDestination);
+        if (aI != aStart)
+        {
+            vcl::Window *pWindow = *aI;
+            pWindow->ImplControlFocus( GetFocusFlags::CURSOR | GetFocusFlags::Forward );
+            return true;
+        }
+        return false;
     }
 
     bool nextInGroup(RadioButton *pSourceWindow, bool bBackward)


More information about the Libreoffice-commits mailing list