From b7afbbe0ba261cb0422d6d9f3fa14f83ac8e342f Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Wed, 30 Nov 2016 10:16:35 +0100 Subject: [PATCH] interfaces, prevent strings to be copied --- src/ce_editor.pas | 8 ++++---- src/ce_interfaces.pas | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ce_editor.pas b/src/ce_editor.pas index 8d8827de..7b50bb31 100644 --- a/src/ce_editor.pas +++ b/src/ce_editor.pas @@ -159,8 +159,8 @@ type function SingleServiceName: string; function documentCount: Integer; function getDocument(index: Integer): TCESynMemo; - function findDocument(fname: string): TCESynMemo; - procedure openDocument(fname: string); + function findDocument(const fname: string): TCESynMemo; + procedure openDocument(const fname: string); function closeDocument(index: Integer): boolean; function closeDocument(doc: TCESynMemo): boolean; public @@ -474,7 +474,7 @@ begin exit(TCESynMemo(pageControl.Pages[index].Controls[0])); end; -function TCEEditorWidget.findDocument(fname: string): TCESynMemo; +function TCEEditorWidget.findDocument(const fname: string): TCESynMemo; var i: Integer; begin @@ -487,7 +487,7 @@ begin result := nil; end; -procedure TCEEditorWidget.openDocument(fname: string); +procedure TCEEditorWidget.openDocument(const fname: string); var doc: TCESynMemo; begin diff --git a/src/ce_interfaces.pas b/src/ce_interfaces.pas index 89c35598..7e1d451a 100644 --- a/src/ce_interfaces.pas +++ b/src/ce_interfaces.pas @@ -271,9 +271,9 @@ type // returns the nth document. function getDocument(index: Integer): TCESynMemo; // returns true if the document matching aFilename is already opened. - function findDocument(fname: string): TCESynMemo; + function findDocument(const fname: string): TCESynMemo; // opens or set the focus on the document matching aFilename. - procedure openDocument(fname: string); + procedure openDocument(const fname: string); // closes the nth document. function closeDocument(index: Integer): boolean; // closes a particular document.