From 53b5ee1c6c3b3927b7d9cb7bf10990f9dea51461 Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 12 Feb 2008 13:51:06 +0000 Subject: [PATCH] h2pas: add missing pointer types now only checks identifiers in types git-svn-id: trunk@14111 - --- components/h2pas/h2pasconvert.pas | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/components/h2pas/h2pasconvert.pas b/components/h2pas/h2pasconvert.pas index f7e87012c1..16b296fecb 100644 --- a/components/h2pas/h2pasconvert.pas +++ b/components/h2pas/h2pasconvert.pas @@ -4261,6 +4261,27 @@ var Result:=CodeToolBoss.SourceChangeCache.Replace(gtNewLine,gtNewLine, InsertPos,InsertPos,NewTxt); end; + + function CheckTypes: boolean; + var + Node: TCodeTreeNode; + begin + Node:=Tool.Tree.Root; + while Node<>nil do begin + if Node.Desc in AllPascalTypes then begin + Tool.MoveCursorToCleanPos(Node.StartPos); + while Tool.CurPos.StartPos=Node.EndPos then break; + if (Tool.CurPos.Flag=cafWord) then + CheckIdentifier(Tool.CurPos.StartPos); + end; + Node:=Node.NextSkipChilds; + end else + Node:=Node.Next; + end; + Result:=true; + end; function AddNeededPointerTypesToSource: boolean; var @@ -4304,13 +4325,7 @@ begin exit; end; // check all used identifiers - Tool.MoveCursorToCleanPos(1); - while Tool.CurPos.StartPos=Tool.SrcLen then break; - if (Tool.CurPos.Flag=cafWord) then - CheckIdentifier(Tool.CurPos.StartPos); - end; + if not CheckTypes then exit; // add all needed pointer types if not AddNeededPointerTypesToSource then exit; finally