Bug Report T146438
Visible to All Users

Ribbon - A bar manager's SaveTo~ methods store incorrect settings if the Ribbon control has merged tabs

created 11 years ago

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;

Comments (1)
DevExpress Support Team 11 years ago

    Hello,

    Thank you for your report. It really looks like a bug. I have forwarded this ticket to our developers for research.

    Answers approved by DevExpress Support

    created 11 years ago

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.