mirror of https://github.com/odrling/Aegisub
Work around more places where VC++ generates null pointers-to-members
This commit is contained in:
parent
101cd8e1e5
commit
0e8bc44539
|
@ -96,6 +96,10 @@ void time_edit_char_hook(wxKeyEvent &event) {
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Passing a pointer-to-member directly to a function sometimes does not work
|
||||||
|
// in VC++ 2015 Update 2, with it instead passing a null pointer
|
||||||
|
const auto AssDialogue_Actor = &AssDialogue::Actor;
|
||||||
|
const auto AssDialogue_Effect = &AssDialogue::Effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context)
|
SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context)
|
||||||
|
@ -317,10 +321,8 @@ void SubsEditBox::OnCommit(int type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == AssFile::COMMIT_NEW) {
|
if (type == AssFile::COMMIT_NEW) {
|
||||||
// Without this pointless variable vc++ 2015 passes null to PopulateList
|
PopulateList(effect_box, AssDialogue_Effect);
|
||||||
auto vs14_u2_workaround = &AssDialogue::Effect;
|
PopulateList(actor_box, AssDialogue_Actor);
|
||||||
PopulateList(effect_box, vs14_u2_workaround);
|
|
||||||
PopulateList(actor_box, vs14_u2_workaround = &AssDialogue::Actor);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (type & AssFile::COMMIT_STYLES)
|
else if (type & AssFile::COMMIT_STYLES)
|
||||||
|
@ -355,11 +357,11 @@ void SubsEditBox::UpdateFields(int type, bool repopulate_lists) {
|
||||||
active_style = line ? c->ass->GetStyle(line->Style) : nullptr;
|
active_style = line ? c->ass->GetStyle(line->Style) : nullptr;
|
||||||
style_edit_button->Enable(active_style != nullptr);
|
style_edit_button->Enable(active_style != nullptr);
|
||||||
|
|
||||||
if (repopulate_lists) PopulateList(effect_box, &AssDialogue::Effect);
|
if (repopulate_lists) PopulateList(effect_box, AssDialogue_Effect);
|
||||||
effect_box->ChangeValue(to_wx(line->Effect));
|
effect_box->ChangeValue(to_wx(line->Effect));
|
||||||
effect_box->SetStringSelection(to_wx(line->Effect));
|
effect_box->SetStringSelection(to_wx(line->Effect));
|
||||||
|
|
||||||
if (repopulate_lists) PopulateList(actor_box, &AssDialogue::Actor);
|
if (repopulate_lists) PopulateList(actor_box, AssDialogue_Actor);
|
||||||
actor_box->ChangeValue(to_wx(line->Actor));
|
actor_box->ChangeValue(to_wx(line->Actor));
|
||||||
actor_box->SetStringSelection(to_wx(line->Actor));
|
actor_box->SetStringSelection(to_wx(line->Actor));
|
||||||
}
|
}
|
||||||
|
@ -591,8 +593,8 @@ void SubsEditBox::OnStyleChange(wxCommandEvent &evt) {
|
||||||
|
|
||||||
void SubsEditBox::OnActorChange(wxCommandEvent &evt) {
|
void SubsEditBox::OnActorChange(wxCommandEvent &evt) {
|
||||||
bool amend = evt.GetEventType() == wxEVT_TEXT;
|
bool amend = evt.GetEventType() == wxEVT_TEXT;
|
||||||
SetSelectedRows(&AssDialogue::Actor, new_value(actor_box, evt), _("actor change"), AssFile::COMMIT_DIAG_META, amend);
|
SetSelectedRows(AssDialogue_Actor, new_value(actor_box, evt), _("actor change"), AssFile::COMMIT_DIAG_META, amend);
|
||||||
PopulateList(actor_box, &AssDialogue::Actor);
|
PopulateList(actor_box, AssDialogue_Actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubsEditBox::OnLayerEnter(wxCommandEvent &evt) {
|
void SubsEditBox::OnLayerEnter(wxCommandEvent &evt) {
|
||||||
|
@ -601,8 +603,8 @@ void SubsEditBox::OnLayerEnter(wxCommandEvent &evt) {
|
||||||
|
|
||||||
void SubsEditBox::OnEffectChange(wxCommandEvent &evt) {
|
void SubsEditBox::OnEffectChange(wxCommandEvent &evt) {
|
||||||
bool amend = evt.GetEventType() == wxEVT_TEXT;
|
bool amend = evt.GetEventType() == wxEVT_TEXT;
|
||||||
SetSelectedRows(&AssDialogue::Effect, new_value(effect_box, evt), _("effect change"), AssFile::COMMIT_DIAG_META, amend);
|
SetSelectedRows(AssDialogue_Effect, new_value(effect_box, evt), _("effect change"), AssFile::COMMIT_DIAG_META, amend);
|
||||||
PopulateList(effect_box, &AssDialogue::Effect);
|
PopulateList(effect_box, AssDialogue_Effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubsEditBox::OnCommentChange(wxCommandEvent &evt) {
|
void SubsEditBox::OnCommentChange(wxCommandEvent &evt) {
|
||||||
|
|
Loading…
Reference in New Issue