From a1e83f3bdc4deab1ac1071a1e4459b13764124ae Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 5 Sep 2015 22:30:05 +0200 Subject: [PATCH] added funct isStringDisabled() --- src/ce_common.pas | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/ce_common.pas b/src/ce_common.pas index 84e82afb..9f5742ca 100644 --- a/src/ce_common.pas +++ b/src/ce_common.pas @@ -224,6 +224,13 @@ type *) 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 @@ -1032,6 +1039,17 @@ begin 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 registerClasses([TCEPersistentShortcut]); end.