Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#14624 closed defect (outdated)

Fix for issue in ribbon bar show pages

Reported by: wxBen Owned by:
Priority: normal Milestone:
Component: GUI-all Version: stable-latest
Keywords: ribbon bar page show hide tabs Cc:
Blocked By: Blocking:
Patch: yes


The code is building a sorted array of pages and then looping over them. The second loop skips over pages not shown. However, the code that was building the sorted array was also skipping over pages not shown, yet the loop immediately afterwards assumes that all pages are in the sorted list and it then also skips over pages not shown.

Inspection of the code below shows that the two lines

                    if (!m_pages.Item(i).shown)

should be removed for it to function as intended. Otherwise the list so sorted pages can have fewer entries than numtabs and the second loop will crash or fail.

                wxRibbonPageTabInfoArray sorted_pages;
                for(i = 0; i < numtabs; ++i)
                    // Sneaky obj array trickery to not copy the tab descriptors
                    if (!m_pages.Item(i).shown)
                width -= tabsep * (numtabs - 1);
                for(i = 0; i < numtabs; ++i)
                    wxRibbonPageTabInfo& info = sorted_pages.Item(i);
                    if (!info.shown)

Attachments (1)

ShownPagesFix.patch download (598 bytes) - added by wxBen 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by wxBen


comment:1 Changed 9 years ago by wxBen

  • Resolution set to outdated
  • Status changed from new to closed

comment:2 Changed 9 years ago by wxBen

This is being replaced by a patch with another fix in teh same code.

Note: See TracTickets for help on using tickets.