From 0c6ffcf286682357788991985afcfe764089648b Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 9 Aug 2004 18:22:08 +0000 Subject: [PATCH] fixed type of Low(open array) and type of PathDelim git-svn-id: trunk@5759 - --- components/codetools/finddeclarationtool.pas | 37 ++++++++++++++++++-- lcl/interfaces/gtk/gtkobject.inc | 12 ++++--- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 9bf802ea69..50eb07a54f 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -4501,7 +4501,7 @@ begin Result.Context:=CreateFindContext(Self,Node); {$IFDEF ShowExprEval} DebugLn('[TFindDeclarationTool.ConvertNodeToExpressionType] B', - ' Node=',Node.DescAsString); + ' Expr=',ExprTypeToString(Result)); {$ENDIF} if Node.Desc=ctnRangeType then begin // range type -> convert to special expression type @@ -4512,6 +4512,27 @@ begin // ToDo: check for circles + Params.Save(OldInput); + Params.ContextNode:=Node; + Result:=ReadOperandTypeAtCursor(Params); + Params.Load(OldInput); + Result.Context:=CreateFindContext(Self,Node); + end else if (Node.Desc=ctnConstDefinition) and (Node.FirstChild=nil) then + begin + // const -> convert to special expression type + + // ToDo: ppu, ppw, dcu files + + MoveCursorToNodeStart(Node); + + ReadNextAtom; + if not AtomIsIdentifier(false) then exit; + ReadNextAtom; + if not (CurPos.Flag in [cafEqual,cafColon]) then exit; + ReadNextAtom; + + // ToDo: check for circles + Params.Save(OldInput); Params.ContextNode:=Node; Result:=ReadOperandTypeAtCursor(Params); @@ -4673,9 +4694,15 @@ var ParamList: TExprTypeList; ParamNode: TCodeTreeNode; begin + Result:=CleanExpressionType; IdentPos:=@Src[StartPos]; Result.Desc:=PredefinedIdentToExprTypeDesc(IdentPos); + + {$IFDEF ShowExprEval} + debugln('TFindDeclarationTool.FindExpressionTypeOfPredefinedIdentifier ', + ExpressionTypeDescNames[Result.Desc]); + {$ENDIF} case Result.Desc of xtCompilerFunc: begin @@ -4695,6 +4722,9 @@ begin else if (CompareIdentifiers(IdentPos,'LOW')=0) or (CompareIdentifiers(IdentPos,'HIGH')=0) then begin + {$IFDEF ShowExprEval} + debugln('TFindDeclarationTool.FindExpressionTypeOfPredefinedIdentifier Ident=',GetIdentifier(IdentPos)); + {$ENDIF} { examples: Low(ordinal type) is the ordinal type Low(array) has type of the array items @@ -4715,7 +4745,10 @@ begin ctnOpenArrayType: // array without explicit range -> open array // Low(Open array) is ordinal integer - Result.Desc:=xtConstOrdInteger; + begin + Result.Desc:=xtConstOrdInteger; + Result.Context:=CleanFindContext; + end; ctnRangedArrayType: begin diff --git a/lcl/interfaces/gtk/gtkobject.inc b/lcl/interfaces/gtk/gtkobject.inc index f19d062f32..7c6e8e832b 100644 --- a/lcl/interfaces/gtk/gtkobject.inc +++ b/lcl/interfaces/gtk/gtkobject.inc @@ -1139,11 +1139,11 @@ begin {$IFDEF VerboseSizeMsg} LCLObject:=GetNearestLCLObject(Widget); - write('TGtkWidgetSet.RealizeWidgetSize Widget=',HexStr(Cardinal(Widget),8), - ' New=',NewWidth,',',NewHeight); + DbgOut('TGtkWidgetSet.RealizeWidgetSize Widget='+HexStr(Cardinal(Widget),8), + ' New='+dbgs(NewWidth)+','+dbgs(NewHeight)); if (LCLObject<>nil) and (LCLObject is TControl) then begin with TControl(LCLObject) do - DebugLn(' LCL=',Name,':',ClassName,' ',Left,',',Top,',',Width,',',Height); + DebugLn(' LCL=',Name,':',ClassName,' ',dbgs(Left),',',dbgs(Top),',',dbgs(Width),',',dbgs(Height)); end else begin DebugLn(' LCL=',HexStr(Cardinal(LCLObject),8)); end; @@ -5998,7 +5998,8 @@ begin gtk_clist_set_column_justification(CListWidget,i, aGTKJUSTIFICATION[Alignment]); //set width - gtk_clist_set_column_width(CListWidget,i,Width); + if Width>0 then + gtk_clist_set_column_width(CListWidget,i,Width); //set auto sizing gtk_clist_set_column_auto_resize(CListWidget,i, AutoSize); //set Visible @@ -9214,6 +9215,9 @@ end; { ============================================================================= $Log$ + Revision 1.519 2004/08/09 18:22:08 mattias + fixed type of Low(open array) and type of PathDelim + Revision 1.518 2004/07/30 20:55:16 vincents updated localization