Skip to content

Commit

Permalink
Prevent assertion in 'UndoManagerHistoryPanel.cpp' (#937)
Browse files Browse the repository at this point in the history
And some type changes/casting.
  • Loading branch information
crisisinaptica authored and sirjuddington committed Nov 12, 2018
1 parent 7b2ad04 commit 861aefc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/UI/Controls/UndoManagerHistoryPanel.cpp
Expand Up @@ -75,12 +75,12 @@ string UndoListView::getItemText(long item, long column, long index) const
{
if (column == 0)
{
string name = manager_->undoLevel(item)->getName();
return S_FMT("%d. %s", item + 1, name);
string name = manager_->undoLevel((unsigned) item)->getName();
return S_FMT("%lu. %s", item + 1, name);
}
else
{
return manager_->undoLevel(item)->getTimeStamp(false, true);
return manager_->undoLevel((unsigned) item)->getTimeStamp(false, true);
}
}
else
Expand Down Expand Up @@ -216,7 +216,7 @@ void UndoManagerHistoryPanel::setManager(UndoManager* manager)
// ----------------------------------------------------------------------------
void UndoManagerHistoryPanel::onItemRightClick(wxCommandEvent& e)
{
int index = list_levels_->getFocus();
long index = list_levels_->getFocus();
//wxMessageBox(S_FMT("Item %d", index));

wxMenu context;
Expand All @@ -238,7 +238,7 @@ void UndoManagerHistoryPanel::onItemRightClick(wxCommandEvent& e)
// ----------------------------------------------------------------------------
void UndoManagerHistoryPanel::onMenu(wxCommandEvent& e)
{
int index = list_levels_->getFocus();
long index = list_levels_->getFocus();

if (index <= manager_->getCurrentIndex())
{
Expand Down

0 comments on commit 861aefc

Please sign in to comment.