mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 07:39:35 +02:00
carbon: Edit control SetText() returns false, if not UTF8 string is passed. Removed unused variable in LCLintf darwin code
git-svn-id: trunk@23421 -
This commit is contained in:
parent
034d4be114
commit
1d2407076c
@ -509,13 +509,15 @@ end;
|
|||||||
function TCarbonControlWithEdit.SetText(const S: String): Boolean;
|
function TCarbonControlWithEdit.SetText(const S: String): Boolean;
|
||||||
var
|
var
|
||||||
CFString: CFStringRef;
|
CFString: CFStringRef;
|
||||||
|
Res : Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
if GetEditPart < 0 then Exit;
|
if GetEditPart < 0 then Exit;
|
||||||
|
|
||||||
CreateCFString(S, CFString);
|
CreateCFString(S, CFString);
|
||||||
// S is not valid UTF8 string, creating an empty string to erase the content
|
Res:=Assigned(CFString);
|
||||||
if not Assigned(CFString) then
|
if not Res then
|
||||||
|
// S is not valid UTF8 string, creating an empty string to erase the content
|
||||||
CreateCFString('', CFString);
|
CreateCFString('', CFString);
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -524,7 +526,7 @@ begin
|
|||||||
SizeOf(CFStringRef), @CFString),
|
SizeOf(CFStringRef), @CFString),
|
||||||
Self, SSetText, SSetData) then Exit;
|
Self, SSetText, SSetData) then Exit;
|
||||||
|
|
||||||
Result := True;
|
Result := Res;
|
||||||
finally
|
finally
|
||||||
FreeCFString(CFString);
|
FreeCFString(CFString);
|
||||||
end;
|
end;
|
||||||
|
@ -303,7 +303,6 @@ function OpenURL(AURL: string): Boolean;
|
|||||||
var
|
var
|
||||||
cf: CFStringRef;
|
cf: CFStringRef;
|
||||||
url: CFURLRef;
|
url: CFURLRef;
|
||||||
w : WideString;
|
|
||||||
begin
|
begin
|
||||||
if AURL = '' then
|
if AURL = '' then
|
||||||
Exit(False);
|
Exit(False);
|
||||||
|
Loading…
Reference in New Issue
Block a user