Allow wxTextMeasure to work with non-native wxDC objects too.
Just forward back to wxDC itself in this case instead of using the platform-specific code in wxTextMeasure that only works with native DCs. See #14781. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72801 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#endif
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
#include "wx/msw/dc.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/window.h"
|
||||
@@ -33,6 +32,8 @@
|
||||
|
||||
#include "wx/private/textmeasure.h"
|
||||
|
||||
#include "wx/msw/dc.h"
|
||||
|
||||
// ============================================================================
|
||||
// wxTextMeasure implementation
|
||||
// ============================================================================
|
||||
@@ -41,6 +42,16 @@ void wxTextMeasure::Init()
|
||||
{
|
||||
m_hdc = NULL;
|
||||
m_hfontOld = NULL;
|
||||
|
||||
if ( m_dc )
|
||||
{
|
||||
wxClassInfo* const ci = m_dc->GetImpl()->GetClassInfo();
|
||||
|
||||
if ( ci->IsKindOf(wxCLASSINFO(wxMSWDCImpl)))
|
||||
{
|
||||
m_useDCImpl = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextMeasure::BeginMeasuring()
|
||||
|
Reference in New Issue
Block a user