mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
[Analyzers][CPP]Turn on warning 26427 (#22743)
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
<Rule Id="C26417" Action="Info" />
|
<Rule Id="C26417" Action="Info" />
|
||||||
<Rule Id="C26418" Action="Info" />
|
<Rule Id="C26418" Action="Info" />
|
||||||
<Rule Id="C26426" Action="Info" />
|
<Rule Id="C26426" Action="Info" />
|
||||||
<Rule Id="C26427" Action="Info" />
|
<Rule Id="C26427" Action="Error" />
|
||||||
<Rule Id="C26429" Action="Info" />
|
<Rule Id="C26429" Action="Info" />
|
||||||
<Rule Id="C26430" Action="Info" />
|
<Rule Id="C26430" Action="Info" />
|
||||||
<Rule Id="C26431" Action="Info" />
|
<Rule Id="C26431" Action="Info" />
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ namespace BufferValidationHelpers
|
|||||||
|
|
||||||
// Convert app name to lower case
|
// Convert app name to lower case
|
||||||
std::transform(appName.begin(), appName.end(), appName.begin(), towlower);
|
std::transform(appName.begin(), appName.end(), appName.begin(), towlower);
|
||||||
std::wstring lowercaseDefAppName = KeyboardManagerEditorStrings::DefaultAppName;
|
std::wstring lowercaseDefAppName = KeyboardManagerEditorStrings::DefaultAppName();
|
||||||
std::transform(lowercaseDefAppName.begin(), lowercaseDefAppName.end(), lowercaseDefAppName.begin(), towlower);
|
std::transform(lowercaseDefAppName.begin(), lowercaseDefAppName.end(), lowercaseDefAppName.begin(), towlower);
|
||||||
if (appName == lowercaseDefAppName)
|
if (appName == lowercaseDefAppName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ void KeyDropDownControl::SetSelectionHandler(StackPanel& table, StackPanel row,
|
|||||||
if (targetApp != nullptr)
|
if (targetApp != nullptr)
|
||||||
{
|
{
|
||||||
std::wstring newText = targetApp.Text().c_str();
|
std::wstring newText = targetApp.Text().c_str();
|
||||||
std::wstring lowercaseDefAppName = KeyboardManagerEditorStrings::DefaultAppName;
|
std::wstring lowercaseDefAppName = KeyboardManagerEditorStrings::DefaultAppName();
|
||||||
std::transform(newText.begin(), newText.end(), newText.begin(), towlower);
|
std::transform(newText.begin(), newText.end(), newText.begin(), towlower);
|
||||||
std::transform(lowercaseDefAppName.begin(), lowercaseDefAppName.end(), lowercaseDefAppName.begin(), towlower);
|
std::transform(lowercaseDefAppName.begin(), lowercaseDefAppName.end(), lowercaseDefAppName.begin(), towlower);
|
||||||
if (newText == lowercaseDefAppName)
|
if (newText == lowercaseDefAppName)
|
||||||
|
|||||||
@@ -7,7 +7,10 @@
|
|||||||
namespace KeyboardManagerEditorStrings
|
namespace KeyboardManagerEditorStrings
|
||||||
{
|
{
|
||||||
// String constant for the default app name in Remap shortcuts
|
// String constant for the default app name in Remap shortcuts
|
||||||
inline const std::wstring DefaultAppName = GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_ALLAPPS);
|
inline std::wstring DefaultAppName()
|
||||||
|
{
|
||||||
|
return GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_ALLAPPS);
|
||||||
|
}
|
||||||
|
|
||||||
// Function to return the error message
|
// Function to return the error message
|
||||||
winrt::hstring GetErrorMessage(ShortcutErrorType errorType);
|
winrt::hstring GetErrorMessage(ShortcutErrorType errorType);
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ void ShortcutControl::AddNewShortcutControlRow(StackPanel& parent, std::vector<s
|
|||||||
row.Children().Append(target);
|
row.Children().Append(target);
|
||||||
|
|
||||||
targetAppTextBox.Width(EditorConstants::ShortcutTableDropDownWidth);
|
targetAppTextBox.Width(EditorConstants::ShortcutTableDropDownWidth);
|
||||||
targetAppTextBox.PlaceholderText(KeyboardManagerEditorStrings::DefaultAppName);
|
targetAppTextBox.PlaceholderText(KeyboardManagerEditorStrings::DefaultAppName());
|
||||||
targetAppTextBox.Text(targetAppName);
|
targetAppTextBox.Text(targetAppName);
|
||||||
|
|
||||||
// GotFocus handler will be called whenever the user tabs into or clicks on the textbox
|
// GotFocus handler will be called whenever the user tabs into or clicks on the textbox
|
||||||
@@ -167,7 +167,7 @@ void ShortcutControl::AddNewShortcutControlRow(StackPanel& parent, std::vector<s
|
|||||||
shortcutRemapBuffer[rowIndex].first[1] = tempShortcut;
|
shortcutRemapBuffer[rowIndex].first[1] = tempShortcut;
|
||||||
}
|
}
|
||||||
std::wstring newText = targetAppTextBox.Text().c_str();
|
std::wstring newText = targetAppTextBox.Text().c_str();
|
||||||
std::wstring lowercaseDefAppName = KeyboardManagerEditorStrings::DefaultAppName;
|
std::wstring lowercaseDefAppName = KeyboardManagerEditorStrings::DefaultAppName();
|
||||||
std::transform(newText.begin(), newText.end(), newText.begin(), towlower);
|
std::transform(newText.begin(), newText.end(), newText.begin(), towlower);
|
||||||
std::transform(lowercaseDefAppName.begin(), lowercaseDefAppName.end(), lowercaseDefAppName.begin(), towlower);
|
std::transform(lowercaseDefAppName.begin(), lowercaseDefAppName.end(), lowercaseDefAppName.begin(), towlower);
|
||||||
if (newText == lowercaseDefAppName)
|
if (newText == lowercaseDefAppName)
|
||||||
|
|||||||
Reference in New Issue
Block a user