Skip to content

Commit c5c2f98

Browse files
committed
Fixed crash at init project if array of lang was not filled. (2)
1 parent 36fcef0 commit c5c2f98

File tree

2 files changed

+64
-42
lines changed

2 files changed

+64
-42
lines changed

src/ideU.prj

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ findinfiledialog=95
8181
[findinfileadialogfo.wholeword]
8282
value=0
8383
[findinfileadialogfo.indirectories]
84-
value=1
85-
[findinfileadialogfo.inprojectdir]
8684
value=0
85+
[findinfileadialogfo.inprojectdir]
86+
value=1
8787
[findinfileadialogfo.casesensitive]
8888
value=0
8989
[findinfileadialogfo.mask]
@@ -139,8 +139,9 @@ findinfiledialog=95
139139
filefilterindex=0
140140
filefilter="*.pas" "*.pp" "*.inc" "*.prj"
141141
[findinfileadialogfo.findtext]
142-
value=ac_invalidexception
142+
value=ma_str_classtype
143143
history=20
144+
ma_str_classtype
144145
ac_invalidexception
145146
sc_exception
146147
ma_formfile
@@ -160,7 +161,6 @@ findinfiledialog=95
160161
version
161162
openpro
162163
openproject
163-
(Lang)
164164
[findinfileadialogfo]
165165
stackedunder=
166166
x=205
@@ -1583,22 +1583,27 @@ findhistory=20
15831583
FpStat
15841584
info :=
15851585
findoptions=1
1586-
editpos=3
1587-
0,7
1586+
editpos=4
1587+
22,992
15881588
0,0
15891589
0,-1073741823
1590+
0,18
15901591
bookmarks0=0
15911592
bookmarks1=0
15921593
bookmarks2=0
1593-
sourcefiles=3
1594+
bookmarks3=0
1595+
sourcefiles=4
15941596
${PROJECTDIR}/main.pas
15951597
${PROJECTDIR}/sourceform.pas
15961598
${PROJECTDIR}/actionsmodule.pas
1597-
relpaths=3
1599+
${PROJECTDIR}/captionideu.pas
1600+
relpaths=4
15981601
main.pas
15991602
sourceform.pas
16001603
actionsmodule.pas
1601-
ismoduletexts=3
1604+
captionideu.pas
1605+
ismoduletexts=4
1606+
0
16021607
0
16031608
0
16041609
0
@@ -1619,10 +1624,15 @@ nomenumodules=3
16191624
0
16201625
0
16211626
[sourcefo.files_tab]
1627+
order=4
1628+
0
1629+
3
1630+
1
1631+
2
16221632
firsttab=0
16231633
index=0
16241634
[layout]
1625-
windowlayout=525
1635+
windowlayout=531
16261636
[mainfo.basedock]
16271637
splitdir=2
16281638
useroptions=268450944
@@ -1642,7 +1652,7 @@ windowlayout=525
16421652
cy=621
16431653
rcx=0
16441654
rcy=0
1645-
wsize=0
1655+
wsize=6
16461656
active=1
16471657
visible=1
16481658
[findmessagefo.findtext]
@@ -1672,7 +1682,7 @@ windowlayout=525
16721682
rcy=0
16731683
wsize=0
16741684
active=0
1675-
visible=0
1685+
visible=1
16761686
[threadsfo]
16771687
splitdir=0
16781688
useroptions=268451945
@@ -1740,7 +1750,7 @@ windowlayout=525
17401750
[findinfilefo]
17411751
splitdir=0
17421752
useroptions=268451947
1743-
stackedunder=
1753+
stackedunder=targetconsolefo
17441754
parent=
17451755
mdistate=0
17461756
nx=0
@@ -1766,7 +1776,7 @@ windowlayout=525
17661776
x=0
17671777
y=0
17681778
cx=205
1769-
cy=448
1779+
cy=522
17701780
rcx=0
17711781
rcy=0
17721782
[projecttreefo.grid]
@@ -1934,9 +1944,9 @@ windowlayout=525
19341944
ncx=0
19351945
ncy=0
19361946
x=0
1937-
y=508
1938-
cx=1212
1939-
cy=92
1947+
y=583
1948+
cx=1354
1949+
cy=107
19401950
rcx=0
19411951
rcy=0
19421952
[componentstorefo]
@@ -2035,8 +2045,8 @@ windowlayout=525
20352045
ncy=0
20362046
x=0
20372047
y=0
2038-
cx=1212
2039-
cy=54
2048+
cx=1354
2049+
cy=55
20402050
rcx=0
20412051
rcy=0
20422052
[debuggerfo.basedock]
@@ -2051,8 +2061,8 @@ windowlayout=525
20512061
ncy=61
20522062
x=0
20532063
y=0
2054-
cx=1212
2055-
cy=61
2064+
cx=1354
2065+
cy=62
20562066
rcx=0
20572067
rcy=0
20582068
[debuggerfo.edit_options]
@@ -2062,8 +2072,9 @@ windowlayout=525
20622072
[debuggerfo.edit_compiler]
20632073
value=Pascal
20642074
[debuggerfo.file_history]
2065-
value=/home/fred/mseide-msegui/apps/ide/actionsmodule.mfm
2066-
history=4
2075+
value=/home/fred/ideU/src/main.pas
2076+
history=5
2077+
/home/fred/ideU/src/actionsmodule.pas
20672078
/home/fred/mseide-msegui/apps/ide/actionsmodule.mfm
20682079

20692080
/home/fred/ideU/src/layout
@@ -2084,11 +2095,16 @@ windowlayout=525
20842095
ncy=0
20852096
x=208
20862097
y=0
2087-
cx=1004
2088-
cy=448
2098+
cx=1146
2099+
cy=522
20892100
rcx=0
20902101
rcy=0
20912102
[sourcefo.files_tab]
2103+
order=4
2104+
0
2105+
3
2106+
1
2107+
2
20922108
firsttab=0
20932109
index=0
20942110
[confideufo.usedefaulteditoroptions]
@@ -2124,9 +2140,9 @@ windowlayout=525
21242140
ncx=0
21252141
ncy=0
21262142
x=0
2127-
y=57
2128-
cx=1212
2129-
cy=448
2143+
y=58
2144+
cx=1354
2145+
cy=522
21302146
rcx=0
21312147
rcy=0
21322148
[_mse_mainfo_mse_]

src/main.pas

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -971,35 +971,41 @@ procedure checkmodule(fname: filenamety);
971971

972972
if (length(lang_mainform) > Ord(ma_str_classtype)) and
973973
(length(lang_stockcaption) > Ord(sc_warningupper))then
974-
975-
action := ShowMessage(lang_mainform[Ord(ma_str_classtype)] + ' ' +
974+
975+
action := ShowMessage(lang_mainform[Ord(ma_str_classtype)] + ' ' +
976976
utf8decode(atypename) + ' ' +
977977
lang_actionsmodule[ord(ac_notfound)] + lineend +
978978
' ' + lang_mainform[Ord(ma_wishsearch)], lang_stockcaption[Ord(sc_warningupper)],
979979
[mr_yes, mr_cancel], mr_yes ) else
980980

981981
begin
982-
action := ShowMessage('ma_str_classtype) ' +
983-
utf8decode(atypename) + ' ' +
984-
'ac_notfound' + lineend +
985-
' ma_wishsearch?', 'sc_warningupper');
982+
action := ShowMessage('Classtype ' +
983+
utf8decode(atypename) +
984+
' not found.' + lineend +
985+
'Do you wish to search the formfile?', 'WARNING');
986986
action := mr_yes;
987987
end;
988988

989989
if action = mr_yes
990990

991-
then
991+
then
992992
begin
993993
wstr2 := '';
994994
openform.controller.showoptions := True;
995-
996-
// if openform.controller.Execute(wstr2, fdk_open, lang_mainform[Ord(ma_formfile)] + ' ' +
997-
998-
if openform.controller.Execute(wstr2, fdk_open, 'ma_formfile' +
999-
1000-
msestring(atypename), [fdo_checkexist]) then
995+
996+
if length(lang_mainform) > Ord(ma_formfile)
997+
then
998+
begin
999+
if openform.controller.Execute(wstr2, fdk_open, lang_mainform[Ord(ma_formfile)] + ' ' +
1000+
msestring(atypename), [fdo_checkexist]) then
10011001
openformfile(wstr2, False, False, False, False, False);
1002-
end;
1002+
end else
1003+
begin
1004+
if openform.controller.Execute(wstr2, fdk_open, 'Formfile for ' +
1005+
msestring(atypename), [fdo_checkexist]) then
1006+
openformfile(wstr2, False, False, False, False, False);
1007+
end;
1008+
end;
10031009
finally
10041010
Dec(fcheckmodulelevel);
10051011
end;

0 commit comments

Comments
 (0)