Ticket #14924 (closed optimization: fixed)
[patch] cleanup redundant initialization of local variable in src/ribbon/toolbar.cpp
| Reported by: | ettl.martin | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | GUI-all | Version: | 2.9-svn |
| Keywords: | Cc: | ||
| Blocked By: | Patch: | yes | |
| Blocking: |
Description
Please review the attached patch, which cleans up the following code:
wxOrientation major_axis = m_art->GetFlags() & wxRIBBON_BAR_FLOW_VERTICAL ?
wxVERTICAL : wxHORIZONTAL;
// A toolbar should maximize its width whether vertical or horizontal, so
// force the major axis to be horizontal. Without this, there will be
// redundant horizontal space.
major_axis = wxHORIZONTAL;
This local variable is first initialized by wxVERTICAL or wxHORIZONTAL ( depending on the flag settings ). Then it is initialized again with wxHORIZONTAL. Either there is a logical mistake, or the code can be reduced to:
wxOrientation major_axis = wxHORIZONTAL;
Best regards and many thanks
Martin Ettl
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

