IDE: delphi project converter: fixed changing uses section

git-svn-id: trunk@23781 -
This commit is contained in:
mattias 2010-02-24 21:57:50 +00:00
parent f6e63d473f
commit 523fc39684
2 changed files with 7 additions and 2 deletions

View File

@ -39,7 +39,7 @@ unit SourceChanger;
interface
{off $DEFINE CTDEBUG}
{$DEFINE CTDEBUG}
uses
Classes, SysUtils, FileProcs, CodeToolsStrConsts, CodeCache, BasicCodeTools,

View File

@ -75,15 +75,17 @@ begin
try
fSrcCache.BeginUpdate;
try
// these changes can be applied together without rescan
if not AddModeDelphiDirective then exit;
if not RemoveDFMResourceDirective then exit;
if not LowerCaseMainResourceDirective then exit;
if not AddLRSIncludeDirective then exit;
if not ConvertUsedUnits then exit;
if not fSrcCache.Apply then exit;
finally
fSrcCache.EndUpdate;
end;
if not ConvertUsedUnits then exit;
if not fSrcCache.Apply then exit;
Result:=mrOK;
except
Result:=JumpToCodetoolErrorAndAskToAbort(fAsk);
@ -130,12 +132,15 @@ begin
begin
exit;
end;
if not fSrcCache.Apply then exit;
end;
if fAddLRSCode then
begin
if not fCodeTool.AddUnitToMainUsesSection('LResources','',fSrcCache) then
begin
exit;
end;
end;
if not fCodeTool.RemoveUnitFromAllUsesSections('VARIANTS',fSrcCache) then
begin
exit;