IDE: Formatting.

git-svn-id: trunk@59258 -
This commit is contained in:
juha 2018-10-06 19:32:48 +00:00
parent 66d593c327
commit 38389bb56f
5 changed files with 14 additions and 22 deletions

View File

@ -1491,8 +1491,7 @@ var
AUnitName: String;
begin
if EnvironmentOptions.AmbiguousFileAction=afaIgnore then exit(mrOK);
if EnvironmentOptions.AmbiguousFileAction
in [afaAsk,afaAutoDelete,afaAutoRename]
if EnvironmentOptions.AmbiguousFileAction in [afaAsk,afaAutoDelete,afaAutoRename]
then begin
ADirectory:=AppendPathDelim(ExtractFilePath(Filename));
if FindFirstUTF8(ADirectory+GetAllFilesMask,faAnyFile,FileInfo)=0 then

View File

@ -7688,8 +7688,7 @@ begin
end;
end;
function TMainIDE.DoBuildFile(ShowAbort: Boolean; Filename: string
): TModalResult;
function TMainIDE.DoBuildFile(ShowAbort: Boolean; Filename: string): TModalResult;
var
ActiveSrcEdit: TSourceEditor;
ActiveUnitInfo: TUnitInfo;

View File

@ -301,7 +301,7 @@ type
FUnitResourceFileformat: TUnitResourcefileFormatClass;
function GetEditorInfo(Index: Integer): TUnitEditorInfo;
function GetHasResources:boolean;
function GetHasResources: boolean;
function GetModified: boolean;
function GetNextAutoRevertLockedUnit: TUnitInfo;
function GetNextLoadedUnit: TUnitInfo;

View File

@ -69,7 +69,7 @@ type
resFileName: String;
lrsFileName: String;
LastResFilename: String;
LastResFileName: String;
LastLrsFileName: String;
function GetProjectIcon: TProjectIcon;
@ -384,10 +384,8 @@ begin
begin
FModified := AValue;
if not FModified then
begin
for i := 0 to FResources.Count - 1 do
FResources[i].Modified := False;
end;
if Assigned(FOnModified) then
OnModified(Self);
end;
@ -510,7 +508,8 @@ end;
function TProjectResources.Regenerate(const MainFileName: String; UpdateSource,
PerformSave: boolean; const SaveToTestDir: string): Boolean;
begin
//DebugLn(['TProjectResources.Regenerate MainFilename=',MainFilename,' UpdateSource=',UpdateSource,' PerformSave=',PerformSave]);
//DebugLn(['TProjectResources.Regenerate MainFilename=',MainFilename,
// ' UpdateSource=',UpdateSource,' PerformSave=',PerformSave]);
//DumpStack;
Result := False;
@ -518,7 +517,7 @@ begin
Exit(true);
// remember old codebuffer filenames
LastResFilename := resFileName;
LastResFileName := resFileName;
LastLrsFileName := lrsFileName;
SetFileNames(MainFileName, SaveToTestDir);
@ -671,8 +670,7 @@ begin
if FLrsIncludeAllowed and HasLazarusResources then
begin
//debugln(['TProjectResources.UpdateMainSourceFile include directive not found: FCanHaveLrsInclude=',FLrsIncludeAllowed,' HasLazarusResources=',HasLazarusResources]);
if not CodeToolBoss.AddIncludeDirectiveForInit(CodeBuf,
Filename,'') then
if not CodeToolBoss.AddIncludeDirectiveForInit(CodeBuf,Filename,'') then
begin
Result := False;
Messages.Add(Format(lisCouldNotAddIToMainSource, [Filename]));
@ -720,7 +718,7 @@ begin
if CodeBuf = nil then
Exit;
LastResFilename := resFileName;
LastResFileName := resFileName;
LastLrsFileName := lrsFileName;
try
SetFileNames(CurFileName, '');
@ -850,7 +848,7 @@ procedure TProjectResources.DeleteLastCodeBuffers;
end;
begin
CleanCodeBuffer(LastResFilename, resFileName);
CleanCodeBuffer(LastResFileName, resFileName);
CleanCodeBuffer(LastLrsFileName, lrsFileName);
end;

View File

@ -126,16 +126,14 @@ end;
{ TResourceItem }
procedure TResourceItem.ReadFromProjectFile(AConfig: TXMLConfig;
const Path: String);
procedure TResourceItem.ReadFromProjectFile(AConfig: TXMLConfig; const Path: String);
begin
FileName := AConfig.GetValue(Path + 'FileName', '');
ResType := StrToResourceType(AConfig.GetValue(Path + 'Type', ''));
ResName := AConfig.GetValue(Path + 'ResourceName', '');
end;
procedure TResourceItem.WriteToProjectFile(AConfig: TXMLConfig;
const Path: String);
procedure TResourceItem.WriteToProjectFile(AConfig: TXMLConfig; const Path: String);
begin
AConfig.SetValue(Path + 'FileName', FileName);
AConfig.SetValue(Path + 'Type', ResourceTypeToStr[ResType]);
@ -256,8 +254,7 @@ begin
end;
end;
procedure TProjectUserResources.WriteToProjectFile(AConfig: TObject;
const Path: String);
procedure TProjectUserResources.WriteToProjectFile(AConfig: TObject; const Path: String);
var
I: Integer;
begin
@ -266,8 +263,7 @@ begin
List[I]^.WriteToProjectFile(TXMLConfig(AConfig), Path + 'General/Resources/Resource_' + IntToStr(I) + '/')
end;
procedure TProjectUserResources.ReadFromProjectFile(AConfig: TObject;
const Path: String);
procedure TProjectUserResources.ReadFromProjectFile(AConfig: TObject; const Path: String);
var
I, Count: Integer;
begin