Skip to content

Commit

Permalink
Usual cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhard Stein committed Dec 29, 2024
1 parent 8af8260 commit f185462
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/mmchecking_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ void TransactionListCtrl::doSearchText(const wxString& value)
while (true)
{
g_asc ? selectedItem-- : selectedItem++;
if (selectedItem < 0 || selectedItem >= m_trans.size())
if (selectedItem < 0 || selectedItem >= static_cast<long>(m_trans.size()))
break;

wxString test1 = Model_Currency::fromString2CLocale(value);
Expand Down
6 changes: 3 additions & 3 deletions src/mmcheckingpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ void mmCheckingPanel::filterTable()
bills = (isAllAccounts_ || isTrash_) ?
Model_Billsdeposits::instance().all() :
Model_Account::billsdeposits(this->m_account);
for (int i = 0; i < bills.size(); ++i)
for (unsigned int i = 0; i < bills.size(); ++i)
{
int limit = 1000; // this is enough for daily repetitions for one year
auto dates = Model_Billsdeposits::unroll(bills[i], m_end_date, limit);
for (int repeat_num = 1; repeat_num <= dates.size(); ++repeat_num)
for (unsigned int repeat_num = 1; repeat_num <= dates.size(); ++repeat_num)
bills_index.push_back({i, dates[repeat_num-1], repeat_num});
}
std::stable_sort(bills_index.begin(), bills_index.end(),
Expand Down Expand Up @@ -1104,7 +1104,7 @@ void mmCheckingPanel::OnViewPopupSelected(wxCommandEvent& event)
RefreshList();
}

void mmCheckingPanel::OnScheduled(wxCommandEvent& event)
void mmCheckingPanel::OnScheduled(wxCommandEvent&)
{
if (!isTrash_) {
m_scheduled_selected = m_header_scheduled->GetValue();
Expand Down
2 changes: 1 addition & 1 deletion src/mmcheckingpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class mmCheckingPanel : public mmPanelBase
void OnMouseLeftDown(wxCommandEvent& event);
void OnButtonRightDown(wxMouseEvent& event);
void OnViewPopupSelected(wxCommandEvent& event);
void OnScheduled(wxCommandEvent& event);
void OnScheduled(wxCommandEvent&);
void OnSearchTxtEntered(wxCommandEvent& event);

/* updates the checking panel data */
Expand Down
5 changes: 3 additions & 2 deletions src/mmframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,11 +1057,12 @@ void mmGUIFrame::OnTreeItemExpanded(wxTreeEvent& event)
}
//----------------------------------------------------------------------------

void mmGUIFrame::OnTreeItemCollapsing(wxTreeEvent& event)
void mmGUIFrame::OnTreeItemCollapsing(wxTreeEvent& /*event*/)
{
/*
mmTreeItemData* iData =
dynamic_cast<mmTreeItemData*>(m_nav_tree_ctrl->GetItemData(event.GetItem()));

*/
// disallow collapsing of HOME item
//if (mmTreeItemData::HOME_PAGE == iData->getType())
// event.Veto();
Expand Down
2 changes: 1 addition & 1 deletion src/mmframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class mmGUIFrame : public wxFrame
void OnViewAccountsTemporaryChange(wxCommandEvent& event);

void OnTreeItemExpanded(wxTreeEvent& event);
void OnTreeItemCollapsing(wxTreeEvent& event);
void OnTreeItemCollapsing(wxTreeEvent&);
void OnTreeItemCollapsed(wxTreeEvent& event);

void OnDropFiles(wxDropFilesEvent& event);
Expand Down
4 changes: 2 additions & 2 deletions src/mmpanelbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void mmListCtrl::CreateColumns()
std::vector<PANEL_COLUMN> sortedColumns = {};
for (unsigned int i = 0; i < columnOrder.size(); i++)
{
int index = std::find(m_real_columns.begin(), m_real_columns.end(), columnOrder[i]) - m_real_columns.begin();
unsigned int index = std::find(m_real_columns.begin(), m_real_columns.end(), columnOrder[i]) - m_real_columns.begin();
if (index < m_columns.size())
sortedColumns.push_back(m_columns[index]);
}
Expand Down Expand Up @@ -261,7 +261,7 @@ void mmListCtrl::OnHeaderMove(wxCommandEvent& WXUNUSED(event), int direction)
// find the next visible column
int distance = direction;
while (m_ColumnHeaderNbr + distance > 0
&& m_ColumnHeaderNbr + distance < m_columns.size() - 1
&& m_ColumnHeaderNbr + distance < static_cast<int>(m_columns.size()) - 1
&& GetColumnWidth(m_ColumnHeaderNbr + distance) == 0)
{
distance += direction;
Expand Down
4 changes: 2 additions & 2 deletions src/reports/budgetcategorysummary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ wxString mmReportBudgetCategorySummary::getHTMLText()

std::vector<int> totals_stack;
Model_Category::Data_Set subcats = Model_Category::sub_tree(category);
for (int i = 0; i < subcats.size(); i++) {
for (int i = 0; i < static_cast<int>(subcats.size()); i++) {
categLevel[subcats[i].CATEGID].first = 1;
estimated = budgetStats[subcats[i].CATEGID][budgetMonth];

Expand Down Expand Up @@ -283,7 +283,7 @@ wxString mmReportBudgetCategorySummary::getHTMLText()
}
hb.endTableRow();

if (i < subcats.size() - 1) { //not the last subcategory
if (i < static_cast<int>(subcats.size()) - 1) { //not the last subcategory
if (subcats[i].CATEGID == subcats[i + 1].PARENTID) totals_stack.push_back(i); //if next subcategory is our child, queue the total for after the children
else if (subcats[i].PARENTID != subcats[i + 1].PARENTID) { // last sibling -- we've exhausted this branch, so display all the totals we held on to
while (!totals_stack.empty() && subcats[totals_stack.back()].CATEGID != subcats[i + 1].PARENTID) {
Expand Down

0 comments on commit f185462

Please sign in to comment.