Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhard Stein committed Sep 29, 2024
1 parent e8fffd5 commit 766299c
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/billsdepositsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1350,8 +1350,8 @@ void mmBDDialog::setRepeatType(int repeatType)
index.resize(BILLSDEPOSITS_REPEATS.size(), -1);
for (size_t i = 0; i < BILLSDEPOSITS_REPEATS.size(); i++)
{
int j = BILLSDEPOSITS_REPEATS.at(i).first;
if (j >= 0 && j < BILLSDEPOSITS_REPEATS.size() && index.at(j) == -1)
unsigned int j = BILLSDEPOSITS_REPEATS.at(i).first;
if (j < BILLSDEPOSITS_REPEATS.size() && index.at(j) == -1)
index.at(j) = i;
else
wxFAIL;
Expand Down
4 changes: 2 additions & 2 deletions src/categdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,9 @@ void mmCategDialog::OnMenuSelected(wxCommandEvent& event)
, wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION);
if (msgDlg.ShowModal() == wxID_YES)
{
const auto categList = Model_Category::instance().all();
auto categList = Model_Category::instance().all();
Model_Category::instance().Savepoint();
for (auto catItem : categList)
for (auto &catItem : categList)
{
catItem.ACTIVE = 1;
Model_Category::instance().save(&catItem);
Expand Down
8 changes: 4 additions & 4 deletions src/mmchecking_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,12 @@ void TransactionListCtrl::OnMouseRightClick(wxMouseEvent& event)
menu.Append(MENU_TREEPOPUP_RESTORE_VIEWED, _("Restore &all transactions in current view..."));
}
bool columnIsAmount = false;
long column = getColumnFromPosition(event.GetX());
unsigned long column = getColumnFromPosition(event.GetX());
int flags;
long row = HitTest(event.GetPosition(), flags);
if (row >= 0 && flags & wxLIST_HITTEST_ONITEM)
unsigned long row = HitTest(event.GetPosition(), flags);
if (flags & wxLIST_HITTEST_ONITEM)
{
if (column >= 0 && column < m_columns.size())
if (column < m_columns.size())
{
wxString menuItemText;
wxString refType = Model_Attachment::reftype_desc(Model_Attachment::TRANSACTION);
Expand Down
2 changes: 1 addition & 1 deletion src/mmcheckingpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ void mmCheckingPanel::CreateControls()
std::vector<int> sortedRealColumns = {};
for (const auto& i : sortedColumnList)
{
for (int j = 0; j < m_listCtrlAccount->m_columns.size(); j++)
for (unsigned int j = 0; j < m_listCtrlAccount->m_columns.size(); j++)
{
auto k = m_listCtrlAccount->m_columns[j];
auto l = m_listCtrlAccount->m_real_columns[j];
Expand Down
2 changes: 1 addition & 1 deletion src/mmcustomdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ void mmCustomData::SetStringValue(int fieldId, const wxString& value, bool hasCh
SetWidgetChanged(widget_id, value);
}

bool mmCustomData::ValidateCustomValues(int ref_id)
bool mmCustomData::ValidateCustomValues(int)
{
bool is_valid = true;
for (const auto &field : m_fields)
Expand Down
2 changes: 1 addition & 1 deletion src/mmcustomdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class mmCustomData : public wxDialog
bool SaveCustomValues(int ref_id);
void UpdateCustomValues(int ref_id);
void SetStringValue(int fieldID, const wxString& value, bool hasChanged = false);
bool ValidateCustomValues(int ref_id);
bool ValidateCustomValues(int);
const wxString GetWidgetData(wxWindowID controlID) const;
void SetWidgetData(wxWindowID controlID, const wxString& value);
int GetWidgetType(wxWindowID controlID) const;
Expand Down
6 changes: 3 additions & 3 deletions src/mmhomepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ void htmlWidgetTop7Categories::getTopCategoryStats(


htmlWidgetBillsAndDeposits::htmlWidgetBillsAndDeposits(const wxString& title, mmDateRange* date_range)
: title_(title)
, date_range_(date_range)
: date_range_(date_range)
, title_(title)
{}

htmlWidgetBillsAndDeposits::~htmlWidgetBillsAndDeposits()
Expand Down Expand Up @@ -793,7 +793,7 @@ const wxString htmlWidgetCurrency::getHtmlText()
std::map<wxString, double> usedRates;
const auto currencies = Model_Currency::instance().all();

for (const auto currency : currencies)
for (const auto &currency : currencies)
{
if (Model_Account::is_used(currency)) {

Expand Down
4 changes: 2 additions & 2 deletions src/mmreportspanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ mmReportsPanel::mmReportsPanel(
wxWindowID winid, const wxPoint& pos,
const wxSize& size, long style,
const wxString& name)
: rb_(rb)
, m_frame(frame)
: m_frame(frame)
, rb_(rb)
, cleanup_(cleanupReport)
{
Create(parent, winid, pos, size, style, name);
Expand Down
5 changes: 4 additions & 1 deletion src/reports/transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

mmReportTransactions::mmReportTransactions(wxSharedPtr<mmFilterTransactionsDialog>& transDialog)
: mmPrintableBase("Transaction Report")
, m_transDialog(transDialog)
, trans_()
, m_transDialog(transDialog)
{
}

Expand Down Expand Up @@ -244,6 +244,7 @@ table {
case Model_CustomField::TYPE_ID_BOOLEAN:
nameCSS.Append(" text-center");
break;
default: break;
}
hb.addTableHeaderCell(name, nameCSS);
}
Expand Down Expand Up @@ -323,10 +324,12 @@ table {
amount = -amount;
const double convRate = Model_CurrencyHistory::getDayRate(curr->CURRENCYID, transaction.TRANSDATE);
if (showColumnById(mmFilterTransactionsDialog::COL_AMOUNT))
{
if (Model_Checking::status_id(transaction.STATUS) == Model_Checking::STATUS_ID_VOID)
hb.addCurrencyCell(Model_Checking::amount(transaction, acc->ACCOUNTID), curr, -1, true);
else if (transaction.DELETEDTIME.IsEmpty())
hb.addCurrencyCell(amount, curr);
}
total[curr->CURRENCYID] += amount;
grand_total[curr->CURRENCYID] += amount;
total_in_base_curr[curr->CURRENCYID] += amount * convRate;
Expand Down
2 changes: 1 addition & 1 deletion src/transactionsupdatedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ void transactionsUpdateDialog::SetPayeeTransferControls()
}
}

void transactionsUpdateDialog::OnTransTypeChanged(wxCommandEvent& event)
void transactionsUpdateDialog::OnTransTypeChanged(wxCommandEvent&)
{
SetPayeeTransferControls();
}
Expand Down
2 changes: 1 addition & 1 deletion src/transactionsupdatedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class transactionsUpdateDialog : public wxDialog
void OnComboKey(wxKeyEvent& event);
void onFocusChange(wxChildFocusEvent& event);
void SetPayeeTransferControls();
void OnTransTypeChanged(wxCommandEvent& event);
void OnTransTypeChanged(wxCommandEvent&);
void OnMoreFields(wxCommandEvent& event);

private:
Expand Down

0 comments on commit 766299c

Please sign in to comment.