Skip to content

Commit

Permalink
Merge pull request #6586 from n-stein/fix(#6583)
Browse files Browse the repository at this point in the history
fix(#6583): use non-reserved ids in freq notes menu
  • Loading branch information
vomikan committed Mar 15, 2024
2 parents 0e99b4c + 9f9f5e4 commit 0452691
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ EVT_CHOICE(ID_DIALOG_TRANS_TYPE, mmTransDialog::OnTransTypeChanged)
EVT_CHECKBOX(ID_DIALOG_TRANS_ADVANCED_CHECKBOX, mmTransDialog::OnAdvanceChecked)
EVT_BUTTON(wxID_FILE, mmTransDialog::OnAttachments)
EVT_BUTTON(ID_DIALOG_TRANS_CUSTOMFIELDS, mmTransDialog::OnMoreFields)
EVT_MENU_RANGE(wxID_LOWEST, wxID_LOWEST + 20, mmTransDialog::OnNoteSelected)
EVT_MENU_RANGE(wxID_HIGHEST, wxID_HIGHEST + 20, mmTransDialog::OnNoteSelected)
EVT_BUTTON(wxID_OK, mmTransDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, mmTransDialog::OnCancel)
EVT_CLOSE(mmTransDialog::OnQuit)
Expand Down Expand Up @@ -1133,7 +1133,7 @@ void mmTransDialog::OnFrequentUsedNotes(wxCommandEvent& WXUNUSED(event))
if (!frequentNotes_.empty())
{
wxMenu menu;
int id = wxID_LOWEST;
int id = wxID_HIGHEST;

for (const auto& entry : frequentNotes_) {
wxString label = entry.Mid(0, 36) + (entry.size() > 36 ? "..." : "");
Expand All @@ -1146,7 +1146,7 @@ void mmTransDialog::OnFrequentUsedNotes(wxCommandEvent& WXUNUSED(event))

void mmTransDialog::OnNoteSelected(wxCommandEvent& event)
{
int i = event.GetId() - wxID_LOWEST;
int i = event.GetId() - wxID_HIGHEST;

if (i > 0 && static_cast<size_t>(i) <= frequentNotes_.size()) {
if (!textNotes_->GetValue().EndsWith("\n") && !textNotes_->GetValue().empty())
Expand Down

0 comments on commit 0452691

Please sign in to comment.