Add const_cast and explain why it's needed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1223,7 +1223,9 @@ void wxWindow::GetTextExtent(const wxString& string, int *outX, int *outY,
|
||||
// We don't create a wxClientDC because we don't want to accidently be able to use
|
||||
// it for drawing.
|
||||
wxDC tmpdc;
|
||||
return tmpdc.GetTextExtent(string, outX, outY, outDescent, outExternalLeading, inFont);
|
||||
// NOTE: We must use const_cast here on 2.8 because we must take a const wxFont but the wxDC method
|
||||
// must not. In trunk, the wxDC method has been corrected to take const wxFont.
|
||||
return tmpdc.GetTextExtent(string, outX, outY, outDescent, outExternalLeading, const_cast<wxFont*>(inFont));
|
||||
}
|
||||
|
||||
// Coordinates relative to the window
|
||||
|
Reference in New Issue
Block a user