The procedure TdxBarManager.SaveBarManager checks the flag "MergeData.CreatedByMerging" if it should save bars to inifile
The last line of the procedure is
…
IniFileCollectionCallMethods(WriteIniFileHandlers, ADestination, AStoringKind, ASection);
this ends up in
procedure TdxRibbonTab.SaveToIni
The procedure TdxRibbonTab.SaveToIni does not check the flag MergeData.CreatedByMerging, resulting in merged tabs always being saved to inifile.
The result of this is that previously (temporary) tabs will be loaded from inifile.
Is this a bug? Changing your code like below fixes the problem.
procedure TdxRibbonTab.SaveToIni(ADestination: TCustomIniFile; const ABaseSection, ADelimiter: string);
var
ASection: string;
I: Integer;
begin
if not MergeData.CreatedByMerging then
begin
ASection := GetIniSection(ABaseSection, ADelimiter);
ADestination.WriteString(ASection, 'Name', Name);
ADestination.WriteString(ASection, 'Caption', Caption);
if Context <> nil then
ADestination.WriteString(ASection, 'ContextCaption', Context.Caption)
else
ADestination.WriteString(ASection, 'ContextCaption', '');
ADestination.WriteBool(ASection, 'Visible', Visible);
ADestination.WriteInteger(ASection, 'GroupCount', Groups.Count);
for I := 0 to Groups.Count - 1 do
Groups[I].SaveToIni(ADestination, ASection, ADelimiter);
end;
end;
Hello,
Thank you for your report. It really looks like a bug. I have forwarded this ticket to our developers for research.