1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-06 14:52:34 +02:00

Bug1430: Don't crash resetting toolbars with legacy .cfg files

This commit is contained in:
Paul Licameli 2016-07-03 05:03:14 -04:00
parent db2ee75c0a
commit 9dfa646221
2 changed files with 5 additions and 7 deletions

View File

@ -41,6 +41,7 @@ in which buttons can be placed.
#endif /* */
#include "ToolBar.h"
#include "ToolDock.h"
#include "../Experimental.h"
#include "../AllThemeResources.h"
@ -322,7 +323,6 @@ ToolBar::ToolBar( int type,
mParent = NULL;
mHSizer = NULL;
mSpacer = NULL;
mDock = NULL;
mVisible = false;
mPositioned = false;
@ -393,7 +393,7 @@ bool ToolBar::IsResizable() const
//
bool ToolBar::IsDocked() const
{
return mDock != NULL;
return const_cast<ToolBar*>(this)->GetDock() != nullptr;
}
//
@ -551,7 +551,7 @@ void ToolBar::UpdatePrefs()
//
ToolDock *ToolBar::GetDock()
{
return mDock;
return dynamic_cast<ToolDock*>(GetParent());
}
//
@ -560,7 +560,7 @@ ToolDock *ToolBar::GetDock()
void ToolBar::SetDocked( ToolDock *dock, bool pushed )
{
// Remember it
mDock = dock;
// mDock = dock;
// Change the tooltip of the grabber
#if wxUSE_TOOLTIPS
@ -572,7 +572,7 @@ void ToolBar::SetDocked( ToolDock *dock, bool pushed )
if (mResizer)
{
mResizer->Show(mDock != NULL);
mResizer->Show(dock != NULL);
Layout();
Fit();
}

View File

@ -225,8 +225,6 @@ class ToolBar /* not final */ : public wxPanelWrapper
wxBoxSizer *mHSizer;
wxSizerItem *mSpacer;
ToolDock *mDock;
bool mVisible;
bool mResizable;
bool mPositioned; // true if position floating determined.