No real changes, just use const_cast<> instead of C casts.
Replace many comments indicating that the C cast used was really a const_cast<> with the proper cast itself. There is no reason to not use it any longer, all the supported compilers understand it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -581,8 +581,7 @@ wxString wxNativeFontInfo::GetXFontComponent(wxXLFDField field) const
|
||||
|
||||
if ( !HasElements() )
|
||||
{
|
||||
// const_cast
|
||||
if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) )
|
||||
if ( !const_cast<wxNativeFontInfo *>(this)->FromXFontName(xFontName) )
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
@@ -639,8 +638,7 @@ wxString wxNativeFontInfo::GetXFontName() const
|
||||
elt = wxT('*');
|
||||
}
|
||||
|
||||
// const_cast
|
||||
((wxNativeFontInfo *)this)->xFontName << wxT('-') << elt;
|
||||
const_cast<wxNativeFontInfo *>(this)->xFontName << wxT('-') << elt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -658,8 +656,7 @@ wxNativeFontInfo::SetXFontComponent(wxXLFDField field, const wxString& value)
|
||||
|
||||
if ( !HasElements() )
|
||||
{
|
||||
// const_cast
|
||||
if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) )
|
||||
if ( !const_cast<wxNativeFontInfo *>(this)->FromXFontName(xFontName) )
|
||||
{
|
||||
wxFAIL_MSG( wxT("can't set font element for invalid XLFD") );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user