From 3517253af7fbd39fc85809588e5e072b0846ae70 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 19 Aug 2008 23:01:31 +0000 Subject: [PATCH] Fix unicode table names and comments in alter table dialog --- source/helpers.pas | 12 +++++------- source/tbl_properties.dfm | 4 ++-- source/tbl_properties.pas | 18 +++++++++--------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/source/helpers.pas b/source/helpers.pas index 70c6e5ed..d346f92a 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -73,7 +73,7 @@ type {$I const.inc} function trimc(s: String; c: Char) : String; - function implodestr(seperator: String; a: TWideStringList) :WideString; + function implodestr(seperator: WideString; a: TWideStringList) :WideString; function explode(separator, a: WideString) :TWideStringList; procedure ensureValidIdentifier(name: String); function getEnumValues(str: WideString): WideString; @@ -228,19 +228,17 @@ end; @param a TStringList Containing strings @return string } -function implodestr(seperator: String; a: TWideStringList) :WideString; +function implodestr(seperator: WideString; a: TWideStringList) :WideString; var i : Integer; - text : String; begin - result := ''; + Result := ''; for i:=0 to a.Count-1 do begin - text := text + a[i]; + Result := Result + a[i]; if i < a.Count-1 then - text := text + seperator; + Result := Result + seperator; end; - result := text; end; diff --git a/source/tbl_properties.dfm b/source/tbl_properties.dfm index 5e60c187..255ee954 100644 --- a/source/tbl_properties.dfm +++ b/source/tbl_properties.dfm @@ -111,7 +111,7 @@ object tbl_properties_form: Ttbl_properties_form ModalResult = 2 TabOrder = 7 end - object editName: TEdit + object editName: TTntEdit Left = 88 Top = 17 Width = 216 @@ -121,7 +121,7 @@ object tbl_properties_form: Ttbl_properties_form Text = 'editName' OnChange = editNameChange end - object editComment: TEdit + object editComment: TTntEdit Left = 88 Top = 42 Width = 216 diff --git a/source/tbl_properties.pas b/source/tbl_properties.pas index 658696d5..3ffa659d 100644 --- a/source/tbl_properties.pas +++ b/source/tbl_properties.pas @@ -10,14 +10,14 @@ interface uses Windows, Messages, SysUtils, Classes, Controls, Forms, Graphics, - Dialogs, StdCtrls, Db, Menus, SynMemo, SynEdit, WideStrings; + Dialogs, StdCtrls, Db, Menus, SynMemo, SynEdit, WideStrings, TntStdCtrls; type Ttbl_properties_form = class(TForm) lblName: TLabel; - editName: TEdit; + editName: TTntEdit; lblComment: TLabel; - editComment: TEdit; + editComment: TTntEdit; lblEngine: TLabel; comboEngine: TComboBox; lblCharset: TLabel; @@ -50,9 +50,9 @@ type currentEngine, currentCharset, currentCollation, - currentAutoincrement : String; + currentAutoincrement : WideString; public - TableName : String; + TableName : WideString; end; implementation @@ -123,7 +123,7 @@ end; procedure Ttbl_properties_form.FormShow(Sender: TObject); var ds: TDataSet; - sql : String; + sql : WideString; begin // Fetch table properties sql := 'SHOW TABLE STATUS '; @@ -131,11 +131,11 @@ begin ds := Mainform.Childwin.GetResults(sql); // Table name - currentName := ds.FieldByName('Name').AsString; + currentName := ds.FieldByName('Name').AsWideString; editName.Text := currentName; // Comment - currentComment := ds.FieldByName('Comment').AsString; + currentComment := ds.FieldByName('Comment').AsWideString; editComment.Text := currentComment; // Engine @@ -262,7 +262,7 @@ end; procedure Ttbl_properties_form.FormClose(Sender: TObject; var Action: TCloseAction); var - sql, tmp : String; + sql, tmp : WideString; AlterSpecs : TWideStringList; begin if ModalResult = mrOK then