richmemo: cleanup warnings

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6525 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz
2018-06-25 02:11:10 +00:00
parent c6b5ea4fa8
commit b66e16bb76
2 changed files with 17 additions and 9 deletions

View File

@ -340,7 +340,7 @@ type
property ZoomFactor;
end;
procedure InitFontParams(var p: TFontParams);
procedure InitFontParams(out p: TFontParams);
function GetFontParams(styles: TFontStyles): TFontParams; overload;
function GetFontParams(color: TColor; styles: TFontStyles): TFontParams; overload;
function GetFontParams(const Name: String; color: TColor; styles: TFontStyles): TFontParams; overload;
@ -366,7 +366,7 @@ implementation
uses
{%H-}RichMemoFactory, WSRichMemo;
procedure InitFontParams(var p: TFontParams);
procedure InitFontParams(out p: TFontParams);
begin
FillChar(p, SizeOf(p), 0);
end;
@ -835,7 +835,9 @@ function TCustomRichMemo.CanPaste: Boolean;
begin
if not HandleAllocated then HandleNeeded;
if HandleAllocated then
Result:=TWSCustomRichMemoClass(WidgetSetClass).CanPasteFromClipboard(Self);
Result:=TWSCustomRichMemoClass(WidgetSetClass).CanPasteFromClipboard(Self)
else
Result:=false;
end;
procedure TCustomRichMemo.SetRangeColor(TextStart, TextLength: Integer; FontColor: TColor);
@ -1035,7 +1037,7 @@ begin
if not HandleAllocated then HandleNeeded;
if HandleAllocated and not TWSCustomRichMemoClass(WidgetSetClass).GetSubText(Self, TextStart, TextLength, false, isu, txt, utxt) then
Exit;
if isu then Result:=UTF8Decode(utxt)
if isu then Result:=UTF8Encode(utxt)
else Result:=txt;
end;
@ -1050,7 +1052,7 @@ begin
if HandleAllocated and not TWSCustomRichMemoClass(WidgetSetClass).GetSubText(Self, TextStart, TextLength, false, isu, txt, utxt) then
Exit;
if isu then Result:=utxt
else Result:=UTF8Encode(txt);
else Result:=UTF8Decode(txt);
end;
procedure TCustomRichMemo.SetSelLengthFor(const aselstr: string);
@ -1072,6 +1074,7 @@ function TCustomRichMemo.Search(const ANiddle: string; Start, Len: Integer; cons
var
so : TIntSearchOpt;
begin
Result:=false;
if not HandleAllocated then HandleNeeded;
if HandleAllocated then begin
so.len:=Len;
@ -1126,6 +1129,7 @@ begin
if HandleAllocated then begin
est.Pages:=TWSCustomRichMemoClass(WidgetSetClass).Print(Self, Printer, params, false);
Result:=true;
end else
Result:=false;
end;