]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/auibook.cpp
fixed wxString::Last() to run in O(1), not O(n), in UTF-8 build
[wxWidgets.git] / src / aui / auibook.cpp
index dc73becd50f7cf5464e5cd993edb18a54008592b..64e0d728e53b06f5ab1a97cb23271eab5cadcb2e 100644 (file)
@@ -666,7 +666,14 @@ int wxAuiDefaultTabArt::ShowDropDown(wxWindow* wnd,
     for (i = 0; i < count; ++i)
     {
         const wxAuiNotebookPage& page = pages.Item(i);
-        menuPopup.AppendCheckItem(1000+i, page.caption);
+        wxString caption = page.caption;
+
+        // if there is no caption, make it a space.  This will prevent
+        // an assert in the menu code.
+        if (caption.IsEmpty())
+            caption = wxT(" ");
+
+        menuPopup.AppendCheckItem(1000+i, caption);
     }
 
     if (active_idx != -1)
@@ -2225,6 +2232,11 @@ public:
         m_tab_ctrl_height = 20;
     }
 
+       ~wxTabFrame()
+       {
+               wxDELETE(m_tabs);
+       }
+
     void SetTabCtrlHeight(int h)
     {
         m_tab_ctrl_height = h;
@@ -3572,9 +3584,11 @@ void wxAuiNotebook::OnTabButton(wxCommandEvent& command_evt)
             {
                 close_wnd->Close();
             }
-             else
+            else
             {
                 int main_idx = m_tabs.GetIdxFromWindow(close_wnd);
+                wxCHECK_RET( main_idx != wxNOT_FOUND, _T("no page to delete?") );
+
                 DeletePage(main_idx);
             }
         }