mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-26 15:49:10 +02:00
win32: Adjust line breaks before assigning a text string to memo (issue #0017000)
git-svn-id: trunk@29915 -
This commit is contained in:
parent
dfc3dc15df
commit
7fe0a34e7b
@ -205,15 +205,17 @@ end;
|
|||||||
procedure TWin32MemoStrings.SetTextStr(const Value: string);
|
procedure TWin32MemoStrings.SetTextStr(const Value: string);
|
||||||
var
|
var
|
||||||
Msg: TLMessage;
|
Msg: TLMessage;
|
||||||
|
AdjustedValue: String;
|
||||||
begin
|
begin
|
||||||
if (Value <> Text) then
|
AdjustedValue := AdjustLineBreaks(Value);
|
||||||
|
if (AdjustedValue <> Text) then
|
||||||
begin
|
begin
|
||||||
{$ifdef WindowsUnicodeSupport}
|
{$ifdef WindowsUnicodeSupport}
|
||||||
if UnicodeEnabledOS
|
if UnicodeEnabledOS
|
||||||
then Windows.SetWindowTextW(FHandle, PWideChar(UTF8ToUTF16(Value)))
|
then Windows.SetWindowTextW(FHandle, PWideChar(UTF8ToUTF16(AdjustedValue)))
|
||||||
else Windows.SetWindowText(FHandle, PChar(Utf8ToAnsi(Value)));
|
else Windows.SetWindowText(FHandle, PChar(Utf8ToAnsi(AdjustedValue)));
|
||||||
{$else}
|
{$else}
|
||||||
SendMessage(FHandle, WM_SETTEXT, 0, LPARAM(PChar(Value)));
|
SendMessage(FHandle, WM_SETTEXT, 0, LPARAM(PChar(AdjustedValue)));
|
||||||
{$endif}
|
{$endif}
|
||||||
FillChar(Msg, SizeOf(Msg), 0);
|
FillChar(Msg, SizeOf(Msg), 0);
|
||||||
Msg.Msg := CM_TEXTCHANGED;
|
Msg.Msg := CM_TEXTCHANGED;
|
||||||
|
Loading…
Reference in New Issue
Block a user