From 2e39205afb249626b24b1af2251297ff039a60ca Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 25 Dec 2009 18:28:30 +0100 Subject: Sanitize Overwrite and DirDelete dialog response values Also respect localized button accelerators --- UCoreUtils.pas | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'UCoreUtils.pas') diff --git a/UCoreUtils.pas b/UCoreUtils.pas index faf6eb5..c4e71a7 100644 --- a/UCoreUtils.pas +++ b/UCoreUtils.pas @@ -67,6 +67,8 @@ function MakeString(const Separator: string; var SubStrings: TOpenStringArray): procedure CopyArray(var src: TOpenStringArray; var dst: TOpenStringArray); procedure DeleteFromArray(Index: integer; var SubStrings: TOpenStringArray); +function ExtractAccelerator(const LabelText: string): string; + function ProcessPattern(Engine: TPanelEngine; Pattern, APath, FileName: string; const Directory: boolean): string; // Processess pattern with FileName located in APath and return destination path+filename @@ -974,6 +976,14 @@ begin end; end; +(********************************************************************************************************************************) +function ExtractAccelerator(const LabelText: string): string; +begin + Result := ''; + if (Pos('_', LabelText) > 0) and (Pos('_', LabelText) < Length(LabelText)) then + Result := Copy(LabelText, Pos('_', LabelText) + 1, 1); +end; + (********************************************************************************************************************************) function GetStrSize(s: string): Int64; var i: integer; -- cgit v1.2.3