Fix wxWebViewEdge build with standard-conforming compilers

Convert wxCoTaskMemPtr<wchar_t> to wxString explicitly as doing it
implicitly required 2 user-defined conversions which is not allowed in
standard C++ (but works with MSVC).

Also get rid of a not really necessary temporary wxString variable and
just perform this case when constructing wxStringTokenizer.

Closes #22170.
This commit is contained in:
Vadim Zeitlin
2022-02-27 02:55:01 +01:00
parent e7096e85d2
commit 8e367994d7

View File

@@ -989,8 +989,7 @@ wxVersionInfo wxWebViewFactoryEdge::GetVersionInfo()
wxWebViewEdgeImpl::ms_browserExecutableDir.wc_str(), &nativeVersionStr);
if (SUCCEEDED(hr) && nativeVersionStr)
{
wxString versionStr = nativeVersionStr;
wxStringTokenizer tk(versionStr, ". ");
wxStringTokenizer tk(wxString(nativeVersionStr), ". ");
// Ignore the return value because if the version component is missing
// or invalid (i.e. non-numeric), the only thing we can do is to ignore
// it anyhow.