editor toolbar: made loading toolbar settings more robuste from Boguslaw Brandys (bug #10099)

git-svn-id: trunk@14744 -
This commit is contained in:
vincents 2008-04-03 09:30:18 +00:00
parent 97d94e40f4
commit 952a8829f5
2 changed files with 22 additions and 16 deletions

View File

@ -205,15 +205,18 @@ begin
for i := 1 to c do for i := 1 to c do
begin begin
value := cfg.GetValue('Button' + Format('%2.2d', [i]) + '/Value', ''); value := cfg.GetValue('Button' + Format('%2.2d', [i]) + '/Value', '');
if value <> '' then
begin
if value = cDivider then if value = cDivider then
AddDivider AddDivider
else else
begin begin
mi := IDEMenuRoots.FindByPath(value, True); mi := IDEMenuRoots.FindByPath(value,false);
if Assigned(mi) then if Assigned(mi) then
AddButton(mi); AddButton(mi);
end; end;
end; end;
end;
finally finally
cfg.Free; cfg.Free;
TB.EndUpdate; TB.EndUpdate;

View File

@ -196,16 +196,19 @@ begin
for i := 0 to c - 1 do for i := 0 to c - 1 do
begin begin
value := cfg.GetValue('Button' + Format('%2.2d', [i+1]) + '/Value', ''); value := cfg.GetValue('Button' + Format('%2.2d', [i+1]) + '/Value', '');
if value <> '' then
begin
if value = cDivider then if value = cDivider then
begin begin
lbToolbar.Items.Add(value); lbToolbar.Items.Add(value);
Continue; Continue;
end; end;
mi := IDEMenuRoots.FindByPath(value, true); mi := IDEMenuRoots.FindByPath(value, false);
if Assigned(mi) then if Assigned(mi) then
lbToolbar.Items.AddObject(mi.Caption, TObject(mi)); lbToolbar.Items.AddObject(mi.Caption, TObject(mi));
end; end;
end;
finally finally
cfg.Free; cfg.Free;
end; end;