C26429, test for nullness or mark as not_null (and a few cascading warnings.
This commit is contained in:
parent
41f209f6d3
commit
93aa9455e2
|
@ -1545,11 +1545,9 @@ float DxEngine::GetScaling() const noexcept
|
|||
// - If fallback occurred, this is updated to what we retrieved instead.
|
||||
// Return Value:
|
||||
// - Localized string name of the font family
|
||||
[[nodiscard]] std::wstring DxEngine::_GetFontFamilyName(IDWriteFontFamily* const fontFamily,
|
||||
[[nodiscard]] std::wstring DxEngine::_GetFontFamilyName(gsl::not_null<IDWriteFontFamily*> const fontFamily,
|
||||
std::wstring& localeName) const
|
||||
{
|
||||
THROW_HR_IF_NULL(E_INVALIDARG, fontFamily);
|
||||
|
||||
// See: https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nn-dwrite-idwritefontcollection
|
||||
Microsoft::WRL::ComPtr<IDWriteLocalizedStrings> familyNames;
|
||||
THROW_IF_FAILED(fontFamily->GetFamilyNames(&familyNames));
|
||||
|
|
|
@ -197,7 +197,7 @@ namespace Microsoft::Console::Render
|
|||
|
||||
[[nodiscard]] std::wstring _GetLocaleName() const;
|
||||
|
||||
[[nodiscard]] std::wstring _GetFontFamilyName(IDWriteFontFamily* const fontFamily,
|
||||
[[nodiscard]] std::wstring _GetFontFamilyName(gsl::not_null<IDWriteFontFamily*> const fontFamily,
|
||||
std::wstring& localeName) const;
|
||||
|
||||
[[nodiscard]] HRESULT _GetProposedFont(const FontInfoDesired& desired,
|
||||
|
|
|
@ -214,10 +214,15 @@ IFACEMETHODIMP WindowUiaProviderBase::get_FragmentRoot(_COM_Outptr_result_mayben
|
|||
|
||||
HWND WindowUiaProviderBase::GetWindowHandle() const
|
||||
{
|
||||
IUiaWindow* const pConsoleWindow = _baseWindow;
|
||||
THROW_HR_IF_NULL(E_POINTER, pConsoleWindow);
|
||||
|
||||
return pConsoleWindow->GetWindowHandle();
|
||||
const IUiaWindow* const pConsoleWindow = _baseWindow;
|
||||
if (pConsoleWindow)
|
||||
{
|
||||
return pConsoleWindow->GetWindowHandle();
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT WindowUiaProviderBase::_EnsureValidHwnd() const
|
||||
|
|
Loading…
Reference in a new issue