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

View File

@ -303,7 +303,6 @@ function OpenURL(AURL: string): Boolean;
var
cf: CFStringRef;
url: CFURLRef;
w : WideString;
begin
if AURL = '' then
Exit(False);