From 8afbf79d021f148d84a2d49dcf8db2cf65d0ee4e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Apr 2022 22:52:30 +0100 Subject: [PATCH] Take const pointer in wxAuiTabContainer::GetIdxFromWindow() Allow passing const pointers to this function, as it doesn't need to modify them at all. --- include/wx/aui/auibook.h | 2 +- interface/wx/aui/auibook.h | 2 +- src/aui/auibook.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wx/aui/auibook.h b/include/wx/aui/auibook.h index 84d968dd9b..8e4c1b08d7 100644 --- a/include/wx/aui/auibook.h +++ b/include/wx/aui/auibook.h @@ -140,7 +140,7 @@ public: bool TabHitTest(int x, int y, wxWindow** hit) const; bool ButtonHitTest(int x, int y, wxAuiTabContainerButton** hit) const; wxWindow* GetWindowFromIdx(size_t idx) const; - int GetIdxFromWindow(wxWindow* page) const; + int GetIdxFromWindow(const wxWindow* page) const; size_t GetPageCount() const; wxAuiNotebookPage& GetPage(size_t idx); const wxAuiNotebookPage& GetPage(size_t idx) const; diff --git a/interface/wx/aui/auibook.h b/interface/wx/aui/auibook.h index b8b91d0ec3..91c63d571a 100644 --- a/interface/wx/aui/auibook.h +++ b/interface/wx/aui/auibook.h @@ -523,7 +523,7 @@ public: bool TabHitTest(int x, int y, wxWindow** hit) const; bool ButtonHitTest(int x, int y, wxAuiTabContainerButton** hit) const; wxWindow* GetWindowFromIdx(size_t idx) const; - int GetIdxFromWindow(wxWindow* page) const; + int GetIdxFromWindow(const wxWindow* page) const; size_t GetPageCount() const; wxAuiNotebookPage& GetPage(size_t idx); const wxAuiNotebookPage& GetPage(size_t idx) const; diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index ebea7e1b67..e3fcea5bd2 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -325,7 +325,7 @@ wxWindow* wxAuiTabContainer::GetWindowFromIdx(size_t idx) const return m_pages[idx].window; } -int wxAuiTabContainer::GetIdxFromWindow(wxWindow* wnd) const +int wxAuiTabContainer::GetIdxFromWindow(const wxWindow* wnd) const { const size_t page_count = m_pages.GetCount(); for ( size_t i = 0; i < page_count; ++i )