fixed reopen for loaded but not editor opened files

git-svn-id: trunk@8306 -
This commit is contained in:
mattias 2005-12-13 18:00:56 +00:00
parent 4ce4d0a95b
commit c9d605f092
2 changed files with 13 additions and 4 deletions

View File

@ -214,6 +214,7 @@ end;
procedure Tdlgpropertiesprinter.FormDestroy(Sender: TObject);
begin
if Sender=nil then ;
FPaperSizeOptions.Free;
FMediaTypeOptions.Free;
FInputSlotOptions.Free;

View File

@ -455,7 +455,9 @@ type
FCheckFilesOnDiskNeeded: boolean;
FOpenEditorsOnCodeToolChange: boolean;
{$IFDEF DoNotUseProcessDebugger}
FRunProcess: TProcess; // temp solution, will be replaced by dummydebugger
{$ENDIF}
FRebuildingCompilerGraphCodeToolsDefinesNeeded: boolean;
protected
@ -5566,8 +5568,8 @@ var
begin
{$IFDEF IDE_VERBOSE}
writeln('');
writeln('*** TMainIDE.DoOpenEditorFile START "',AFilename,'" ',OpenFlagsToString(Flags));
DebugLn('');
DebugLn('*** TMainIDE.DoOpenEditorFile START "',AFilename,'" ',OpenFlagsToString(Flags));
{$ENDIF}
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.DoOpenEditorFile START');{$ENDIF}
Result:=mrCancel;
@ -5652,7 +5654,9 @@ begin
NewUnitInfo.IsPartOfProject:=true;
Project1.Modified:=true;
end;
if (not (ofProjectLoading in Flags)) and NewUnitInfo.Loaded then begin
if (not (ofProjectLoading in Flags)) and (NewUnitInfo.EditorIndex>=0) then
begin
//DebugLn('TMainIDE.DoOpenEditorFile file already open ',NewUnitInfo.Filename);
// file already open -> change source notebook page
SourceNoteBook.Notebook.PageIndex:=NewUnitInfo.EditorIndex;
if ofDoLoadResource in Flags then
@ -5732,6 +5736,7 @@ begin
NewUnitInfo.FileReadOnly:=FileExists(NewUnitInfo.Filename)
and (not FileIsWritable(NewUnitInfo.Filename));
{$IFDEF IDE_DEBUG}
writeln('[TMainIDE.DoOpenEditorFile] B');
{$ENDIF}
@ -7202,7 +7207,10 @@ end;
function TMainIDE.DoInitProjectRun: TModalResult;
var
ProgramFilename, WorkingDir: String;
ProgramFilename: string;
{$IFDEF DoNotUseProcessDebugger}
WorkingDir: String;
{$ENDIF}
begin
if ToolStatus <> itNone
then begin