mirror of https://github.com/odrling/Aegisub
Eliminate a pointless roundtrip through wxString when copying styles to the clipboard
This commit is contained in:
parent
74fbe22afe
commit
106fb663c7
|
@ -459,15 +459,15 @@ void DialogStyleManager::OnCopyToCurrent() {
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void DialogStyleManager::CopyToClipboard(wxListBox *list, T const& v) {
|
void DialogStyleManager::CopyToClipboard(wxListBox *list, T const& v) {
|
||||||
wxString data;
|
|
||||||
wxArrayInt selections;
|
wxArrayInt selections;
|
||||||
list->GetSelections(selections);
|
list->GetSelections(selections);
|
||||||
|
|
||||||
|
std::string data;
|
||||||
for(size_t i = 0; i < selections.size(); ++i) {
|
for(size_t i = 0; i < selections.size(); ++i) {
|
||||||
if (i) data += "\r\n";
|
if (i) data += "\r\n";
|
||||||
AssStyle *s = v[selections[i]];
|
AssStyle *s = v[selections[i]];
|
||||||
s->UpdateData();
|
s->UpdateData();
|
||||||
data += to_wx(s->GetEntryData());
|
data += s->GetEntryData();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetClipboard(data);
|
SetClipboard(data);
|
||||||
|
|
Loading…
Reference in New Issue