Fix crash in wxDC::GetMultiLineTextExtent() after last commit.
Don't call wxTextMeasure::DoGetTextExtent() with NULL width pointer, it now supposes that both width and height pointers are non-NULL. Add at least a trivial unit test for GetMultiLineTextExtent(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72700 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -95,6 +95,13 @@ void MeasuringTextTestCase::DCGetTextExtent()
|
||||
wxClientDC dc(wxTheApp->GetTopWindow());
|
||||
|
||||
DoTestGetTextExtent(dc);
|
||||
|
||||
int w;
|
||||
dc.GetMultiLineTextExtent("Good\nbye", &w, NULL);
|
||||
const wxSize sz = dc.GetTextExtent("Good");
|
||||
CPPUNIT_ASSERT_EQUAL( sz.x, w );
|
||||
|
||||
CPPUNIT_ASSERT( dc.GetMultiLineTextExtent("Good\nbye").y >= 2*sz.y );
|
||||
}
|
||||
|
||||
void MeasuringTextTestCase::WindowGetTextExtent()
|
||||
|
Reference in New Issue
Block a user