vcl/source/window/dlgctrl.cxx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
New commits: commit 5b554b31827ca378e1ff8beef8d4a9fef539bf4d Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Oct 16 14:14:08 2018 +0100 Commit: Caolán McNamara <caol...@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 <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits