mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 14:29:29 +02:00
Converter: FindUnitCaseInsensitive is fixed, remove workaround. Leave a local FindMissingUnits for better control.
git-svn-id: trunk@28931 -
This commit is contained in:
parent
8b63e9a07b
commit
ca4fb99240
@ -58,8 +58,6 @@ type
|
||||
fIsConsoleApp: Boolean;
|
||||
fAskAboutError: Boolean;
|
||||
fSettings: TConvertSettings; // Conversion settings.
|
||||
// Work around a bug caused by caching the wrongly cased unit name.
|
||||
fRenamedMissingUnits: TStringToStringTree;
|
||||
procedure InitCodeTool;
|
||||
function HandleCodetoolError: TModalResult;
|
||||
public
|
||||
@ -74,8 +72,6 @@ type
|
||||
property IsConsoleApp: Boolean read fIsConsoleApp write fIsConsoleApp;
|
||||
property AskAboutError: Boolean read fAskAboutError write fAskAboutError;
|
||||
property Settings: TConvertSettings read fSettings write fSettings;
|
||||
property RenamedMissingUnits: TStringToStringTree read fRenamedMissingUnits
|
||||
write fRenamedMissingUnits;
|
||||
end;
|
||||
|
||||
{ TConvDelphiCodeTool }
|
||||
|
@ -145,8 +145,6 @@ type
|
||||
fAllCommentedUnits: TStringList;
|
||||
// Units that are found and will be added to project and converted.
|
||||
fUnitsToAddToProject: TStringList;
|
||||
// Work around a bug caused by caching the wrongly cased unit name.
|
||||
fRenamedMissingUnits: TStringToStringTree;
|
||||
fSettings: TConvertSettings;
|
||||
function ConvertSub: TModalResult;
|
||||
procedure CleanUpCompilerOptionsSearchPaths(Options: TBaseCompilerOptions);
|
||||
@ -624,8 +622,6 @@ begin
|
||||
try
|
||||
if fSettings.UnitsReplaceMode<>rlDisabled then begin
|
||||
fUsedUnitsTool:=TUsedUnitsTool.Create(fCTLink, fOrigUnitFilename);
|
||||
if Assigned(fOwnerConverter) then
|
||||
fCTLink.RenamedMissingUnits:=fOwnerConverter.fRenamedMissingUnits;
|
||||
// Find and prepare the missing units. Don't replace yet.
|
||||
Result:=fUsedUnitsTool.Prepare;
|
||||
if Result<>mrOk then exit;
|
||||
@ -793,13 +789,11 @@ begin
|
||||
fAllCommentedUnits:=TStringList.Create;
|
||||
fAllCommentedUnits.Sorted:=true;
|
||||
fUnitsToAddToProject:=TStringList.Create;
|
||||
fRenamedMissingUnits:=TStringToStringTree.Create(true);
|
||||
fPrevSelectedPath:=fSettings.MainPath;
|
||||
end;
|
||||
|
||||
destructor TConvertDelphiPBase.Destroy;
|
||||
begin
|
||||
fRenamedMissingUnits.Free;
|
||||
fUnitsToAddToProject.Free;
|
||||
fAllCommentedUnits.Free;
|
||||
fSettings.Free;
|
||||
|
@ -209,17 +209,8 @@ begin
|
||||
if NewInFilename<>'' then
|
||||
s:=s+' in '''+NewInFilename+'''';
|
||||
if AFilename<>'' then begin // unit found
|
||||
if (NewUnitName<>OldUnitName) or (NewInFilename<>OldInFilename) then begin
|
||||
if (NewUnitName<>OldUnitName) or (NewInFilename<>OldInFilename) then
|
||||
ToBeRenamedOrRemoved(OldUnitName, NewUnitName); // fix case
|
||||
// FindUnitCaseInsensitive reports only the 1. instance of a missing unit
|
||||
// with different casing. This workaround can be removed when it is fixed.
|
||||
if Assigned(RenamedMissingUnits) then
|
||||
RenamedMissingUnits[OldUnitName]:=NewUnitName;
|
||||
end
|
||||
else if Assigned(RenamedMissingUnits) then begin
|
||||
if RenamedMissingUnits.Contains(OldUnitName) then
|
||||
ToBeRenamedOrRemoved(OldUnitName, RenamedMissingUnits[OldUnitName]);
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
// Omit Windows specific units from the list if target is "Windows only",
|
||||
|
Loading…
Reference in New Issue
Block a user