From a7cd9cec31952b932ab80fb50cddec28aab74736 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 24 Jul 2020 23:18:24 +0200 Subject: WIP --- src/tools/dcpomatic.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/tools') diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 9cd99a265..ae6652847 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -646,9 +646,12 @@ private: void file_history (wxCommandEvent& event) { + if (event.GetId() < ID_file_history) { + return; + } + size_t const n = event.GetId() - ID_file_history; vector history = Config::instance()->history (); - int n = event.GetId() - ID_file_history; - if (n >= 0 && n < static_cast (history.size ()) && maybe_save_then_delete_film()) { + if (n < history.size() && maybe_save_then_delete_film()) { load_film (history[n]); } } @@ -1394,7 +1397,7 @@ private: delete _history_separator; _history_separator = 0; - int pos = _history_position; + unsigned int pos = _history_position; /* Clear out non-existant history items before we re-build the menu */ Config::instance()->clean_history (); @@ -1492,7 +1495,7 @@ private: wxMenu* _file_menu; shared_ptr _film; int _history_items; - int _history_position; + unsigned int _history_position; wxMenuItem* _history_separator; boost::signals2::scoped_connection _config_changed_connection; boost::signals2::scoped_connection _analytics_message_connection; -- cgit v1.2.3