From 6fdd286ea29f75197f11f5f67ffc8074641da55e Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 7 Mar 2012 08:35:47 +0000 Subject: [PATCH] codetools: fixed type of property git-svn-id: trunk@35791 - --- components/codetools/finddeclarationtool.pas | 36 +++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 7acd1f207b..ec2001d77c 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -7228,26 +7228,30 @@ var ExprType.Context.Node.FirstChild); ctnClass, ctnClassInterface, ctnDispinterface, ctnObject, ctnRecordType, - ctnObjCClass, ctnObjCCategory, ctnObjCProtocol, ctnCPPClass, + ctnObjCClass, ctnObjCCategory, ctnObjCProtocol, ctnCPPClass: + begin + // search default property of the class / interface + Params.Save(OldInput); + Params.Flags:=[fdfSearchInAncestors,fdfExceptionOnNotFound] + +fdfGlobals*Params.Flags; + // special identifier for default property + Params.SetIdentifier(Self,@Src[CurAtom.StartPos],nil); + Params.ContextNode:=ExprType.Context.Node; + ExprType.Context.Tool.FindIdentifierInContext(Params); + ExprType.Context:=CreateFindContext(Params); + Params.Load(OldInput,true); + ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params, + ExprType.Context.Node); + end; + ctnProperty, ctnGlobalProperty: begin - if ExprType.Context.Node.Desc in AllClasses then begin - // search default property of the class / interface - Params.Save(OldInput); - Params.Flags:=[fdfSearchInAncestors,fdfExceptionOnNotFound] - +fdfGlobals*Params.Flags; - // special identifier for default property - Params.SetIdentifier(Self,@Src[CurAtom.StartPos],nil); - Params.ContextNode:=ExprType.Context.Node; - ExprType.Context.Tool.FindIdentifierInContext(Params); - ExprType.Context:=CreateFindContext(Params); - Params.Load(OldInput,true); - ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params, - ExprType.Context.Node); - end else + if not ExprType.Context.Tool.PropertyNodeHasParamList(ExprType.Context.Node) then RaiseIdentInCurContextNotFound; + ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params, + ExprType.Context.Node); end; - + ctnIdentifier: begin MoveCursorToNodeStart(ExprType.Context.Node);