mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Clean up pointer use:
* Use unique_ptr for Actions instead of manual memory management * Use unique_ptr in KeywordDatabase * Use unique_ptr instead of shared_ptr for file formats * Don't pass shared_ptr to Reader/Writer, use references instead Also * Switch to C++17 so we can use map::try_emplace
This commit is contained in:
@@ -171,18 +171,18 @@ void StylePanel::onStyleSelect(wxCommandEvent&) {
|
||||
// select no special style when selecting the same style as the set default
|
||||
stylesheet = StyleSheetP();
|
||||
}
|
||||
set->actions.addAction(new ChangeCardStyleAction(card, stylesheet));
|
||||
set->actions.addAction(make_unique<ChangeCardStyleAction>(card, stylesheet));
|
||||
Layout();
|
||||
}
|
||||
}
|
||||
|
||||
void StylePanel::onUseForAll(wxCommandEvent&) {
|
||||
set->actions.addAction(new ChangeSetStyleAction(*set, card));
|
||||
set->actions.addAction(make_unique<ChangeSetStyleAction>(*set, card));
|
||||
Layout();
|
||||
}
|
||||
|
||||
void StylePanel::onUseCustom(wxCommandEvent&) {
|
||||
set->actions.addAction(new ChangeCardHasStylingAction(*set, card));
|
||||
set->actions.addAction(make_unique<ChangeCardHasStylingAction>(*set, card));
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(StylePanel, wxPanel)
|
||||
|
||||
Reference in New Issue
Block a user