summaryrefslogtreecommitdiff
path: root/vcl/source/window/dlgctrl.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-16 14:14:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-16 17:04:57 +0200
commit5b554b31827ca378e1ff8beef8d4a9fef539bf4d (patch)
treea98983c198b160072a9282e198a08eb585427223 /vcl/source/window/dlgctrl.cxx
parent469e3b5d9f0d4b118ca9237b79401a2b1152eb7d (diff)
coverity#1440300 rework to silence Using invalid iterator
Change-Id: Icf887a54f0e999c633e4e3f514086c29842427fc Reviewed-on: https://gerrit.libreoffice.org/61835 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window/dlgctrl.cxx')
-rw-r--r--vcl/source/window/dlgctrl.cxx21
1 files changed, 12 insertions, 9 deletions
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)