From ef85c41d0c29cffe7a31777282d7f53d6b8e264e Mon Sep 17 00:00:00 2001 From: HasheeLeo Date: Tue, 6 Sep 2016 13:53:45 +0500 Subject: [PATCH] Pass wxFont by const reference to wxStyledTextCtrl::StyleSetFont() Since wxStyledTextCtrl::StyleSetFont does not change its 'font' parameter, it should be a constant reference so we can pass in temporary wxFont objects. Closes https://github.com/wxWidgets/wxWidgets/pull/321 --- include/wx/stc/stc.h | 2 +- src/stc/stc.cpp | 2 +- src/stc/stc.cpp.in | 2 +- src/stc/stc.h.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 39de6719eb..fb9041b942 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -4899,7 +4899,7 @@ public: // Set style size, face, bold, italic, and underline attributes from // a wxFont's attributes. - void StyleSetFont(int styleNum, wxFont& font); + void StyleSetFont(int styleNum, const wxFont& font); diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 3f6e29eb14..6e91dc10e9 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -4646,7 +4646,7 @@ wxFont wxStyledTextCtrl::StyleGetFont(int style) { // Set style size, face, bold, italic, and underline attributes from // a wxFont's attributes. -void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) { +void wxStyledTextCtrl::StyleSetFont(int styleNum, const wxFont& font) { #ifdef __WXGTK__ // Ensure that the native font is initialized int x, y; diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index d4dfb647c5..995480ca75 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -352,7 +352,7 @@ wxFont wxStyledTextCtrl::StyleGetFont(int style) { // Set style size, face, bold, italic, and underline attributes from // a wxFont's attributes. -void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) { +void wxStyledTextCtrl::StyleSetFont(int styleNum, const wxFont& font) { #ifdef __WXGTK__ // Ensure that the native font is initialized int x, y; diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index 6261700f9f..402a8b3298 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -152,7 +152,7 @@ public: // Set style size, face, bold, italic, and underline attributes from // a wxFont's attributes. - void StyleSetFont(int styleNum, wxFont& font); + void StyleSetFont(int styleNum, const wxFont& font);