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:
dmitry 2010-01-11 07:27:54 +00:00
parent 034d4be114
commit 1d2407076c
2 changed files with 5 additions and 4 deletions

View File

@ -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;

View File

@ -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);