From a0e292bdaff851bbf9e73f98a4874f5ad57feee6 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 9 Jul 2013 17:25:04 +0100 Subject: [PATCH] TabbedComponent::removeTab fix. --- modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp index 000c3d0fd5..761d12f156 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp +++ b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp @@ -271,12 +271,13 @@ void TabbedButtonBar::setTabName (const int tabIndex, const String& newName) void TabbedButtonBar::removeTab (const int tabIndex) { + const int oldIndex = currentTabIndex; if (tabIndex == currentTabIndex) setCurrentTabIndex (-1); - TabInfo* const currentTab = tabs [currentTabIndex]; tabs.remove (tabIndex); - currentTabIndex = tabs.indexOf (currentTab); + + setCurrentTabIndex (oldIndex); resized(); }