From 9adec94ae1a34c48da4d3bbb7bb4b58c0259b22c Mon Sep 17 00:00:00 2001 From: Thomas Benisch Date: Wed, 31 Jul 2002 07:40:21 +0000 Subject: #101837# fixed infinite loop in GetLabeledBy() --- vcl/source/window/dlgctrl.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'vcl/source/window/dlgctrl.cxx') diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index d12678c108e9..850311e45fdf 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgctrl.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: pl $ $Date: 2002-07-22 15:29:44 $ + * last change: $Author: tbe $ $Date: 2002-07-31 08:40:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1085,9 +1085,10 @@ Window* Window::GetLabeledBy() const } for( USHORT nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- ) { + USHORT nFoundIndex = 0; pSWindow = ::ImplGetChildWindow( ImplGetFrameWindow(), nSearchIndex, - nSearchIndex, + nFoundIndex, FALSE ); if( pSWindow && pSWindow->IsVisible() && ( pSWindow->GetType() == WINDOW_FIXEDTEXT || @@ -1097,6 +1098,8 @@ Window* Window::GetLabeledBy() const pWindow = pSWindow; break; } + if( nFoundIndex > nSearchIndex || nSearchIndex == 0 ) + break; } } } -- cgit v1.2.3