Skip to content

Commit

Permalink
Allow setting Encoding=-1 in style editor
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1t3cht committed Mar 19, 2024
1 parent 1515c77 commit 897ca32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/ass_style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ void AssStyle::UpdateData() {

void AssStyle::GetEncodings(wxArrayString &encodingStrings) {
encodingStrings.Clear();
encodingStrings.Add(wxString("-1 - ") + _("Auto-detect base direction (libass only)"));
encodingStrings.Add(wxString("0 - ") + _("ANSI"));
encodingStrings.Add(wxString("1 - ") + _("Default"));
encodingStrings.Add(wxString("2 - ") + _("Symbol"));
Expand Down
6 changes: 4 additions & 2 deletions src/dialog_style_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
break;
}
}
if (!found) Encoding->Select(0);
if (!found) Encoding->Select(2);

// Style name sizer
NameSizer->Add(StyleName, 1, wxALL, 0);
Expand Down Expand Up @@ -472,8 +472,10 @@ void DialogStyleEditor::UpdateWorkStyle() {

work->font = from_wx(FontName->GetValue());

wxString encoding_selection = Encoding->GetValue();
wxString encoding_num = encoding_selection.substr(0, 1) + encoding_selection.substr(1).BeforeFirst('-'); // Have to account for -1
long templ = 0;
Encoding->GetValue().BeforeFirst('-').ToLong(&templ);
encoding_num.ToLong(&templ);
work->encoding = templ;

work->borderstyle = OutlineType->IsChecked() ? 3 : 1;
Expand Down

0 comments on commit 897ca32

Please sign in to comment.