added funct isStringDisabled()

This commit is contained in:
Basile Burg 2015-09-05 22:30:05 +02:00
parent 3fbb09be4f
commit a1e83f3bdc
1 changed files with 18 additions and 0 deletions

View File

@ -224,6 +224,13 @@ type
*) *)
function isEditable(const ext: string): boolean; function isEditable(const ext: string): boolean;
(**
* Returns true if str starts with a semicolon or a double slash.
* This is used to disable TStringList items in several places
*)
function isStringDisabled(const str: string): boolean;
implementation implementation
@ -1032,6 +1039,17 @@ begin
end; end;
end; end;
function isStringDisabled(const str: string): boolean;
begin
result := false;
if str = '' then
exit;
if str[1] = ';' then
result := true;
if (length(str) > ) and (str[1..2] = '//') then
result := true;
end;
initialization initialization
registerClasses([TCEPersistentShortcut]); registerClasses([TCEPersistentShortcut]);
end. end.