mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 06:40:56 +02:00
lcl: reduce amount of warnings, fix use of UTF8Decode and use of UTF8String type
git-svn-id: trunk@33250 -
This commit is contained in:
parent
c1f462390c
commit
b8c286a25d
@ -1659,6 +1659,12 @@ implementation
|
|||||||
uses
|
uses
|
||||||
WSGrids;
|
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;
|
function BidiFlipX(X: Integer; const Width: Integer; const Flip: Boolean): Integer;
|
||||||
begin
|
begin
|
||||||
if Flip then
|
if Flip then
|
||||||
@ -1806,7 +1812,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
procedure CfgSetFontValue(cfg: TXMLConfig; AKey:string; AFont: TFont);
|
procedure CfgSetFontValue(cfg: TXMLConfig; AKey: WideString; AFont: TFont);
|
||||||
begin
|
begin
|
||||||
cfg.SetValue(AKey + '/name/value', AFont.Name);
|
cfg.SetValue(AKey + '/name/value', AFont.Name);
|
||||||
cfg.SetValue(AKey + '/size/value', AFont.Size);
|
cfg.SetValue(AKey + '/size/value', AFont.Size);
|
||||||
@ -1814,7 +1820,7 @@ begin
|
|||||||
cfg.SetValue(AKey + '/style/value', Integer(AFont.Style));
|
cfg.SetValue(AKey + '/style/value', Integer(AFont.Style));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure CfgGetFontValue(cfg: TXMLConfig; AKey:string; AFont: TFont);
|
procedure CfgGetFontValue(cfg: TXMLConfig; AKey: WideString; AFont: TFont);
|
||||||
begin
|
begin
|
||||||
AFont.Name := cfg.GetValue(AKey + '/name/value', 'default');
|
AFont.Name := cfg.GetValue(AKey + '/name/value', 'default');
|
||||||
AFont.Size := cfg.GetValue(AKey + '/size/value', 0);
|
AFont.Size := cfg.GetValue(AKey + '/size/value', 0);
|
||||||
|
@ -829,8 +829,8 @@ begin
|
|||||||
vtChar: CurBtnCaption := Buttons[i].VChar;
|
vtChar: CurBtnCaption := Buttons[i].VChar;
|
||||||
vtPChar: CurBtnCaption := Buttons[i].VPChar;
|
vtPChar: CurBtnCaption := Buttons[i].VPChar;
|
||||||
vtPWideChar: CurBtnCaption := Buttons[i].VPWideChar;
|
vtPWideChar: CurBtnCaption := Buttons[i].VPWideChar;
|
||||||
vtWideChar: CurBtnCaption := Buttons[i].VWideChar;
|
vtWideChar: CurBtnCaption := AnsiString(Buttons[i].VWideChar);
|
||||||
vtWidestring: CurBtnCaption := WideString(Buttons[i].VWideString);
|
vtWidestring: CurBtnCaption := AnsiString(WideString(Buttons[i].VWideString));
|
||||||
else
|
else
|
||||||
dec(i); // prevent the following inc(i)
|
dec(i); // prevent the following inc(i)
|
||||||
end;
|
end;
|
||||||
@ -849,8 +849,8 @@ begin
|
|||||||
vtChar: CurOptions := Buttons[i].VChar;
|
vtChar: CurOptions := Buttons[i].VChar;
|
||||||
vtPChar: CurOptions := Buttons[i].VPChar;
|
vtPChar: CurOptions := Buttons[i].VPChar;
|
||||||
vtPWideChar: CurOptions := Buttons[i].VPWideChar;
|
vtPWideChar: CurOptions := Buttons[i].VPWideChar;
|
||||||
vtWideChar: CurOptions := Buttons[i].VWideChar;
|
vtWideChar: CurOptions := AnsiString(Buttons[i].VWideChar);
|
||||||
vtWidestring: CurOptions := WideString(Buttons[i].VWideString);
|
vtWidestring: CurOptions := AnsiString(WideString(Buttons[i].VWideString));
|
||||||
else
|
else
|
||||||
HasOptions := False;
|
HasOptions := False;
|
||||||
end;
|
end;
|
||||||
|
@ -1495,8 +1495,8 @@ begin
|
|||||||
vtChar: DbgOut(Args[i].VChar);
|
vtChar: DbgOut(Args[i].VChar);
|
||||||
vtPChar: DbgOut(Args[i].VPChar);
|
vtPChar: DbgOut(Args[i].VPChar);
|
||||||
vtPWideChar: DbgOut(Args[i].VPWideChar);
|
vtPWideChar: DbgOut(Args[i].VPWideChar);
|
||||||
vtWideChar: DbgOut(Args[i].VWideChar);
|
vtWideChar: DbgOut(AnsiString(Args[i].VWideChar));
|
||||||
vtWidestring: DbgOut(WideString(Args[i].VWideString));
|
vtWidestring: DbgOut(AnsiString(WideString(Args[i].VWideString)));
|
||||||
vtObject: DbgOut(DbgSName(Args[i].VObject));
|
vtObject: DbgOut(DbgSName(Args[i].VObject));
|
||||||
vtClass: DbgOut(DbgSName(Args[i].VClass));
|
vtClass: DbgOut(DbgSName(Args[i].VClass));
|
||||||
vtPointer: DbgOut(Dbgs(Args[i].VPointer));
|
vtPointer: DbgOut(Dbgs(Args[i].VPointer));
|
||||||
@ -2375,9 +2375,9 @@ begin
|
|||||||
vtAnsiString: s:=s+AnsiString(Args[i].VAnsiString);
|
vtAnsiString: s:=s+AnsiString(Args[i].VAnsiString);
|
||||||
vtChar: s:=s+Args[i].VChar;
|
vtChar: s:=s+Args[i].VChar;
|
||||||
vtPChar: s:=s+Args[i].VPChar;
|
vtPChar: s:=s+Args[i].VPChar;
|
||||||
vtPWideChar: s:=s+Args[i].VPWideChar;
|
vtPWideChar: s:=AnsiString(WideString(s)+Args[i].VPWideChar);
|
||||||
vtWideChar: s:=s+Args[i].VWideChar;
|
vtWideChar: s:=AnsiString(WideString(s)+Args[i].VWideChar);
|
||||||
vtWidestring: s:=s+WideString(Args[i].VWideString);
|
vtWidestring: s:=AnsiString(WideString(s)+WideString(Args[i].VWideString));
|
||||||
vtObject: s:=s+DbgSName(Args[i].VObject);
|
vtObject: s:=s+DbgSName(Args[i].VObject);
|
||||||
vtClass: s:=s+DbgSName(Args[i].VClass);
|
vtClass: s:=s+DbgSName(Args[i].VClass);
|
||||||
vtPointer: s:=s+Dbgs(Args[i].VPointer);
|
vtPointer: s:=s+Dbgs(Args[i].VPointer);
|
||||||
|
@ -2243,7 +2243,7 @@ procedure LRSObjectBinaryToText(Input, Output: TStream);
|
|||||||
else begin
|
else begin
|
||||||
// normal char
|
// normal char
|
||||||
NewInString := True;
|
NewInString := True;
|
||||||
NewStr := s[i];
|
NewStr := AnsiString(s[i]);
|
||||||
end;
|
end;
|
||||||
if NewInString <> InString then begin
|
if NewInString <> InString then begin
|
||||||
NewStr := '''' + NewStr;
|
NewStr := '''' + NewStr;
|
||||||
|
@ -805,8 +805,8 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
SearchTxt := UTF8Decode(TFindDialog(FDialog).FindText);
|
SearchTxt := Utf8ToAnsi(TFindDialog(FDialog).FindText);
|
||||||
Text := UTF8Decode(FControl.Text);
|
Text := Utf8ToAnsi(FControl.Text);
|
||||||
|
|
||||||
Result := (SearchTxt <> '') and (Text <> '');
|
Result := (SearchTxt <> '') and (Text <> '');
|
||||||
if not Result then
|
if not Result then
|
||||||
@ -966,8 +966,8 @@ var
|
|||||||
begin
|
begin
|
||||||
if PerformSearch then
|
if PerformSearch then
|
||||||
begin
|
begin
|
||||||
Text := UTF8Decode(FControl.Text);
|
Text := Utf8ToAnsi(FControl.Text);
|
||||||
RText := UTF8Decode(Dialog.ReplaceText);
|
RText := Utf8ToAnsi(Dialog.ReplaceText);
|
||||||
p1 := FControl.SelStart;
|
p1 := FControl.SelStart;
|
||||||
p2 := FControl.SelLength;
|
p2 := FControl.SelLength;
|
||||||
FControl.ClearSelection;
|
FControl.ClearSelection;
|
||||||
|
@ -67,6 +67,8 @@ procedure Register;
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{$WARN SYMBOL_DEPRECATED OFF}
|
||||||
|
|
||||||
{ TProcessUTF8 }
|
{ TProcessUTF8 }
|
||||||
|
|
||||||
procedure TProcessUTF8.SetApplicationNameUTF8(const AValue: string);
|
procedure TProcessUTF8.SetApplicationNameUTF8(const AValue: string);
|
||||||
|
@ -105,6 +105,10 @@ procedure Register;
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{$IFDEF FPC_HAS_CPSTRING}
|
||||||
|
{$WARN IMPLICIT_STRING_CAST OFF}
|
||||||
|
{$WARN IMPLICIT_STRING_CAST_LOSS OFF}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user