Skip to content

Commit

Permalink
Signess and const fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhard Stein committed Apr 26, 2024
1 parent d63613c commit ec37e6c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/filtertransdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ void mmFilterTransactionsDialog::OnShowColumnsButton(wxCommandEvent& /*event*/)
{
// We removed the 'Time' column from the list of names
// We need to reduce the index of any columns to the right to realign the indexes to the names in the dialog
for (int i = 0; i < hiddenCols.GetCount(); i++)
for (unsigned int i = 0; i < hiddenCols.GetCount(); i++)
{
if (hiddenCols[i] > COL_TIME)
hiddenCols[i] -= 1;
Expand Down Expand Up @@ -1567,7 +1567,6 @@ const wxString mmFilterTransactionsDialog::mmGetDescriptionToolTip() const
temp += (temp.empty() ? "" : ", ") + (mmGetAccountsID().empty() ? _("Transfer") : _("Transfer Out"));
value = temp;
}
value;
break;
}
case kNumberType:
Expand All @@ -1578,7 +1577,6 @@ const wxString mmFilterTransactionsDialog::mmGetDescriptionToolTip() const
value = wxString::Format("%i", static_cast<int>(d));
else
value = wxString::Format("%f", d);
value;
break;
}
case kArrayType:
Expand Down
8 changes: 4 additions & 4 deletions src/splittransactionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void mmSplitTransactionDialog::CreateControls()
SetSizeHints(sz.GetWidth(), sz.GetHeight(), -1, sz.GetHeight());
}

void mmSplitTransactionDialog::FillControls(int focusRow)
void mmSplitTransactionDialog::FillControls(const int focusRow)
{
DoWindowsFreezeThaw(this);
for (int row = (focusRow == -1 ? 0 : focusRow); row < m_splits_widgets.size(); row++)
Expand Down Expand Up @@ -332,10 +332,10 @@ void mmSplitTransactionDialog::FillControls(int focusRow)
DoWindowsFreezeThaw(this);
}

void mmSplitTransactionDialog::createNewRow(bool enabled)
void mmSplitTransactionDialog::createNewRow(const bool enabled)
{
int row = m_splits_widgets.size();
int catID = (row < m_splits.size()) ? m_splits.at(row).CATEGID : -1;
int catID = (row < int(m_splits.size())) ? m_splits.at(row).CATEGID : -1;

mmComboBoxCategory* ncbc = new mmComboBoxCategory(slider_, mmID_MAX + row
, wxDefaultSize, catID, true);
Expand Down Expand Up @@ -593,4 +593,4 @@ bool mmSplitTransactionDialog::mmDoCheckRow(int row)
m_splits.at(row).SPLITTRANSAMOUNT = amount;
m_splits.at(row).TAGS = m_splits_widgets.at(row).tags->GetTagIDs();
return true;
}
}
4 changes: 2 additions & 2 deletions src/splittransactionsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class mmSplitTransactionDialog: public wxDialog
);

void CreateControls();
void FillControls(int focusRow = -1);
void createNewRow(bool enabled);
void FillControls(const int focusRow = -1);
void createNewRow(const bool enabled);
void activateNewRow();
void UpdateSplitTotal();
void UpdateExtraInfo(int row);
Expand Down
2 changes: 1 addition & 1 deletion src/validators.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ inline void mmCalcValidator::OnChar(wxKeyEvent& event)
// Determine selection start/end to allow overwrite of decimal
long selStart, selEnd;
text_field->GetSelection(&selStart, &selEnd);
if (ind < value.Length() && (ind < selStart || ind >= selEnd))
if (ind < value.Length() && (ind < size_t(selStart) || ind >= size_t(selEnd)))
{
// check if after last decimal point there is an operation char (+-/*)
if (value.find('+', ind + 1) >= value.Length() && value.find('-', ind + 1) >= value.Length() &&
Expand Down

0 comments on commit ec37e6c

Please sign in to comment.