fixed renaming of published vars, started RepairLFM wizard

git-svn-id: trunk@4888 -
This commit is contained in:
mattias 2003-12-15 21:59:33 +00:00
parent 5e5162e764
commit 901930547e
8 changed files with 508 additions and 25 deletions

View File

@ -752,7 +752,7 @@ begin
Result:='.ppu';
Evaluator:=DefineTree.GetDefinesForDirectory(Directory,true);
if Evaluator=nil then exit;
if Evaluator.IsDefined('WIN32') then
if Evaluator.IsDefined('WIN32') and Evaluator.IsDefined('VER1_0') then
Result:='.ppw';
end;

View File

@ -497,8 +497,7 @@ function TCustomCodeTool.UpAtomIs(const AnAtom: shortstring): boolean;
var AnAtomLen,i : integer;
begin
Result:=false;
if (CurPos.StartPos<SrcLen) and (CurPos.EndPos<=SrcLen+1)
and (CurPos.StartPos>=1) then begin
if (CurPos.EndPos<=SrcLen+1) and (CurPos.StartPos>=1) then begin
AnAtomLen:=length(AnAtom);
if AnAtomLen=CurPos.EndPos-CurPos.StartPos then begin
for i:=1 to AnAtomLen do

View File

@ -2606,7 +2606,7 @@ var
procedure ProcessOutputLine(var Line: string);
var
SymbolName, SymbolValue, UpLine: string;
SymbolName, SymbolValue, UpLine, NewPath: string;
i: integer;
begin
UpLine:=UpperCaseStr(Line);
@ -2643,7 +2643,10 @@ var
DefineSymbol(SymbolName,SymbolValue);
end;
end else if copy(UpLine,1,17)='USING UNIT PATH: ' then begin
UnitSearchPath:=UnitSearchPath+copy(Line,18,length(Line)-17)+#13;
NewPath:=copy(Line,18,length(Line)-17);
if not FilenameIsAbsolute(NewPath) then
NewPath:=ExpandFileName(NewPath);
UnitSearchPath:=UnitSearchPath+NewPath+#13;
end;
end;

View File

@ -2680,7 +2680,7 @@ begin
TypeNode:=FindTypeNodeOfDefinition(VarNode);
MoveCursorToNodeStart(TypeNode);
ReadNextAtom;
if UpAtomIs(VarType) then begin
if AtomIs(VarType) then begin
// rename the identifier
MoveCursorToNodeStart(VarNode);
ReadNextAtom;
@ -2699,7 +2699,7 @@ begin
Result:=SourceChangeCache.Apply;
end else begin
// old variable not found -> add it
Result:=AddPublishedVariable(UpperClassName,NewVarName, VarType,
Result:=AddPublishedVariable(UpperClassName,NewVarName,VarType,
SourceChangeCache);
end;
end;

View File

@ -1,11 +1,410 @@
object Form2: TForm2
CAPTION = 'Form2'
CLIENTHEIGHT = 361
CLIENTWIDTH = 458
HORZSCROLLBAR.PAGE = 459
VERTSCROLLBAR.PAGE = 362
LEFT = 368
HEIGHT = 361
TOP = 200
WIDTH = 458
object RepairLFMDialog: TRepairLFMDialog
Caption = 'Repair LFM'
ClientHeight = 425
ClientWidth = 458
HorzScrollBar.Page = 459
VertScrollBar.Page = 426
Left = 368
Height = 425
Top = 200
Width = 458
object CancelButton: TButton
Anchors = [akleft, akbottom]
ModalResult = 2
Caption = 'Cancel'
TabStop = True
TabOrder = 0
Left = 359
Height = 25
Top = 392
Width = 75
end
object RemoveAllButton: TButton
Anchors = [akleft, akbottom]
Caption = 'Remove all invalid properties'
TabStop = True
TabOrder = 1
OnClick = RemoveAllButtonClick
Left = 24
Height = 25
Top = 392
Width = 311
end
object LFMGroupBox: TGroupBox
Anchors = [aktop, akleft, akright, akbottom]
Caption = 'LFM file'
ClientHeight = 247
ClientWidth = 442
Color = -2147483633
ParentColor = True
ParentCtl3D = False
TabOrder = 2
Left = 8
Height = 264
Top = 8
Width = 446
object LFMSynEdit: TSynEdit
Align = alclient
Color = 16777215
Font.Height = -15
Font.Name = 'courier'
Height = 247
Name = 'LFMSynEdit'
ParentCtl3D = False
TabOrder = 0
Width = 442
BookMarkOptions.OnChange = nil
Gutter.OnChange = nil
Keystrokes = <
item
Command = 3
ShortCut = 38
end
item
Command = 103
ShortCut = 8230
end
item
Command = 211
ShortCut = 16422
end
item
Command = 4
ShortCut = 40
end
item
Command = 104
ShortCut = 8232
end
item
Command = 212
ShortCut = 16424
end
item
Command = 1
ShortCut = 37
end
item
Command = 101
ShortCut = 8229
end
item
Command = 5
ShortCut = 16421
end
item
Command = 105
ShortCut = 24613
end
item
Command = 2
ShortCut = 39
end
item
Command = 102
ShortCut = 8231
end
item
Command = 6
ShortCut = 16423
end
item
Command = 106
ShortCut = 24615
end
item
Command = 10
ShortCut = 34
end
item
Command = 110
ShortCut = 8226
end
item
Command = 14
ShortCut = 16418
end
item
Command = 114
ShortCut = 24610
end
item
Command = 9
ShortCut = 33
end
item
Command = 109
ShortCut = 8225
end
item
Command = 13
ShortCut = 16417
end
item
Command = 113
ShortCut = 24609
end
item
Command = 7
ShortCut = 36
end
item
Command = 107
ShortCut = 8228
end
item
Command = 15
ShortCut = 16420
end
item
Command = 115
ShortCut = 24612
end
item
Command = 8
ShortCut = 35
end
item
Command = 108
ShortCut = 8227
end
item
Command = 16
ShortCut = 16419
end
item
Command = 116
ShortCut = 24611
end
item
Command = 223
ShortCut = 45
end
item
Command = 201
ShortCut = 16429
end
item
Command = 604
ShortCut = 8237
end
item
Command = 502
ShortCut = 46
end
item
Command = 603
ShortCut = 8238
end
item
Command = 501
ShortCut = 8
end
item
Command = 501
ShortCut = 8200
end
item
Command = 504
ShortCut = 16392
end
item
Command = 601
ShortCut = 32776
end
item
Command = 602
ShortCut = 40968
end
item
Command = 509
ShortCut = 13
end
item
Command = 199
ShortCut = 16449
end
item
Command = 201
ShortCut = 16451
end
item
Command = 610
ShortCut = 24649
end
item
Command = 509
ShortCut = 16461
end
item
Command = 510
ShortCut = 16462
end
item
Command = 503
ShortCut = 16468
end
item
Command = 611
ShortCut = 24661
end
item
Command = 604
ShortCut = 16470
end
item
Command = 603
ShortCut = 16472
end
item
Command = 507
ShortCut = 16473
end
item
Command = 506
ShortCut = 24665
end
item
Command = 601
ShortCut = 16474
end
item
Command = 602
ShortCut = 24666
end
item
Command = 301
ShortCut = 16432
end
item
Command = 302
ShortCut = 16433
end
item
Command = 303
ShortCut = 16434
end
item
Command = 304
ShortCut = 16435
end
item
Command = 305
ShortCut = 16436
end
item
Command = 306
ShortCut = 16437
end
item
Command = 307
ShortCut = 16438
end
item
Command = 308
ShortCut = 16439
end
item
Command = 309
ShortCut = 16440
end
item
Command = 310
ShortCut = 16441
end
item
Command = 351
ShortCut = 24624
end
item
Command = 352
ShortCut = 24625
end
item
Command = 353
ShortCut = 24626
end
item
Command = 354
ShortCut = 24627
end
item
Command = 355
ShortCut = 24628
end
item
Command = 356
ShortCut = 24629
end
item
Command = 357
ShortCut = 24630
end
item
Command = 358
ShortCut = 24631
end
item
Command = 359
ShortCut = 24632
end
item
Command = 360
ShortCut = 24633
end
item
Command = 231
ShortCut = 24654
end
item
Command = 232
ShortCut = 24643
end
item
Command = 233
ShortCut = 24652
end
item
Command = 612
ShortCut = 9
end
item
Command = 613
ShortCut = 8201
end
item
Command = 250
ShortCut = 24642
end>
Lines.Strings = (
'LFMSynEdit'
)
SelectedColor.OnChange = nil
Cursor = 65532
Height = 247
Width = 442
end
end
object ErrorsGroupBox: TGroupBox
Anchors = [akleft, akright, akbottom]
Caption = 'Errors'
ClientHeight = 87
ClientWidth = 442
Color = -2147483633
ParentColor = True
ParentCtl3D = False
TabOrder = 3
Left = 8
Height = 104
Top = 280
Width = 446
object ErrorsListBox: TListBox
Align = alclient
TabOrder = 0
TabStop = True
TopIndex = -1
Height = 87
Width = 442
end
end
end

View File

@ -1,7 +1,71 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TForm2','FORMDATA',[
'TPF0'#6'TForm2'#5'Form2'#7'CAPTION'#6#5'Form2'#12'CLIENTHEIGHT'#3'i'#1#11'CL'
+'IENTWIDTH'#3#202#1#18'HORZSCROLLBAR.PAGE'#3#203#1#18'VERTSCROLLBAR.PAGE'#3
+'j'#1#4'LEFT'#3'p'#1#6'HEIGHT'#3'i'#1#3'TOP'#3#200#0#5'WIDTH'#3#202#1#0#0
LazarusResources.Add('TRepairLFMDialog','FORMDATA',[
'TPF0'#16'TRepairLFMDialog'#15'RepairLFMDialog'#7'Caption'#6#10'Repair LFM'#12
+'ClientHeight'#3#169#1#11'ClientWidth'#3#202#1#18'HorzScrollBar.Page'#3#203#1
+#18'VertScrollBar.Page'#3#170#1#4'Left'#3'p'#1#6'Height'#3#169#1#3'Top'#3#200
+#0#5'Width'#3#202#1#0#7'TButton'#12'CancelButton'#7'Anchors'#11#6'akleft'#8
+'akbottom'#0#11'ModalResult'#2#2#7'Caption'#6#6'Cancel'#7'TabStop'#9#8'TabOr'
+'der'#2#0#4'Left'#3'g'#1#6'Height'#2#25#3'Top'#3#136#1#5'Width'#2'K'#0#0#7'T'
+'Button'#15'RemoveAllButton'#7'Anchors'#11#6'akleft'#8'akbottom'#0#7'Caption'
+#6#29'Remove all invalid properties'#7'TabStop'#9#8'TabOrder'#2#1#7'OnClick'
+#7#20'RemoveAllButtonClick'#4'Left'#2#24#6'Height'#2#25#3'Top'#3#136#1#5'Wid'
+'th'#3'7'#1#0#0#9'TGroupBox'#11'LFMGroupBox'#7'Anchors'#11#5'aktop'#6'akleft'
+#7'akright'#8'akbottom'#0#7'Caption'#6#8'LFM file'#12'ClientHeight'#3#247#0
+#11'ClientWidth'#3#186#1#5'Color'#4#15#0#0#128#11'ParentColor'#9#11'ParentCt'
+'l3D'#8#8'TabOrder'#2#2#4'Left'#2#8#6'Height'#3#8#1#3'Top'#2#8#5'Width'#3#190
+#1#0#8'TSynEdit'#10'LFMSynEdit'#5'Align'#7#8'alclient'#5'Color'#4#255#255#255
+#0#11'Font.Height'#2#241#9'Font.Name'#6#7'courier'#6'Height'#3#247#0#4'Name'
+#6#10'LFMSynEdit'#11'ParentCtl3D'#8#8'TabOrder'#2#0#5'Width'#3#186#1#24'Book'
+'MarkOptions.OnChange'#13#15'Gutter.OnChange'#13#10'Keystrokes'#14#1#7'Comma'
+'nd'#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Comman'
+'d'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Comm'
+'and'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7
+'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'C'
+'ommand'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'C'
+'ommand'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7
+'Command'#2#6#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7
+'Command'#2#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7
+'Command'#2#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7
+'Command'#2#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'C'
+'ommand'#2#13#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7
+'Command'#2#7#8'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'C'
+'ommand'#2#15#8'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7
+'Command'#2#8#8'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'C'
+'ommand'#2#16#8'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7
+'Command'#3#223#0#8'ShortCut'#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0
+#1#7'Command'#3'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2
+'.'#0#1#7'Command'#3'['#2#8'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCu'
+'t'#2#8#0#1#7'Command'#3#245#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'S'
+'hortCut'#3#8'@'#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command'
+#3'Z'#2#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7
+'Command'#3#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@'
+#0#1#7'Command'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3
+'M@'#0#1#7'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'Short'
+'Cut'#3'T@'#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8
+'ShortCut'#3'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251
+#1#8'ShortCut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'
+#3'Y'#2#8'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Comm'
+'and'#3'-'#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7
+'Command'#3'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0
+#1#7'Command'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5'
+'@'#0#1#7'Command'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'
+#3'7@'#0#1#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'Short'
+'Cut'#3'9@'#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8
+'ShortCut'#3'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'
+#1#8'ShortCut'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3
+'d'#1#8'ShortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Comman'
+'d'#3'f'#1#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'C'
+'ommand'#3'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0
+#1#7'Command'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3
+'L`'#0#1#7'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'
+#3#9' '#0#1#7'Command'#3#250#0#8'ShortCut'#3'B`'#0#0#13'Lines.Strings'#1#6#10
+'LFMSynEdit'#0#22'SelectedColor.OnChange'#13#6'Cursor'#4#252#255#0#0#6'Heigh'
+'t'#3#247#0#5'Width'#3#186#1#0#0#0#9'TGroupBox'#14'ErrorsGroupBox'#7'Anchors'
+#11#6'akleft'#7'akright'#8'akbottom'#0#7'Caption'#6#6'Errors'#12'ClientHeigh'
+'t'#2'W'#11'ClientWidth'#3#186#1#5'Color'#4#15#0#0#128#11'ParentColor'#9#11
+'ParentCtl3D'#8#8'TabOrder'#2#3#4'Left'#2#8#6'Height'#2'h'#3'Top'#3#24#1#5'W'
,'idth'#3#190#1#0#8'TListBox'#13'ErrorsListBox'#5'Align'#7#8'alclient'#8'TabO'
+'rder'#2#0#7'TabStop'#9#8'TopIndex'#2#255#6'Height'#2'W'#5'Width'#3#186#1#0#0
+#0#0
]);

View File

@ -38,18 +38,29 @@ unit DelphiUnit2Laz;
interface
uses
// FCL+LCL
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
FileCtrl, CodeCache, CodeToolManager, DefineTemplates,
Buttons, StdCtrls, FileCtrl,
// Components
SynEdit, CodeCache, CodeToolManager, DefineTemplates,
// IDE
DialogProcs, IDEProcs, LazarusIDEStrConsts;
type
TForm2 = class(TForm)
TRepairLFMDialog = class(TForm)
ErrorsGroupBox: TGroupBox;
LFMGroupBox: TGroupBox;
ErrorsListBox: TListBox;
RemoveAllButton: TButton;
CancelButton: TButton;
LFMSynEdit: TSynEdit;
procedure RemoveAllButtonClick(Sender: TObject);
private
public
end;
var
Form2: TForm2;
RepairLFMDialog: TRepairLFMDialog;
function CheckDelphiFileExt(const Filename: string): TModalResult;
function CheckFilenameForLCLPaths(const Filename: string): TModalResult;
@ -215,6 +226,13 @@ begin
Result:=mrOk;
end;
{ TRepairLFMDialog }
procedure TRepairLFMDialog.RemoveAllButtonClick(Sender: TObject);
begin
end;
initialization
{$I delphiunit2laz.lrs}

View File

@ -16,7 +16,7 @@ if [ "x$FPCRPM" = "x" ]; then
fi
Date=20$Year$Month$Day
LazVersion=0.9.0.6
LazVersion=0.9.0.7
LazRelease=`echo $FPCRPM | sed -e 's/-/_/g'`
SrcTGZ=lazarus-$Date.tgz
TmpDir=/tmp/lazarus$LazVersion