mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 01:49:25 +02:00
Formatting
git-svn-id: trunk@62168 -
This commit is contained in:
parent
557305381b
commit
45446f15b8
@ -2924,7 +2924,8 @@ end;
|
|||||||
function TFindDeclarationTool.FindDeclarationInUsesSection(
|
function TFindDeclarationTool.FindDeclarationInUsesSection(
|
||||||
UsesNode: TCodeTreeNode; CleanPos: integer;
|
UsesNode: TCodeTreeNode; CleanPos: integer;
|
||||||
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
out NewPos: TCodeXYPosition; out NewTopLine: integer): boolean;
|
||||||
var AUnitName, UnitInFilename: string;
|
var
|
||||||
|
AUnitName, UnitInFilename: string;
|
||||||
UnitNamePos, UnitInFilePos: TAtomPosition;
|
UnitNamePos, UnitInFilePos: TAtomPosition;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
|
@ -106,8 +106,7 @@ type
|
|||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
|
|
||||||
// uses sections
|
// uses sections
|
||||||
function RenameUsedUnit(const OldUnitName, NewUnitName,
|
function RenameUsedUnit(const OldUnitName, NewUnitName, NewUnitInFile: string;
|
||||||
NewUnitInFile: string;
|
|
||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
function ReplaceUsedUnits(UnitNamePairs: TStringToStringTree; // ToDo: dotted
|
function ReplaceUsedUnits(UnitNamePairs: TStringToStringTree; // ToDo: dotted
|
||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
@ -122,8 +121,7 @@ type
|
|||||||
function AddUnitToMainUsesSection(const NewUnitName, NewUnitInFile: string;
|
function AddUnitToMainUsesSection(const NewUnitName, NewUnitInFile: string;
|
||||||
SourceChangeCache: TSourceChangeCache;
|
SourceChangeCache: TSourceChangeCache;
|
||||||
AsLast: boolean = false; CheckSpecialUnits: boolean = true): boolean;
|
AsLast: boolean = false; CheckSpecialUnits: boolean = true): boolean;
|
||||||
function AddUnitToImplementationUsesSection(const NewUnitName,
|
function AddUnitToImplementationUsesSection(const NewUnitName, NewUnitInFile: string;
|
||||||
NewUnitInFile: string;
|
|
||||||
SourceChangeCache: TSourceChangeCache;
|
SourceChangeCache: TSourceChangeCache;
|
||||||
AsLast: boolean = false; CheckSpecialUnits: boolean = true): boolean;
|
AsLast: boolean = false; CheckSpecialUnits: boolean = true): boolean;
|
||||||
function UnitExistsInUsesSection(UsesSection: TUsesSection;
|
function UnitExistsInUsesSection(UsesSection: TUsesSection;
|
||||||
@ -426,7 +424,8 @@ end;
|
|||||||
|
|
||||||
function TStandardCodeTool.RenameSource(const NewName: string;
|
function TStandardCodeTool.RenameSource(const NewName: string;
|
||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
var NamePos: TAtomPosition;
|
var
|
||||||
|
NamePos: TAtomPosition;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
BuildTree(lsrSourceName);
|
BuildTree(lsrSourceName);
|
||||||
@ -435,17 +434,16 @@ begin
|
|||||||
or (Length(NewName)>255) then exit;
|
or (Length(NewName)>255) then exit;
|
||||||
//debugln(['TStandardCodeTool.RenameSource OldName="',dbgstr(copy(Src,NamePos.StartPos,NamePos.EndPos-NamePos.StartPos)),'"']);
|
//debugln(['TStandardCodeTool.RenameSource OldName="',dbgstr(copy(Src,NamePos.StartPos,NamePos.EndPos-NamePos.StartPos)),'"']);
|
||||||
SourceChangeCache.MainScanner:=Scanner;
|
SourceChangeCache.MainScanner:=Scanner;
|
||||||
SourceChangeCache.Replace(gtNone,gtNone,NamePos.StartPos,NamePos.EndPos,
|
SourceChangeCache.Replace(gtNone,gtNone,NamePos.StartPos,NamePos.EndPos,NewName);
|
||||||
NewName);
|
|
||||||
if not SourceChangeCache.Apply then exit;
|
if not SourceChangeCache.Apply then exit;
|
||||||
CachedSourceName:=NewName;
|
CachedSourceName:=NewName;
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TStandardCodeTool.RenameUsedUnit(const OldUnitName,
|
function TStandardCodeTool.RenameUsedUnit(const OldUnitName, NewUnitName,
|
||||||
NewUnitName, NewUnitInFile: string;
|
NewUnitInFile: string; SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
var
|
||||||
var UnitPos, InPos: TAtomPosition;
|
UnitPos, InPos: TAtomPosition;
|
||||||
NewUsesTerm: string;
|
NewUsesTerm: string;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
|
@ -5247,8 +5247,7 @@ begin
|
|||||||
if (pfMainUnitIsPascalSource in Flags) then
|
if (pfMainUnitIsPascalSource in Flags) then
|
||||||
begin
|
begin
|
||||||
// rename unit in program uses section
|
// rename unit in program uses section
|
||||||
CodeToolBoss.RenameUsedUnit(MainUnitInfo.Source, OldUnitName,
|
CodeToolBoss.RenameUsedUnit(MainUnitInfo.Source, OldUnitName, NewUnitName, '');
|
||||||
NewUnitName, '');
|
|
||||||
end;
|
end;
|
||||||
if MainUnitInfo = AnUnitInfo then
|
if MainUnitInfo = AnUnitInfo then
|
||||||
begin
|
begin
|
||||||
|
@ -34,11 +34,12 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, StrUtils, Zipper,
|
Classes, SysUtils, StrUtils, Zipper,
|
||||||
// LCL
|
// LCL
|
||||||
LCLType, Forms, Controls, StdCtrls, Dialogs, ExtCtrls, Buttons, ButtonPanel,
|
LCLType, Forms, Controls, StdCtrls, Dialogs, Buttons, ButtonPanel,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
FileUtil, LazFileUtils, LazLoggerBase,
|
FileUtil, LazFileUtils, LazLoggerBase,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
IDEWindowIntf, IDEHelpIntf, IDEDialogs, IDEImagesIntf, ProjPackIntf, CompOptsIntf, LazIDEIntf, LCLIntf,
|
IDEWindowIntf, IDEHelpIntf, IDEDialogs, IDEImagesIntf, ProjPackIntf, CompOptsIntf,
|
||||||
|
LazIDEIntf, LCLIntf,
|
||||||
// IDE
|
// IDE
|
||||||
ProjectDefs, Project, PackageDefs, PublishModule, IDEOptionDefs, InputHistory,
|
ProjectDefs, Project, PackageDefs, PublishModule, IDEOptionDefs, InputHistory,
|
||||||
LazarusIDEStrConsts, IDEProcs, EnvironmentOpts, CompilerOptions;
|
LazarusIDEStrConsts, IDEProcs, EnvironmentOpts, CompilerOptions;
|
||||||
|
Loading…
Reference in New Issue
Block a user