From 089bf467a99a6607c977fbc35c21ac5d335378d3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Nov 2023 22:05:25 +0100 Subject: [PATCH] Allow passing const wxWindow* to more wxBitmapBundle methods Take const pointer in GetConsensusSizeFor(), which only uses this parameter to get the DPI scale factor, and CreateImageList(), using it only to pass it on to GetConsensusSizeFor(). No real changes. --- include/wx/bmpbndl.h | 4 ++-- src/common/bmpbndl.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wx/bmpbndl.h b/include/wx/bmpbndl.h index b8e140d0d0..7b60fd9d18 100644 --- a/include/wx/bmpbndl.h +++ b/include/wx/bmpbndl.h @@ -162,12 +162,12 @@ public: wxNODISCARD static wxSize GetConsensusSizeFor(double scale, const wxVector& bundles); wxNODISCARD static wxSize - GetConsensusSizeFor(wxWindow* win, const wxVector& bundles); + GetConsensusSizeFor(const wxWindow* win, const wxVector& bundles); // Create wxImageList and fill it with the images from the given bundles in // the sizes appropriate for the DPI scaling used for the specified window. wxNODISCARD static wxImageList* - CreateImageList(wxWindow* win, const wxVector& bundles); + CreateImageList(const wxWindow* win, const wxVector& bundles); private: typedef wxObjectDataPtr wxBitmapBundleImplPtr; diff --git a/src/common/bmpbndl.cpp b/src/common/bmpbndl.cpp index fbe985c45b..af1e419cc3 100644 --- a/src/common/bmpbndl.cpp +++ b/src/common/bmpbndl.cpp @@ -619,7 +619,7 @@ void RecordSizePref(SizePrefs& prefs, const wxSize& size) /* static */ wxSize -wxBitmapBundle::GetConsensusSizeFor(wxWindow* win, +wxBitmapBundle::GetConsensusSizeFor(const wxWindow* win, const wxVector& bundles) { return GetConsensusSizeFor(win->GetDPIScaleFactor(), bundles); @@ -669,7 +669,7 @@ wxBitmapBundle::GetConsensusSizeFor(double scale, /* static */ wxImageList* -wxBitmapBundle::CreateImageList(wxWindow* win, +wxBitmapBundle::CreateImageList(const wxWindow* win, const wxVector& bundles) { wxCHECK_MSG( win, nullptr, "must have a valid window" );