forked from mia/Aegisub
Add undo support for extradata
This commit is contained in:
parent
8076fb2791
commit
040b467090
1 changed files with 3 additions and 0 deletions
|
@ -60,6 +60,7 @@ struct SubsController::UndoInfo {
|
||||||
std::vector<AssStyle> styles;
|
std::vector<AssStyle> styles;
|
||||||
std::vector<AssDialogueBase> events;
|
std::vector<AssDialogueBase> events;
|
||||||
std::vector<AssAttachment> attachments;
|
std::vector<AssAttachment> attachments;
|
||||||
|
AegisubExtradataMap extradata;
|
||||||
|
|
||||||
mutable std::vector<int> selection;
|
mutable std::vector<int> selection;
|
||||||
int active_line_id = 0;
|
int active_line_id = 0;
|
||||||
|
@ -69,6 +70,7 @@ struct SubsController::UndoInfo {
|
||||||
: undo_description(d)
|
: undo_description(d)
|
||||||
, commit_id(commit_id)
|
, commit_id(commit_id)
|
||||||
, attachments(c->ass->Attachments)
|
, attachments(c->ass->Attachments)
|
||||||
|
, extradata(c->ass->Extradata)
|
||||||
{
|
{
|
||||||
script_info.reserve(c->ass->Info.size());
|
script_info.reserve(c->ass->Info.size());
|
||||||
for (auto const& info : c->ass->Info)
|
for (auto const& info : c->ass->Info)
|
||||||
|
@ -108,6 +110,7 @@ struct SubsController::UndoInfo {
|
||||||
if (binary_search(begin(selection), end(selection), copy->Id))
|
if (binary_search(begin(selection), end(selection), copy->Id))
|
||||||
new_sel.insert(copy);
|
new_sel.insert(copy);
|
||||||
}
|
}
|
||||||
|
c->ass->Extradata = extradata;
|
||||||
|
|
||||||
c->ass->Commit("", AssFile::COMMIT_NEW);
|
c->ass->Commit("", AssFile::COMMIT_NEW);
|
||||||
c->selectionController->SetSelectionAndActive(std::move(new_sel), active_line);
|
c->selectionController->SetSelectionAndActive(std::move(new_sel), active_line);
|
||||||
|
|
Loading…
Reference in a new issue