From 8ff7c73715833d52060965821f1f3afc1ddd9f40 Mon Sep 17 00:00:00 2001 From: inoussa Date: Tue, 16 Jun 2009 09:54:57 +0000 Subject: [PATCH] Type Library Editor : fix function's return type setting. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@850 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- wst/trunk/type_lib_edtr/uprocedit.lrs | 2 ++ wst/trunk/type_lib_edtr/uprocedit.pas | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wst/trunk/type_lib_edtr/uprocedit.lrs b/wst/trunk/type_lib_edtr/uprocedit.lrs index b5f96392a..f3f8abb48 100644 --- a/wst/trunk/type_lib_edtr/uprocedit.lrs +++ b/wst/trunk/type_lib_edtr/uprocedit.lrs @@ -1,3 +1,5 @@ +{ Ceci est un fichier ressource généré automatiquement par Lazarus } + LazarusResources.Add('TfProcEdit','FORMDATA',[ 'TPF0'#10'TfProcEdit'#9'fProcEdit'#4'Left'#3'"'#1#6'Height'#3#31#2#3'Top'#2'v' +#5'Width'#3#10#2#13'ActiveControl'#7#7'edtName'#11'BorderStyle'#7#13'bsSizeT' diff --git a/wst/trunk/type_lib_edtr/uprocedit.pas b/wst/trunk/type_lib_edtr/uprocedit.pas index 7e52d81a0..66e1ca059 100644 --- a/wst/trunk/type_lib_edtr/uprocedit.pas +++ b/wst/trunk/type_lib_edtr/uprocedit.pas @@ -291,12 +291,17 @@ procedure TfProcEdit.SaveToObject(); end; procedure CheckObjectType(); + var + newRetType : TPasType; begin if FObject.InheritsFrom(TPasFunction) then begin + newRetType := edtResultType.Items.Objects[edtResultType.ItemIndex] as TPasType; if ( FOldReturnType <> nil ) and - ( FOldReturnType <> TPasFunctionType(FObject.ProcType).ResultEl.ResultType ) + ( FOldReturnType <> newRetType ) then begin FOldReturnType.Release(); + TPasFunctionType(FObject.ProcType).ResultEl.ResultType := newRetType; + newRetType.AddRef(); end; end; if edtFunction.Checked and ( not FObject.InheritsFrom(TPasFunction) ) then begin