Add wxApp::GetMainTopWindow() wrapper

This trivial function just allows to avoid checking if wxTheApp is not
null before calling GetTopWindow() on it.

Replace the existing "wxTheApp && wxTheApp->GetTopWindow()" calls with
wxApp::GetMainTopWindow().

No real changes.
This commit is contained in:
Vadim Zeitlin
2021-03-07 15:25:27 +01:00
parent e9f619e561
commit 69e48f036b
15 changed files with 51 additions and 25 deletions

View File

@@ -691,8 +691,8 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA")
#if defined(__WXOSX_COCOA__)
// Try to find a 2x resolution image with @2x appended before the file extension.
wxWindow* win = m_WParser->GetWindowInterface() ? m_WParser->GetWindowInterface()->GetHTMLWindow() : NULL;
if (!win && wxTheApp)
win = wxTheApp->GetTopWindow();
if (!win)
win = wxApp::GetMainTopWindow();
if (win && win->GetContentScaleFactor() > 1.0)
{
if (tmp.Find('.') != wxNOT_FOUND)