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
begin
value := cfg.GetValue('Button' + Format('%2.2d', [i]) + '/Value', '');
if value = cDivider then
AddDivider
else
begin
mi := IDEMenuRoots.FindByPath(value, True);
if Assigned(mi) then
AddButton(mi);
end;
end;
if value <> '' then
begin
if value = cDivider then
AddDivider
else
begin
mi := IDEMenuRoots.FindByPath(value,false);
if Assigned(mi) then
AddButton(mi);
end;
end;
end;
finally
cfg.Free;
TB.EndUpdate;

View File

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