mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 18:00:24 +02:00
Use Delete() instead of Copy() where appropriate.
git-svn-id: trunk@55311 -
This commit is contained in:
parent
635343f2b8
commit
4c7dc1b89b
@ -1322,7 +1322,7 @@ begin
|
||||
if (BaseDir<>'') then
|
||||
for i:=0 to Result.Count-1 do begin
|
||||
Filename:=Result[i];
|
||||
Filename:=copy(Filename,BaseDirLen+1,length(Filename));
|
||||
delete(Filename,1,BaseDirLen);
|
||||
if (Filename<>'') and (Filename[1]=PathDelim) then
|
||||
System.Delete(Filename,1,1);
|
||||
Result[i]:=Filename;
|
||||
|
@ -283,10 +283,10 @@ begin
|
||||
p:=0;
|
||||
while Filename<>'' do begin
|
||||
// get the next file name part
|
||||
DelimPos:=System.Pos(PathDelim,Filename);
|
||||
DelimPos:=Pos(PathDelim,Filename);
|
||||
if DelimPos>0 then begin
|
||||
FilePart:=copy(Filename,1,DelimPos-1);
|
||||
Filename:=copy(Filename,DelimPos+1,length(Filename));
|
||||
delete(Filename,1,DelimPos);
|
||||
end else begin
|
||||
FilePart:=Filename;
|
||||
Filename:='';
|
||||
|
@ -416,7 +416,7 @@ procedure TCustomSynAutoComplete.ParseCompletionList;
|
||||
if (i<length(Pattern)) and (Pattern[i+1] in [#10,#13])
|
||||
and (Pattern[i+1]<>Pattern[i]) then
|
||||
inc(i);
|
||||
Pattern:=copy(Pattern,i+1,length(Pattern));
|
||||
delete(Pattern,1,i);
|
||||
end;
|
||||
|
||||
var
|
||||
|
@ -1622,9 +1622,9 @@ begin
|
||||
DebugLn('TConvertDelphiProject.FindAllUnits: '+lisConvDelphiFoundAllUnitFiles);
|
||||
for i:=0 to FoundUnits.Count-1 do begin
|
||||
CurFilename:=FoundUnits[i];
|
||||
p:=System.Pos(' in ',CurFilename);
|
||||
p:=Pos(' in ',CurFilename);
|
||||
if p>0 then
|
||||
CurFilename:=copy(CurFilename,p+4,length(CurFilename));
|
||||
delete(CurFilename,1,p+3);
|
||||
if CurFilename='' then continue;
|
||||
Result:=AddUnit(SwitchPathDelims(CurFilename, True), ui);
|
||||
if Result=mrAbort then
|
||||
@ -1930,7 +1930,7 @@ begin
|
||||
CurFilename:=FoundUnits[i];
|
||||
p:=System.Pos(' in ',CurFilename);
|
||||
if p>0 then
|
||||
CurFilename:=copy(CurFilename,p+4,length(CurFilename));
|
||||
delete(CurFilename,1,p+3);
|
||||
if CurFilename='' then continue;
|
||||
Result:=AddUnit(SwitchPathDelims(CurFilename, True));
|
||||
if Result=mrAbort then
|
||||
|
@ -435,7 +435,7 @@ begin
|
||||
p:=System.Pos('/',aTVPath);
|
||||
if p>0 then begin
|
||||
NodeText:=copy(aTVPath,1,p-1);
|
||||
aTVPath:=Copy(aTVPath,p+1,length(aTVPath));
|
||||
Delete(aTVPath,1,p);
|
||||
end else begin
|
||||
NodeText:=aTVPath;
|
||||
end;
|
||||
|
@ -1027,7 +1027,7 @@ procedure TCodeContextFrm.CompleteParameters(DeclCode: string);
|
||||
dec(Indent,CodeToolBoss.SourceChangeCache.BeautifyCodeOptions.Indent);
|
||||
NewCode:=CodeToolBoss.SourceChangeCache.BeautifyCodeOptions.BeautifyStatement(
|
||||
NewCode,Indent,[],X);
|
||||
NewCode:=copy(NewCode,Indent+1,length(NewCode));
|
||||
delete(NewCode,1,Indent);
|
||||
if NewCode='' then begin
|
||||
ShowMessage(lisAllParametersOfThisFunctionAreAlreadySetAtThisCall);
|
||||
exit;
|
||||
|
@ -370,7 +370,7 @@ var
|
||||
begin
|
||||
s:=CheckListBox1.Items[ListIndex];
|
||||
if (s<>'') and (s[1]='*') then // Modified indicator
|
||||
s:=copy(s, 3, Length(s));
|
||||
delete(s, 1, 2);
|
||||
Result:=SourceEditorManager.SourceEditorIntfWithFilename(s);
|
||||
end;
|
||||
|
||||
|
@ -447,7 +447,7 @@ var
|
||||
if p<1 then exit;
|
||||
PackageName:=copy(Link,2,p-2);
|
||||
if SysUtils.CompareText(PackageName,OldPackageName)<>0 then exit;
|
||||
Link:=copy(Link,p+1,length(Link));
|
||||
delete(Link,1,p);
|
||||
end;
|
||||
if (SysUtils.CompareText(Link,OldElementName)=0)
|
||||
or (SysUtils.CompareText(Link,OldModuleName+'.'+OldElementName)=0) then
|
||||
|
@ -12237,7 +12237,7 @@ begin
|
||||
if i>0 then begin
|
||||
i:=PosEx(' ', PropDetails, i+1);
|
||||
if i>0 then
|
||||
PropDetails:=Copy(PropDetails, i+1, Length(PropDetails));
|
||||
Delete(PropDetails, 1, i);
|
||||
end;
|
||||
OI.StatusBar.SimpleText:=PropDetails; // Show in OI StatusBar
|
||||
end;
|
||||
|
@ -4051,7 +4051,7 @@ begin
|
||||
else begin
|
||||
CurPath:=copy(ExtractFilePath(Result),1,length(BaseDir));
|
||||
if CompareFilenames(BaseDir,CurPath)=0 then
|
||||
Result:=copy(Result,length(CurPath)+1,length(Result));
|
||||
delete(Result,1,length(CurPath));
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -89,8 +89,8 @@ begin
|
||||
Extensions:=GetFileExtensions;
|
||||
if Extensions='' then exit;
|
||||
Ext:=FileExtension;
|
||||
if Ext[1]='.' then begin
|
||||
Ext:=copy(Ext,2,length(Ext));
|
||||
if Ext[1]='.' then begin
|
||||
delete(Ext,1,1);
|
||||
if Ext='' then exit;
|
||||
end;
|
||||
StartPos:=1;
|
||||
|
Loading…
Reference in New Issue
Block a user