mirror of https://gitlab.com/basile.b/dexed.git
fix possible AV source when updating page caption
This commit is contained in:
parent
d88cc5c4f6
commit
87905802d1
|
@ -201,10 +201,11 @@ end;
|
|||
|
||||
procedure TCEEditorWidget.docFocused(aDoc: TCESynMemo);
|
||||
begin
|
||||
if pageControl.currentPage.Caption = '<new document>' then
|
||||
updatePageCaption;
|
||||
if aDoc = fDoc then exit;
|
||||
fDoc := aDoc;
|
||||
if fDoc.isNotNil and pageControl.currentPage.isNotNil and
|
||||
(pageControl.currentPage.Caption = '<new document>') then
|
||||
updatePageCaption;
|
||||
focusedEditorChanged;
|
||||
updateImperative;
|
||||
end;
|
||||
|
@ -510,7 +511,9 @@ end;
|
|||
|
||||
procedure TCEEditorWidget.updatePageCaption;
|
||||
var
|
||||
md: string = '';
|
||||
md: string = '<new document>';
|
||||
begin
|
||||
if fDoc.isNotNil then
|
||||
begin
|
||||
if fDoc.isDSource then
|
||||
begin
|
||||
|
@ -522,8 +525,7 @@ begin
|
|||
end
|
||||
else if fDoc.fileName.fileExists then
|
||||
md := fDoc.fileName.extractFileName
|
||||
else
|
||||
md := '<new document>';
|
||||
end;
|
||||
pageControl.currentPage.Caption := md;
|
||||
end;
|
||||
|
||||
|
|
Loading…
Reference in New Issue