From b06fdfeb02fa37776dd1b1bc324e51d70ad68213 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 25 Oct 2013 23:48:54 -0700 Subject: [PATCH] Fix crash in wine (it not works.) It was sending the notify early, and we didn't have tabs set up yet. Fixes #4173, at least for the current wine-1.6 Ubuntu packages. --- Windows/W32Util/TabControl.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Windows/W32Util/TabControl.h b/Windows/W32Util/TabControl.h index 489bb55ae9..6dfda63f68 100644 --- a/Windows/W32Util/TabControl.h +++ b/Windows/W32Util/TabControl.h @@ -16,11 +16,16 @@ public: void ShowTab(HWND pageHandle); void NextTab(bool cycle); void PreviousTab(bool cycle); - int CurrentTabIndex() { return currentTab; }; - HWND CurrentTabHandle() { return tabs[currentTab].pageHandle; }; + int CurrentTabIndex() { return currentTab; } + HWND CurrentTabHandle() { + if (currentTab < 0 || currentTab >= (int)tabs.size()) { + return NULL; + } + return tabs[currentTab].pageHandle; + } void SetShowTabTitles(bool enabled); - void SetIgnoreBottomMargin(bool enabled) { ignoreBottomMargin = enabled; }; - bool GetShowTabTitles() { return showTabTitles; }; + void SetIgnoreBottomMargin(bool enabled) { ignoreBottomMargin = enabled; } + bool GetShowTabTitles() { return showTabTitles; } void SetMinTabWidth(int w); private: