From 970e7d1bcd4ab70b5cf6e6be40b0d154973ee93e Mon Sep 17 00:00:00 2001 From: juha Date: Wed, 31 Mar 2010 14:21:30 +0000 Subject: [PATCH] Converter: Stay with the same unit after user cancels the search dir dialog. git-svn-id: trunk@24314 - --- converter/convertdelphi.pas | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/converter/convertdelphi.pas b/converter/convertdelphi.pas index cc9107fd9f..7cd44c65ca 100644 --- a/converter/convertdelphi.pas +++ b/converter/convertdelphi.pas @@ -663,14 +663,18 @@ begin try UnitDirDialog.InitialDir:=fOwnerConverter.fPrevSelectedPath; UnitDirDialog.Title:='All sub-directories will be scanned for unit files'; - if UnitDirDialog.Execute and Assigned(fOwnerConverter) then begin - fOwnerConverter.fPrevSelectedPath:=ExtractFilePath(UnitDirDialog.Filename); - // Add the new path to project if missing units are found. - fOwnerConverter.CacheUnitsInPath(UnitDirDialog.Filename); - TryAgain:=fOwnerConverter.DoMissingUnits(fMissingUnits)>0; - if TryAgain then - TryAgain:=fOwnerConverter.DoCaseErrorUnits(fMissingUnits, fUnitsToRename)>0; - end; + if UnitDirDialog.Execute then begin + if Assigned(fOwnerConverter) then begin + fOwnerConverter.fPrevSelectedPath:=ExtractFilePath(UnitDirDialog.Filename); + // Add the new path to project if missing units are found. + fOwnerConverter.CacheUnitsInPath(UnitDirDialog.Filename); + TryAgain:=fOwnerConverter.DoMissingUnits(fMissingUnits)>0; + if TryAgain then + TryAgain:=fOwnerConverter.DoCaseErrorUnits(fMissingUnits, fUnitsToRename)>0; + end; + end + else + TryAgain:=true; // User canceled. Stay with the same unit. finally UnitDirDialog.Free; end;