mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 11:19:26 +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;
|
||||
var
|
||||
CFString: CFStringRef;
|
||||
Res : Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
if GetEditPart < 0 then Exit;
|
||||
|
||||
CreateCFString(S, CFString);
|
||||
// S is not valid UTF8 string, creating an empty string to erase the content
|
||||
if not Assigned(CFString) then
|
||||
Res:=Assigned(CFString);
|
||||
if not Res then
|
||||
// S is not valid UTF8 string, creating an empty string to erase the content
|
||||
CreateCFString('', CFString);
|
||||
|
||||
try
|
||||
@ -524,7 +526,7 @@ begin
|
||||
SizeOf(CFStringRef), @CFString),
|
||||
Self, SSetText, SSetData) then Exit;
|
||||
|
||||
Result := True;
|
||||
Result := Res;
|
||||
finally
|
||||
FreeCFString(CFString);
|
||||
end;
|
||||
|
@ -303,7 +303,6 @@ function OpenURL(AURL: string): Boolean;
|
||||
var
|
||||
cf: CFStringRef;
|
||||
url: CFURLRef;
|
||||
w : WideString;
|
||||
begin
|
||||
if AURL = '' then
|
||||
Exit(False);
|
||||
|
Loading…
Reference in New Issue
Block a user