mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[Analyzers][CPP] Turn on warning 4458 (#22265)
* Turn on warning 4458 Fix the errors by changing variable names and supressing the warning on winRT GDI headers * explaining the warning disables
This commit is contained in:
@@ -56,14 +56,14 @@ namespace NonLocalizable
|
||||
struct FancyZones : public winrt::implements<FancyZones, IFancyZones, IFancyZonesCallback>, public SettingsObserver
|
||||
{
|
||||
public:
|
||||
FancyZones(HINSTANCE hinstance, std::function<void()> disableModuleCallback) noexcept :
|
||||
FancyZones(HINSTANCE hinstance, std::function<void()> disableModuleCallbackFunction) noexcept :
|
||||
SettingsObserver({ SettingId::EditorHotkey, SettingId::PrevTabHotkey, SettingId::NextTabHotkey, SettingId::SpanZonesAcrossMonitors }),
|
||||
m_hinstance(hinstance),
|
||||
m_windowMoveHandler([this]() {
|
||||
PostMessageW(m_window, WM_PRIV_LOCATIONCHANGE, NULL, NULL);
|
||||
})
|
||||
{
|
||||
this->disableModuleCallback = std::move(disableModuleCallback);
|
||||
this->disableModuleCallback = std::move(disableModuleCallbackFunction);
|
||||
|
||||
FancyZonesSettings::instance().LoadSettings();
|
||||
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
// disabling warning 4458 - declaration of 'identifier' hides class member
|
||||
// to avoid warnings from GDI files - can't add winRT directory to external code
|
||||
// in the Cpp.Build.props
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4458)
|
||||
#include "gdiplus.h"
|
||||
#pragma warning(pop)
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
// disabling warning 4458 - declaration of 'identifier' hides class member
|
||||
// to avoid warnings from GDI files - can't add winRT directory to external code
|
||||
// in the Cpp.Build.props
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4458)
|
||||
#include "gdiplus.h"
|
||||
#pragma warning(pop)
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -21,7 +21,13 @@
|
||||
#include <mutex>
|
||||
#include <fileapi.h>
|
||||
|
||||
// disabling warning 4458 - declaration of 'identifier' hides class member
|
||||
// to avoid warnings from GDI files - can't add winRT directory to external code
|
||||
// in the Cpp.Build.props
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4458)
|
||||
#include <gdiplus.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
// Non-Localizable strings
|
||||
namespace NonLocalizable
|
||||
@@ -58,7 +64,6 @@ namespace
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
HWND NewZonesOverlayWindow(Rect position, HINSTANCE hinstance, WorkArea* owner)
|
||||
{
|
||||
HWND windowFromPool = ExtractWindow();
|
||||
@@ -216,7 +221,7 @@ void WorkArea::MoveWindowIntoZoneByIndexSet(HWND window, const ZoneIndexSet& ind
|
||||
auto adjustedRect = FancyZonesWindowUtils::AdjustRectForSizeWindowToRect(window, rect, m_window);
|
||||
FancyZonesWindowUtils::SizeWindowToRect(window, adjustedRect);
|
||||
}
|
||||
|
||||
|
||||
m_layoutWindows->Assign(window, indexSet);
|
||||
FancyZonesWindowProperties::StampZoneIndexProperty(window, indexSet);
|
||||
|
||||
@@ -270,7 +275,7 @@ bool WorkArea::MoveWindowIntoZoneByDirectionAndIndex(HWND window, DWORD vkCode,
|
||||
{
|
||||
SaveWindowProcessToZoneIndex(window);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -284,7 +289,7 @@ bool WorkArea::MoveWindowIntoZoneByDirectionAndPosition(HWND window, DWORD vkCod
|
||||
const auto& zones = m_layout->Zones();
|
||||
std::vector<bool> usedZoneIndices(zones.size(), false);
|
||||
auto windowZones = m_layoutWindows->GetZoneIndexSetFromWindow(window);
|
||||
|
||||
|
||||
for (ZoneIndex id : windowZones)
|
||||
{
|
||||
usedZoneIndices[id] = true;
|
||||
@@ -561,7 +566,7 @@ bool WorkArea::InitWindow(HINSTANCE hinstance) noexcept
|
||||
void WorkArea::InitLayout(const FancyZonesDataTypes::WorkAreaId& parentUniqueId) noexcept
|
||||
{
|
||||
Logger::info(L"Initialize layout on {}", m_uniqueId.toString());
|
||||
|
||||
|
||||
bool isLayoutAlreadyApplied = AppliedLayouts::instance().IsLayoutApplied(m_uniqueId);
|
||||
if (!isLayoutAlreadyApplied)
|
||||
{
|
||||
@@ -574,7 +579,7 @@ void WorkArea::InitLayout(const FancyZonesDataTypes::WorkAreaId& parentUniqueId)
|
||||
AppliedLayouts::instance().ApplyDefaultLayout(m_uniqueId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CalculateZoneSet();
|
||||
}
|
||||
|
||||
@@ -666,4 +671,3 @@ LRESULT CALLBACK WorkArea::s_WndProc(HWND window, UINT message, WPARAM wparam, L
|
||||
return (thisRef != nullptr) ? thisRef->WndProc(message, wparam, lparam) :
|
||||
DefWindowProc(window, message, wparam, lparam);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user