don't crash when using wxHtmlWidgetCell in wxHtmlListBox
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46330 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1501,8 +1501,15 @@ void wxHtmlWidgetCell::Draw(wxDC& WXUNUSED(dc),
|
||||
c = c->GetParent();
|
||||
}
|
||||
|
||||
((wxScrolledWindow*)(m_Wnd->GetParent()))->GetViewStart(&stx, &sty);
|
||||
m_Wnd->SetSize(absx - wxHTML_SCROLL_STEP * stx, absy - wxHTML_SCROLL_STEP * sty, m_Width, m_Height);
|
||||
wxScrolledWindow *scrolwin =
|
||||
wxDynamicCast(m_Wnd->GetParent(), wxScrolledWindow);
|
||||
wxCHECK_RET( scrolwin,
|
||||
_T("widget cells can only be placed in wxHtmlWindow") );
|
||||
|
||||
scrolwin->GetViewStart(&stx, &sty);
|
||||
m_Wnd->SetSize(absx - wxHTML_SCROLL_STEP * stx,
|
||||
absy - wxHTML_SCROLL_STEP * sty,
|
||||
m_Width, m_Height);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user