fix macro

This commit is contained in:
Pankaj Bhojwani
2025-01-29 15:29:21 -08:00
parent 54292253c8
commit 9cafea210c
2 changed files with 12 additions and 19 deletions

View File

@@ -244,21 +244,18 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
for (uint32_t i = 0; i < shortcutArgsNumItems; i++)
{
const auto argAtIndex = shortcutArgs.GetArgAt(i);
if (argAtIndex)
{
const auto argType = shortcutArgs.GetArgDescriptionAt(i).Type;
const auto item = make<ArgWrapper>(argType, argAtIndex);
item.PropertyChanged([&, i](const IInspectable& sender, const PropertyChangedEventArgs& args) {
const auto itemProperty{ args.PropertyName() };
if (itemProperty == L"Value")
{
const auto argWrapper = sender.as<Microsoft::Terminal::Settings::Editor::ArgWrapper>();
const auto newValue = argWrapper.Value();
_actionAndArgs.Args().SetArgAt(i, newValue);
}
});
argValues.push_back(item);
}
const auto argType = shortcutArgs.GetArgDescriptionAt(i).Type;
const auto item = make<ArgWrapper>(argType, argAtIndex);
item.PropertyChanged([&, i](const IInspectable& sender, const PropertyChangedEventArgs& args) {
const auto itemProperty{ args.PropertyName() };
if (itemProperty == L"Value")
{
const auto argWrapper = sender.as<Microsoft::Terminal::Settings::Editor::ArgWrapper>();
const auto newValue = argWrapper.Value();
_actionAndArgs.Args().SetArgAt(i, newValue);
}
});
argValues.push_back(item);
}
_ArgValues = single_threaded_observable_vector(std::move(argValues));

View File

@@ -105,8 +105,6 @@ struct InitListPlaceholder
// is used as the conditional for the validation here.
#define FROM_JSON_ARGS(type, name, jsonKey, required, ...) \
JsonUtils::GetValueForKey(json, jsonKey, args->_##name); \
args->_argCount += 1; \
args->_argDescriptions.push_back({ L## #name, L## #type, std::wstring(L## #required) != L"false" }); \
if (required) \
{ \
return { nullptr, { SettingsLoadWarnings::MissingRequiredParameter } }; \
@@ -148,7 +146,6 @@ struct InitListPlaceholder
\
private: \
InitListPlaceholder _placeholder; \
uint32_t _argCount{ 0 }; \
std::vector<ArgDescription> _argDescriptions; \
\
public: \
@@ -183,7 +180,6 @@ public: \
{ \
auto copy{ winrt::make_self<className>() }; \
argsMacro(COPY_ARGS); \
copy->_argCount = _argCount; \
copy->_argDescriptions = _argDescriptions; \
return *copy; \
} \