lcl: reduce amount of warnings, fix use of UTF8Decode and use of UTF8String type

git-svn-id: trunk@33250 -
This commit is contained in:
paul 2011-11-03 06:58:10 +00:00
parent c1f462390c
commit b8c286a25d
7 changed files with 28 additions and 16 deletions

View File

@ -1659,6 +1659,12 @@ implementation
uses
WSGrids;
{$WARN SYMBOL_DEPRECATED OFF}
{$IFDEF FPC_HAS_CPSTRING}
{$WARN IMPLICIT_STRING_CAST OFF}
{$WARN IMPLICIT_STRING_CAST_LOSS OFF}
{$ENDIF}
function BidiFlipX(X: Integer; const Width: Integer; const Flip: Boolean): Integer;
begin
if Flip then
@ -1806,7 +1812,7 @@ begin
end;
{$endif}
procedure CfgSetFontValue(cfg: TXMLConfig; AKey:string; AFont: TFont);
procedure CfgSetFontValue(cfg: TXMLConfig; AKey: WideString; AFont: TFont);
begin
cfg.SetValue(AKey + '/name/value', AFont.Name);
cfg.SetValue(AKey + '/size/value', AFont.Size);
@ -1814,7 +1820,7 @@ begin
cfg.SetValue(AKey + '/style/value', Integer(AFont.Style));
end;
procedure CfgGetFontValue(cfg: TXMLConfig; AKey:string; AFont: TFont);
procedure CfgGetFontValue(cfg: TXMLConfig; AKey: WideString; AFont: TFont);
begin
AFont.Name := cfg.GetValue(AKey + '/name/value', 'default');
AFont.Size := cfg.GetValue(AKey + '/size/value', 0);

View File

@ -829,8 +829,8 @@ begin
vtChar: CurBtnCaption := Buttons[i].VChar;
vtPChar: CurBtnCaption := Buttons[i].VPChar;
vtPWideChar: CurBtnCaption := Buttons[i].VPWideChar;
vtWideChar: CurBtnCaption := Buttons[i].VWideChar;
vtWidestring: CurBtnCaption := WideString(Buttons[i].VWideString);
vtWideChar: CurBtnCaption := AnsiString(Buttons[i].VWideChar);
vtWidestring: CurBtnCaption := AnsiString(WideString(Buttons[i].VWideString));
else
dec(i); // prevent the following inc(i)
end;
@ -849,8 +849,8 @@ begin
vtChar: CurOptions := Buttons[i].VChar;
vtPChar: CurOptions := Buttons[i].VPChar;
vtPWideChar: CurOptions := Buttons[i].VPWideChar;
vtWideChar: CurOptions := Buttons[i].VWideChar;
vtWidestring: CurOptions := WideString(Buttons[i].VWideString);
vtWideChar: CurOptions := AnsiString(Buttons[i].VWideChar);
vtWidestring: CurOptions := AnsiString(WideString(Buttons[i].VWideString));
else
HasOptions := False;
end;

View File

@ -1495,8 +1495,8 @@ begin
vtChar: DbgOut(Args[i].VChar);
vtPChar: DbgOut(Args[i].VPChar);
vtPWideChar: DbgOut(Args[i].VPWideChar);
vtWideChar: DbgOut(Args[i].VWideChar);
vtWidestring: DbgOut(WideString(Args[i].VWideString));
vtWideChar: DbgOut(AnsiString(Args[i].VWideChar));
vtWidestring: DbgOut(AnsiString(WideString(Args[i].VWideString)));
vtObject: DbgOut(DbgSName(Args[i].VObject));
vtClass: DbgOut(DbgSName(Args[i].VClass));
vtPointer: DbgOut(Dbgs(Args[i].VPointer));
@ -2375,9 +2375,9 @@ begin
vtAnsiString: s:=s+AnsiString(Args[i].VAnsiString);
vtChar: s:=s+Args[i].VChar;
vtPChar: s:=s+Args[i].VPChar;
vtPWideChar: s:=s+Args[i].VPWideChar;
vtWideChar: s:=s+Args[i].VWideChar;
vtWidestring: s:=s+WideString(Args[i].VWideString);
vtPWideChar: s:=AnsiString(WideString(s)+Args[i].VPWideChar);
vtWideChar: s:=AnsiString(WideString(s)+Args[i].VWideChar);
vtWidestring: s:=AnsiString(WideString(s)+WideString(Args[i].VWideString));
vtObject: s:=s+DbgSName(Args[i].VObject);
vtClass: s:=s+DbgSName(Args[i].VClass);
vtPointer: s:=s+Dbgs(Args[i].VPointer);

View File

@ -2243,7 +2243,7 @@ procedure LRSObjectBinaryToText(Input, Output: TStream);
else begin
// normal char
NewInString := True;
NewStr := s[i];
NewStr := AnsiString(s[i]);
end;
if NewInString <> InString then begin
NewStr := '''' + NewStr;

View File

@ -805,8 +805,8 @@ var
end;
begin
SearchTxt := UTF8Decode(TFindDialog(FDialog).FindText);
Text := UTF8Decode(FControl.Text);
SearchTxt := Utf8ToAnsi(TFindDialog(FDialog).FindText);
Text := Utf8ToAnsi(FControl.Text);
Result := (SearchTxt <> '') and (Text <> '');
if not Result then
@ -966,8 +966,8 @@ var
begin
if PerformSearch then
begin
Text := UTF8Decode(FControl.Text);
RText := UTF8Decode(Dialog.ReplaceText);
Text := Utf8ToAnsi(FControl.Text);
RText := Utf8ToAnsi(Dialog.ReplaceText);
p1 := FControl.SelStart;
p2 := FControl.SelLength;
FControl.ClearSelection;

View File

@ -67,6 +67,8 @@ procedure Register;
implementation
{$WARN SYMBOL_DEPRECATED OFF}
{ TProcessUTF8 }
procedure TProcessUTF8.SetApplicationNameUTF8(const AValue: string);

View File

@ -105,6 +105,10 @@ procedure Register;
implementation
{$IFDEF FPC_HAS_CPSTRING}
{$WARN IMPLICIT_STRING_CAST OFF}
{$WARN IMPLICIT_STRING_CAST_LOSS OFF}
{$ENDIF}
procedure Register;
begin