Try to detect invalid wxHtmlWindow title format earlier.
Assert directly in wxHtmlWindow::SetRelatedFrame() instead of doing it much later, hopefully people will read the comment at the assert point. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -380,6 +380,14 @@ void wxHtmlWindow::SetRelatedFrame(wxFrame* frame, const wxString& format)
|
|||||||
{
|
{
|
||||||
m_RelatedFrame = frame;
|
m_RelatedFrame = frame;
|
||||||
m_TitleFormat = format;
|
m_TitleFormat = format;
|
||||||
|
|
||||||
|
// Check if the format provided can actually be used: it's more
|
||||||
|
// user-friendly to do it here and now rather than triggering the same
|
||||||
|
// assert much later when it's really used.
|
||||||
|
|
||||||
|
// If you get an assert here, it means that the title doesn't contain
|
||||||
|
// exactly one "%s" format specifier, which is an error in the caller.
|
||||||
|
wxString::Format(m_TitleFormat, wxString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user