diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 76595d4bcc..3d4dd139e3 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -2686,7 +2686,7 @@ begin end else begin Exclude(Params.Flags,fdfIgnoreCurContextNode); {$IFDEF ShowTriedContexts} - DebugLn('[TFindDeclarationTool.FindIdentifierInContext] IgnoreCurContext'); + DebugLn('[TFindDeclarationTool.FindIdentifierInContext] IgnoreCurContext '); {$ENDIF} end; if LastContextNode=ContextNode then begin @@ -5109,7 +5109,7 @@ var RaiseExceptionFmt(ctsStrExpectedButAtomFound,['.',GetAtom]); end; - procedure InitAtomQueue; + function InitAtomQueue: boolean; procedure RaiseInternalError; begin @@ -5118,18 +5118,25 @@ var end; begin + Result:=false; if StartPos<1 then StartPos:=FindStartOfVariable(EndPos) else if EndPos<1 then EndPos:=FindEndOfVariable(StartPos,true); if (StartPos<1) then RaiseInternalError; + if StartPos>SrcLen then exit; + if StartPos=EndPos then begin + // e.g. cursor behind semicolon, keyword or closing bracket + exit; + end; {$IFDEF ShowExprEval} - DebugLn(' InitAtomQueue Expr="',copy(Src,StartPos,EndPos-StartPos),'"'); + DebugLn([' InitAtomQueue StartPos=',StartPos,' EndPos=',EndPos,' Expr="',copy(Src,StartPos,EndPos-StartPos),'"']); {$ENDIF} LastAtomType:=vatNone; MoveCursorToCleanPos(StartPos); ReadNextAtom; + if CurPos.StartPos>SrcLen then exit; CurAtom:=CurPos; CurAtomType:=GetCurrentAtomType; if CurAtomType in [vatRoundBracketOpen,vatEdgedBracketOpen] then @@ -5143,6 +5150,7 @@ var NextAtomType:=vatSpace; MoveCursorToCleanPos(CurAtom.StartPos); IsIdentEndOfVar:=iieovUnknown; + Result:=true; end; procedure ReadNextExpressionAtom; @@ -5658,9 +5666,6 @@ begin StartFlags:=Params.Flags; StartContext.Node:=Params.ContextNode; StartContext.Tool:=Self; - ExprType.Desc:=xtContext; - ExprType.SubDesc:=xtNone; - ExprType.Context:=StartContext; {$IFDEF ShowExprEval} DebugLn('[TFindDeclarationTool.FindExpressionTypeOfVariable]', ' Flags=[',FindDeclarationFlagsAsString(Params.Flags),']', @@ -5668,7 +5673,10 @@ begin ); {$ENDIF} - InitAtomQueue; + if not InitAtomQueue then exit; + ExprType.Desc:=xtContext; + ExprType.SubDesc:=xtNone; + ExprType.Context:=StartContext; repeat {$IFDEF ShowExprEval} DebugLn(' FindExpressionTypeOfVariable CurAtomType=', diff --git a/components/lazreport/samples/editor/calleditorwithpkg.lpi b/components/lazreport/samples/editor/calleditorwithpkg.lpi index 42e78c5500..b53f92929d 100644 --- a/components/lazreport/samples/editor/calleditorwithpkg.lpi +++ b/components/lazreport/samples/editor/calleditorwithpkg.lpi @@ -12,7 +12,7 @@ - <ActiveEditorIndexAtStart Value="3"/> + <ActiveEditorIndexAtStart Value="0"/> </General> <RST OutDir="languages"/> <PublishOptions> @@ -61,8 +61,8 @@ <IsPartOfProject Value="True"/> <ResourceFilename Value="maincalleditor.lrs"/> <UnitName Value="maincalleditor"/> - <CursorPos X="41" Y="222"/> - <TopLine Value="188"/> + <CursorPos X="31" Y="209"/> + <TopLine Value="8"/> <EditorIndex Value="0"/> <UsageCount Value="200"/> <Loaded Value="True"/> diff --git a/components/lazreport/samples/editor/db/disco.dbf b/components/lazreport/samples/editor/db/disco.dbf index 1e460be396..8138f58df5 100644 Binary files a/components/lazreport/samples/editor/db/disco.dbf and b/components/lazreport/samples/editor/db/disco.dbf differ diff --git a/components/printers/Makefile b/components/printers/Makefile index 48fbe05922..155e4e3319 100644 --- a/components/printers/Makefile +++ b/components/printers/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/09/04] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/08/16] # default: all MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded diff --git a/components/printers/readme.txt b/components/printers/readme.txt index 0334fa1021..61ca773b4f 100644 --- a/components/printers/readme.txt +++ b/components/printers/readme.txt @@ -27,6 +27,6 @@ Linux : Yous must install CUPS and libcups v1.1.19 or more. FAQ : - Q:If I use Printers unit, the call of printer object générate an exception "Access Violation" + Q:If I use Printers unit, the call of printer object generate an exception "Access Violation" R:Add in uses clause of your project, osPrinters diff --git a/components/printers/unix/cupsprinters.inc b/components/printers/unix/cupsprinters.inc index 3e34ecdf97..2bd93c41dd 100644 --- a/components/printers/unix/cupsprinters.inc +++ b/components/printers/unix/cupsprinters.inc @@ -801,8 +801,6 @@ begin end; function TCUPSPrinter.DoGetPaperName: string; -var - s: string; begin if not (cpsPaperNameValid in FStates) then begin // paper is not yet retrieved for first time