mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 16:25:59 +02:00
IDE: delphi project converter: fixed changing uses section
git-svn-id: trunk@23781 -
This commit is contained in:
parent
f6e63d473f
commit
523fc39684
@ -39,7 +39,7 @@ unit SourceChanger;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
{off $DEFINE CTDEBUG}
|
{$DEFINE CTDEBUG}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileProcs, CodeToolsStrConsts, CodeCache, BasicCodeTools,
|
Classes, SysUtils, FileProcs, CodeToolsStrConsts, CodeCache, BasicCodeTools,
|
||||||
|
@ -75,15 +75,17 @@ begin
|
|||||||
try
|
try
|
||||||
fSrcCache.BeginUpdate;
|
fSrcCache.BeginUpdate;
|
||||||
try
|
try
|
||||||
|
// these changes can be applied together without rescan
|
||||||
if not AddModeDelphiDirective then exit;
|
if not AddModeDelphiDirective then exit;
|
||||||
if not RemoveDFMResourceDirective then exit;
|
if not RemoveDFMResourceDirective then exit;
|
||||||
if not LowerCaseMainResourceDirective then exit;
|
if not LowerCaseMainResourceDirective then exit;
|
||||||
if not AddLRSIncludeDirective then exit;
|
if not AddLRSIncludeDirective then exit;
|
||||||
if not ConvertUsedUnits then exit;
|
|
||||||
if not fSrcCache.Apply then exit;
|
if not fSrcCache.Apply then exit;
|
||||||
finally
|
finally
|
||||||
fSrcCache.EndUpdate;
|
fSrcCache.EndUpdate;
|
||||||
end;
|
end;
|
||||||
|
if not ConvertUsedUnits then exit;
|
||||||
|
if not fSrcCache.Apply then exit;
|
||||||
Result:=mrOK;
|
Result:=mrOK;
|
||||||
except
|
except
|
||||||
Result:=JumpToCodetoolErrorAndAskToAbort(fAsk);
|
Result:=JumpToCodetoolErrorAndAskToAbort(fAsk);
|
||||||
@ -130,12 +132,15 @@ begin
|
|||||||
begin
|
begin
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
if not fSrcCache.Apply then exit;
|
||||||
end;
|
end;
|
||||||
if fAddLRSCode then
|
if fAddLRSCode then
|
||||||
|
begin
|
||||||
if not fCodeTool.AddUnitToMainUsesSection('LResources','',fSrcCache) then
|
if not fCodeTool.AddUnitToMainUsesSection('LResources','',fSrcCache) then
|
||||||
begin
|
begin
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
if not fCodeTool.RemoveUnitFromAllUsesSections('VARIANTS',fSrcCache) then
|
if not fCodeTool.RemoveUnitFromAllUsesSections('VARIANTS',fSrcCache) then
|
||||||
begin
|
begin
|
||||||
exit;
|
exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user