forked from mia/Aegisub
Make SetSelectedSet move-friendly
This commit is contained in:
parent
e0b9970672
commit
2b76ee7696
3 changed files with 8 additions and 8 deletions
|
@ -1020,11 +1020,11 @@ void BaseGrid::SetByFrame(bool state) {
|
||||||
Refresh(false);
|
Refresh(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseGrid::SetSelectedSet(const Selection &new_selection) {
|
void BaseGrid::SetSelectedSet(Selection new_selection) {
|
||||||
Selection inserted, removed;
|
Selection inserted, removed;
|
||||||
set_difference(new_selection, selection, inserted);
|
set_difference(new_selection, selection, inserted);
|
||||||
set_difference(selection, new_selection, removed);
|
set_difference(selection, new_selection, removed);
|
||||||
selection = new_selection;
|
selection = std::move(new_selection);
|
||||||
AnnounceSelectedSetChanged(inserted, removed);
|
AnnounceSelectedSetChanged(inserted, removed);
|
||||||
Refresh(false);
|
Refresh(false);
|
||||||
}
|
}
|
||||||
|
@ -1042,9 +1042,9 @@ void BaseGrid::SetActiveLine(AssDialogue *new_line) {
|
||||||
extendRow = GetDialogueIndex(new_line);
|
extendRow = GetDialogueIndex(new_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseGrid::SetSelectionAndActive(Selection const& new_selection, AssDialogue *new_line) {
|
void BaseGrid::SetSelectionAndActive(Selection new_selection, AssDialogue *new_line) {
|
||||||
BeginBatch();
|
BeginBatch();
|
||||||
SetSelectedSet(new_selection);
|
SetSelectedSet(std::move(new_selection));
|
||||||
SetActiveLine(new_line);
|
SetActiveLine(new_line);
|
||||||
EndBatch();
|
EndBatch();
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,10 +130,10 @@ public:
|
||||||
// SelectionController implementation
|
// SelectionController implementation
|
||||||
void SetActiveLine(AssDialogue *new_line) override;
|
void SetActiveLine(AssDialogue *new_line) override;
|
||||||
AssDialogue * GetActiveLine() const override { return active_line; }
|
AssDialogue * GetActiveLine() const override { return active_line; }
|
||||||
void SetSelectedSet(const Selection &new_selection) override;
|
void SetSelectedSet(Selection new_selection) override;
|
||||||
void GetSelectedSet(Selection &res) const override { res = selection; }
|
void GetSelectedSet(Selection &res) const override { res = selection; }
|
||||||
Selection const& GetSelectedSet() const override { return selection; }
|
Selection const& GetSelectedSet() const override { return selection; }
|
||||||
void SetSelectionAndActive(Selection const& new_selection, AssDialogue *new_line) override;;
|
void SetSelectionAndActive(Selection new_selection, AssDialogue *new_line) override;;
|
||||||
void NextLine() override;
|
void NextLine() override;
|
||||||
void PrevLine() override;
|
void PrevLine() override;
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
/// If no change happens to the selected set, whether because it was refused or
|
/// If no change happens to the selected set, whether because it was refused or
|
||||||
/// because the new set was identical to the old set, no change notification may
|
/// because the new set was identical to the old set, no change notification may
|
||||||
/// be sent.
|
/// be sent.
|
||||||
virtual void SetSelectedSet(const Selection &new_selection) = 0;
|
virtual void SetSelectedSet(Selection new_selection) = 0;
|
||||||
|
|
||||||
/// @brief Obtain the selected set
|
/// @brief Obtain the selected set
|
||||||
/// @param[out] selection Filled with the selected set on return
|
/// @param[out] selection Filled with the selected set on return
|
||||||
|
@ -114,7 +114,7 @@ public:
|
||||||
/// This sets both the active line and selected set before announcing the
|
/// This sets both the active line and selected set before announcing the
|
||||||
/// change to either of them, and is guaranteed to announce the active line
|
/// change to either of them, and is guaranteed to announce the active line
|
||||||
/// change before the selection change.
|
/// change before the selection change.
|
||||||
virtual void SetSelectionAndActive(Selection const& new_selection, ItemDataType new_line) = 0;
|
virtual void SetSelectionAndActive(Selection new_selection, ItemDataType new_line) = 0;
|
||||||
|
|
||||||
/// @brief Change the active line to the next in sequence
|
/// @brief Change the active line to the next in sequence
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue