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:
Vadim Zeitlin
2014-01-31 16:06:43 +00:00
parent 637d4a3837
commit 67cbb04051

View File

@@ -380,6 +380,14 @@ void wxHtmlWindow::SetRelatedFrame(wxFrame* frame, const wxString& format)
{
m_RelatedFrame = frame;
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());
}