From 9c6e67cac0fd0e851ea2d38d91555f2e3c462c43 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 17 Apr 2021 19:31:08 +0100 Subject: [PATCH] Rename Mac wxCursor::CreateFromImage() to InitFromImage() Use the same name as in the other ports for the function doing the same thing, there doesn't seem to be any good reason to name it differently. Also avoid declaring it when wxUSE_IMAGE==0 as it's not defined in this case (again, consistently with the other ports). --- include/wx/osx/cursor.h | 4 +++- src/osx/carbon/cursor.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/wx/osx/cursor.h b/include/wx/osx/cursor.h index 68353791d3..595d7c50ca 100644 --- a/include/wx/osx/cursor.h +++ b/include/wx/osx/cursor.h @@ -44,7 +44,9 @@ protected: private: void InitFromStock(wxStockCursor); - void CreateFromImage(const wxImage & image) ; +#if wxUSE_IMAGE + void InitFromImage(const wxImage & image) ; +#endif // wxUSE_IMAGE wxDECLARE_DYNAMIC_CLASS(wxCursor); }; diff --git a/src/osx/carbon/cursor.cpp b/src/osx/carbon/cursor.cpp index cf8da1c8b8..fe61c67fa1 100644 --- a/src/osx/carbon/cursor.cpp +++ b/src/osx/carbon/cursor.cpp @@ -228,7 +228,7 @@ wxCursor::wxCursor() #if wxUSE_IMAGE wxCursor::wxCursor( const wxImage &image ) { - CreateFromImage( image ) ; + InitFromImage( image ) ; } #endif // wxUSE_IMAGE @@ -249,7 +249,7 @@ WXHCURSOR wxCursor::GetHCURSOR() const #if wxUSE_IMAGE -void wxCursor::CreateFromImage(const wxImage & image) +void wxCursor::InitFromImage(const wxImage & image) { m_refData = new wxCursorRefData; int hotSpotX = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X); @@ -287,7 +287,7 @@ wxCursor::wxCursor(const wxString& cursor_file, wxBitmapType flags, int hotSpotX image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, hotSpotY ) ; m_refData->DecRef() ; m_refData = NULL ; - CreateFromImage( image ) ; + InitFromImage( image ) ; } #endif }