diff --git a/src/modules/keyboardmanager/ui/KeyDropDownControl.cpp b/src/modules/keyboardmanager/ui/KeyDropDownControl.cpp index ac4add0252..5948ff59a7 100644 --- a/src/modules/keyboardmanager/ui/KeyDropDownControl.cpp +++ b/src/modules/keyboardmanager/ui/KeyDropDownControl.cpp @@ -309,7 +309,7 @@ ComboBox KeyDropDownControl::GetComboBox() // Function to add a drop down to the shortcut stack panel void KeyDropDownControl::AddDropDown(Grid table, StackPanel shortcutControl, StackPanel parent, const int colIndex, RemapBuffer& shortcutRemapBuffer, std::vector>& keyDropDownControlObjects, TextBox targetApp, bool isHybridControl, bool isSingleKeyWindow, bool ignoreWarning) { - keyDropDownControlObjects.push_back(std::move(std::unique_ptr(new KeyDropDownControl(true, ignoreWarning, colIndex == 1)))); + keyDropDownControlObjects.emplace_back(std::make_unique(true, ignoreWarning, colIndex == 1)); parent.Children().Append(keyDropDownControlObjects[keyDropDownControlObjects.size() - 1]->GetComboBox()); keyDropDownControlObjects[keyDropDownControlObjects.size() - 1]->SetSelectionHandler(table, shortcutControl, parent, colIndex, shortcutRemapBuffer, keyDropDownControlObjects, targetApp, isHybridControl, isSingleKeyWindow); parent.UpdateLayout(); diff --git a/src/modules/keyboardmanager/ui/ShortcutControl.cpp b/src/modules/keyboardmanager/ui/ShortcutControl.cpp index bae7e88174..52c2e61972 100644 --- a/src/modules/keyboardmanager/ui/ShortcutControl.cpp +++ b/src/modules/keyboardmanager/ui/ShortcutControl.cpp @@ -72,8 +72,8 @@ void ShortcutControl::AddNewShortcutControlRow(Grid& parent, std::vector> newrow; - newrow.push_back(std::move(std::unique_ptr(new ShortcutControl(parent, 0, targetAppTextBox)))); - newrow.push_back(std::move(std::unique_ptr(new ShortcutControl(parent, 1, targetAppTextBox)))); + newrow.emplace_back(std::make_unique(parent, 0, targetAppTextBox)); + newrow.emplace_back(std::make_unique(parent, 1, targetAppTextBox)); keyboardRemapControlObjects.push_back(std::move(newrow)); // Add to grid diff --git a/src/modules/keyboardmanager/ui/SingleKeyRemapControl.cpp b/src/modules/keyboardmanager/ui/SingleKeyRemapControl.cpp index 57f06a8786..6c39e4a7ac 100644 --- a/src/modules/keyboardmanager/ui/SingleKeyRemapControl.cpp +++ b/src/modules/keyboardmanager/ui/SingleKeyRemapControl.cpp @@ -29,7 +29,7 @@ SingleKeyRemapControl::SingleKeyRemapControl(Grid table, const int colIndex) // Key column if (colIndex == 0) { - keyDropDownControlObjects.push_back(std::move(std::unique_ptr(new KeyDropDownControl(false)))); + keyDropDownControlObjects.emplace_back(std::make_unique(false)); singleKeyRemapControlLayout.as().Children().Append(keyDropDownControlObjects[0]->GetComboBox()); // Set selection handler for the drop down keyDropDownControlObjects[0]->SetSelectionHandler(table, singleKeyRemapControlLayout.as(), colIndex, singleKeyRemapBuffer); @@ -76,8 +76,8 @@ void SingleKeyRemapControl::AddNewControlKeyRemapRow(Grid& parent, std::vector> newrow; - newrow.push_back(std::move(std::unique_ptr(new SingleKeyRemapControl(parent, 0)))); - newrow.push_back(std::move(std::unique_ptr(new SingleKeyRemapControl(parent, 1)))); + newrow.emplace_back(std::make_unique(parent, 0)); + newrow.emplace_back(std::make_unique(parent, 1)); keyboardRemapControlObjects.push_back(std::move(newrow)); // Add to grid