SynEdit clean up

git-svn-id: trunk@34941 -
This commit is contained in:
martin 2012-01-25 23:26:45 +00:00
parent b9adcfa385
commit 1fc2e095ea
8 changed files with 19 additions and 29 deletions

View File

@ -557,7 +557,6 @@ function TSynLogicalPhysicalConvertor.LogicalToPhysical(AIndex, ABytePos: Intege
var AColOffset: Integer): Integer; var AColOffset: Integer): Integer;
var var
i: integer; i: integer;
CharWidths: TPhysicalCharWidths;
begin begin
{$IFDEF AssertSynMemIndex} {$IFDEF AssertSynMemIndex}
if (ABytePos <= 0) then if (ABytePos <= 0) then

View File

@ -876,12 +876,12 @@ type
procedure ExecuteCommand(Command: TSynEditorCommand; procedure ExecuteCommand(Command: TSynEditorCommand;
const AChar: TUTF8Char; Data: pointer); virtual; const AChar: TUTF8Char; Data: pointer); virtual;
function GetHighlighterAttriAtRowCol(XY: TPoint; var Token: string; function GetHighlighterAttriAtRowCol(XY: TPoint; out Token: string;
var Attri: TSynHighlighterAttributes): boolean; out Attri: TSynHighlighterAttributes): boolean;
function GetHighlighterAttriAtRowColEx(XY: TPoint; var Token: string; function GetHighlighterAttriAtRowColEx(XY: TPoint; out Token: string;
var TokenType, Start: Integer; out TokenType, Start: Integer;
var Attri: TSynHighlighterAttributes): boolean; //L505 out Attri: TSynHighlighterAttributes): boolean; //L505
procedure GetWordBoundsAtRowCol(const XY: TPoint; var StartX, EndX: integer); procedure GetWordBoundsAtRowCol(const XY: TPoint; out StartX, EndX: integer);
function GetWordAtRowCol(XY: TPoint): string; function GetWordAtRowCol(XY: TPoint): string;
function NextTokenPos: TPoint; virtual; deprecated; // use next word pos instead function NextTokenPos: TPoint; virtual; deprecated; // use next word pos instead
function NextWordPos: TPoint; virtual; function NextWordPos: TPoint; virtual;
@ -2149,7 +2149,7 @@ end;
destructor TCustomSynEdit.Destroy; destructor TCustomSynEdit.Destroy;
var var
q,i: integer; i: integer;
begin begin
Application.RemoveOnIdleHandler(@IdleScanRanges); Application.RemoveOnIdleHandler(@IdleScanRanges);
SurrenderPrimarySelection; SurrenderPrimarySelection;
@ -7015,7 +7015,7 @@ end;
procedure TCustomSynEdit.MoveCaretHorz(DX: integer); procedure TCustomSynEdit.MoveCaretHorz(DX: integer);
var var
NewCaret: TPoint; NewCaret: TPoint;
s, a: String; s: String;
PhysicalLineLen: Integer; PhysicalLineLen: Integer;
begin begin
NewCaret:=Point(CaretX+DX,CaretY); NewCaret:=Point(CaretX+DX,CaretY);
@ -7934,7 +7934,7 @@ end;
//L505 begin //L505 begin
function TCustomSynEdit.GetHighlighterAttriAtRowCol(XY: TPoint; function TCustomSynEdit.GetHighlighterAttriAtRowCol(XY: TPoint;
var Token: string; var Attri: TSynHighlighterAttributes): boolean; out Token: string; out Attri: TSynHighlighterAttributes): boolean;
var var
TmpType, TmpStart: Integer; TmpType, TmpStart: Integer;
begin begin
@ -7942,8 +7942,8 @@ begin
end; end;
function TCustomSynEdit.GetHighlighterAttriAtRowColEx(XY: TPoint; function TCustomSynEdit.GetHighlighterAttriAtRowColEx(XY: TPoint;
var Token: string; var TokenType, Start: Integer; out Token: string; out TokenType, Start: Integer;
var Attri: TSynHighlighterAttributes): boolean; out Attri: TSynHighlighterAttributes): boolean;
var var
PosX, PosY: integer; PosX, PosY: integer;
Line: string; Line: string;
@ -7985,7 +7985,7 @@ begin
Result:=(length(c)=1) and (c[1] in IdentChars); Result:=(length(c)=1) and (c[1] in IdentChars);
end; end;
procedure TCustomSynEdit.GetWordBoundsAtRowCol(const XY: TPoint; var StartX, procedure TCustomSynEdit.GetWordBoundsAtRowCol(const XY: TPoint; out StartX,
EndX: integer); // all params are logical (byte) positions EndX: integer); // all params are logical (byte) positions
var var
Line: string; Line: string;

View File

@ -162,7 +162,7 @@ type
{$ENDIF} {$ENDIF}
{ Returns a string that has all the invalid chars of the output format { Returns a string that has all the invalid chars of the output format
replaced with the entries in the replacement array. } replaced with the entries in the replacement array. }
function ReplaceReservedChars(AToken: string; var IsSpace: boolean): string; function ReplaceReservedChars(AToken: string; out IsSpace: boolean): string;
{ Sets the token attribute of the next token to determine the changes { Sets the token attribute of the next token to determine the changes
of colors and font styles so the properties of the next token can be of colors and font styles so the properties of the next token can be
added to the output buffer. } added to the output buffer. }
@ -447,7 +447,7 @@ end;
{$ENDIF} {$ENDIF}
function TSynCustomExporter.ReplaceReservedChars(AToken: string; function TSynCustomExporter.ReplaceReservedChars(AToken: string;
var IsSpace: boolean): string; out IsSpace: boolean): string;
var var
I, ISrc, IDest, SrcLen, DestLen: integer; I, ISrc, IDest, SrcLen, DestLen: integer;
Replace: string; Replace: string;

View File

@ -2885,7 +2885,6 @@ end;
function TSynEditFoldProvider.InfoForFoldAtTextIndex(ALine, AFoldIndex: Integer; function TSynEditFoldProvider.InfoForFoldAtTextIndex(ALine, AFoldIndex: Integer;
HideLen: Boolean; NeedLen: Boolean = True): TSynEditFoldProviderNodeInfo; HideLen: Boolean; NeedLen: Boolean = True): TSynEditFoldProviderNodeInfo;
var var
c: LongInt;
nd: TSynFoldNodeInfo; nd: TSynFoldNodeInfo;
begin begin
Result.LineCount := 0; Result.LineCount := 0;
@ -3900,11 +3899,10 @@ var
end; end;
var var
FldSrcLine, FldSrcIndex, FLdNodeLine, FldLen, FndLen, FldCol: Integer; FldSrcLine, FldSrcIndex, FLdNodeLine, FldLen, FndLen: Integer;
i, j, CurLen: Integer; i, j, CurLen: Integer;
PrevFldSrcLine: Integer; PrevFldSrcLine: Integer;
SubTree: TSynTextFoldAVLTree; SubTree: TSynTextFoldAVLTree;
IsHide: Boolean;
begin begin
Result := False; Result := False;
FldSrcLine := doStart; FldSrcLine := doStart;

View File

@ -54,7 +54,6 @@ type
private private
FFileLineEndType: TSynLinesFileLineEndType; FFileLineEndType: TSynLinesFileLineEndType;
FFileWriteLineEndType: TSynLinesFileLineEndType; FFileWriteLineEndType: TSynLinesFileLineEndType;
FLineEndType: TSynLinesFileLineEndType;
FTextBuffer: TSynEditStringList; FTextBuffer: TSynEditStringList;
FOnSaved: TSavedNotification; FOnSaved: TSavedNotification;
function GetTextChangeStamp: int64; function GetTextChangeStamp: int64;

View File

@ -1453,8 +1453,6 @@ procedure TSynEditSelection.SetEndLineBytePos(Value : TPoint);
var var
s: string; s: string;
{$ENDIF} {$ENDIF}
var
WasAvail: Boolean;
begin begin
if FEnabled then begin if FEnabled then begin
Value.y := MinMax(Value.y, 1, fLines.Count); Value.y := MinMax(Value.y, 1, fLines.Count);
@ -1477,7 +1475,6 @@ begin
{$ENDIF} {$ENDIF}
if (Value.X <> FEndBytePos) or (Value.Y <> FEndLinePos) then begin if (Value.X <> FEndBytePos) or (Value.Y <> FEndLinePos) then begin
WasAvail := SelAvail;
if (ActiveSelectionMode = smColumn) and (Value.X <> FEndBytePos) then if (ActiveSelectionMode = smColumn) and (Value.X <> FEndBytePos) then
FInvalidateLinesMethod(Min(FStartLinePos, Min(FEndLinePos, Value.Y)), FInvalidateLinesMethod(Min(FStartLinePos, Min(FEndLinePos, Value.Y)),
Max(FStartLinePos, Max(FEndLinePos, Value.Y))) Max(FStartLinePos, Max(FEndLinePos, Value.Y)))

View File

@ -572,8 +572,6 @@ var
rcNode: TRect; rcNode: TRect;
ptCenter : TPoint; ptCenter : TPoint;
isPrevLine: Boolean; isPrevLine: Boolean;
i: Integer;
HasExHl: Boolean;
DrawOpts: TDrawNodeSymbolOptions; DrawOpts: TDrawNodeSymbolOptions;
begin begin
isPrevLine := IsFoldHidePreviousLine(iLine); isPrevLine := IsFoldHidePreviousLine(iLine);
@ -624,7 +622,6 @@ var
then then
Canvas.Pen.Color := MarkupInfo.FrameColor; Canvas.Pen.Color := MarkupInfo.FrameColor;
i:= 0;
if isPrevLine and (NodeType = cfCollapsedHide) then if isPrevLine and (NodeType = cfCollapsedHide) then
include(DrawOpts, nsoSubtype); include(DrawOpts, nsoSubtype);
DrawNodeSymbol(Canvas, rcNode, NodeType, DrawOpts); DrawNodeSymbol(Canvas, rcNode, NodeType, DrawOpts);

View File

@ -306,7 +306,7 @@ type
function GetModifierStr : RegExprString; function GetModifierStr : RegExprString;
class function ParseModifiersStr (const AModifiers : RegExprString; class function ParseModifiersStr (const AModifiers : RegExprString;
var AModifiersInt : integer) : boolean; //###0.941 class function now out AModifiersInt : integer) : boolean; //###0.941 class function now
// Parse AModifiers string and return true and set AModifiersInt // Parse AModifiers string and return true and set AModifiersInt
// if it's in format 'ismxrg-ismxrg'. // if it's in format 'ismxrg-ismxrg'.
procedure SetModifierStr (const AModifiers : RegExprString); procedure SetModifierStr (const AModifiers : RegExprString);
@ -340,7 +340,7 @@ type
// insert an operator in front of already-emitted operand // insert an operator in front of already-emitted operand
// Means relocating the operand. // Means relocating the operand.
function ParseReg (paren : integer; var flagp : integer) : PRegExprChar; function ParseReg (paren : integer; out flagp : integer) : PRegExprChar;
// regular expression, i.e. main body or parenthesized thing // regular expression, i.e. main body or parenthesized thing
function ParseBranch (var flagp : integer) : PRegExprChar; function ParseBranch (var flagp : integer) : PRegExprChar;
@ -1328,7 +1328,7 @@ function TRegExpr.GetModifierStr : RegExprString;
--------------------------------------------------------------} --------------------------------------------------------------}
class function TRegExpr.ParseModifiersStr (const AModifiers : RegExprString; class function TRegExpr.ParseModifiersStr (const AModifiers : RegExprString;
var AModifiersInt : integer) : boolean; out AModifiersInt : integer) : boolean;
// !!! Be carefull - this is class function and must not use object instance fields // !!! Be carefull - this is class function and must not use object instance fields
var var
i : integer; i : integer;
@ -1746,7 +1746,7 @@ function TRegExpr.CompileRegExpr (exp : PRegExprChar) : boolean;
end; { of function TRegExpr.CompileRegExpr end; { of function TRegExpr.CompileRegExpr
--------------------------------------------------------------} --------------------------------------------------------------}
function TRegExpr.ParseReg (paren : integer; var flagp : integer) : PRegExprChar; function TRegExpr.ParseReg (paren : integer; out flagp : integer) : PRegExprChar;
// regular expression, i.e. main body or parenthesized thing // regular expression, i.e. main body or parenthesized thing
// Caller must absorb opening parenthesis. // Caller must absorb opening parenthesis.
// Combining parenthesis handling with the base level of regular expression // Combining parenthesis handling with the base level of regular expression