Merge branch 'avoid-unused-var-warnings' of https://github.com/PBfordev/wxWidgets

Avoid unused variable warnings.

See #23077.
This commit is contained in:
Vadim Zeitlin 2022-12-29 01:43:41 +01:00
commit 8120d3f75d
5 changed files with 5 additions and 35 deletions

View file

@ -3855,19 +3855,16 @@ void StdButtonSizerDialog::OnEvent(wxCommandEvent& WXUNUSED(event))
EnableDisableControls();
long flags = 0;
unsigned long numButtons = 0;
if (m_chkboxAffirmativeButton->IsChecked())
{
if (m_radiobtnOk->GetValue())
{
flags |= wxOK;
numButtons ++;
}
else if (m_radiobtnYes->GetValue())
{
flags |= wxYES;
numButtons ++;
}
}
@ -3876,13 +3873,11 @@ void StdButtonSizerDialog::OnEvent(wxCommandEvent& WXUNUSED(event))
if (m_radiobtnCancel->GetValue())
{
flags |= wxCANCEL;
numButtons ++;
}
else if (m_radiobtnClose->GetValue())
{
flags |= wxCLOSE;
numButtons ++;
}
}
@ -3890,19 +3885,16 @@ void StdButtonSizerDialog::OnEvent(wxCommandEvent& WXUNUSED(event))
if (m_chkboxApply->IsChecked())
{
flags |= wxAPPLY;
numButtons ++;
}
if (m_chkboxNo->IsChecked())
{
flags |= wxNO;
numButtons ++;
}
if (m_chkboxHelp->IsChecked())
{
flags |= wxHELP;
numButtons ++;
}
if (m_chkboxNoDefault->IsChecked())

View file

@ -210,29 +210,20 @@ bool wxGenericProgressDialog::Create( const wxString& title,
m_estimated =
m_remaining = nullptr;
// also count how many labels we really have
size_t nTimeLabels = 0;
wxSizer * const sizerLabels = new wxFlexGridSizer(2);
if ( style & wxPD_ELAPSED_TIME )
{
nTimeLabels++;
m_elapsed = CreateLabel(GetElapsedLabel(), sizerLabels);
}
if ( style & wxPD_ESTIMATED_TIME )
{
nTimeLabels++;
m_estimated = CreateLabel(GetEstimatedLabel(), sizerLabels);
}
if ( style & wxPD_REMAINING_TIME )
{
nTimeLabels++;
m_remaining = CreateLabel(GetRemainingLabel(), sizerLabels);
}
sizerTop->Add(sizerLabels, 0, wxALIGN_CENTER_HORIZONTAL | wxTOP, LAYOUT_MARGIN);

View file

@ -530,7 +530,7 @@ wxRect wxRibbonToolBar::GetToolRect(int tool_id)const
{
size_t group_count = m_groups.GetCount();
size_t g, t;
int pos = 0;
for(g = 0; g < group_count; ++g)
{
wxRibbonToolBarToolGroup* group = m_groups.Item(g);
@ -542,9 +542,7 @@ wxRect wxRibbonToolBar::GetToolRect(int tool_id)const
{
return wxRect(group->position + tool->position, tool->size);
}
++pos;
}
++pos; // Increment pos for group separator.
}
return wxRect();
}

View file

@ -3345,7 +3345,6 @@ bool wxRichTextParagraphLayoutBox::DeleteRange(const wxRichTextRange& range)
/// Get any text in this object for the given range
wxString wxRichTextParagraphLayoutBox::GetTextForRange(const wxRichTextRange& range) const
{
int lineCount = 0;
wxString text;
wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst();
while (node)
@ -3365,8 +3364,6 @@ wxString wxRichTextParagraphLayoutBox::GetTextForRange(const wxRichTextRange& ra
if ((childRange.GetEnd() == child->GetRange().GetEnd()) && node->GetNext())
text += wxT("\n");
lineCount ++;
}
node = node->GetNext();
}
@ -4902,7 +4899,9 @@ bool wxRichTextParagraph::Draw(wxDC& dc, wxRichTextDrawingContext& context, cons
// Loop through objects until we get to the one within range
wxRichTextObjectList::compatibility_iterator node2 = m_children.GetFirst();
#if wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING && wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS
int i = 0;
#endif
while (node2)
{
wxRichTextObject* child = node2->GetData();
@ -4939,7 +4938,9 @@ bool wxRichTextParagraph::Draw(wxDC& dc, wxRichTextDrawingContext& context, cons
child->Draw(dc, context, objectRange, selection, childRect, maxDescent, style);
objectPosition.x += objectSize.x;
#if wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING && wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS
i ++;
#endif
}
else if (child->GetRange().GetStart() > lineRange.GetEnd())
// Can break out of inner loop now since we've passed this line's range

View file

@ -1347,10 +1347,6 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
bool processed = DeleteSelectedContent(& newPos);
int deletions = 0;
if (processed)
deletions ++;
// Submit range in character positions, which are greater than caret positions,
if (newPos < GetFocusObject()->GetOwnRange().GetEnd()+1)
{
@ -1363,7 +1359,6 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
if (CanDeleteRange(* GetFocusObject(), range.FromInternal()))
{
GetFocusObject()->DeleteRangeWithUndo(range, this, & GetBuffer());
deletions ++;
}
processed = true;
}
@ -1375,7 +1370,6 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
if (CanDeleteRange(* GetFocusObject(), range.FromInternal()))
{
GetFocusObject()->DeleteRangeWithUndo(range, this, & GetBuffer());
deletions ++;
}
}
}
@ -1576,10 +1570,6 @@ bool wxRichTextCtrl::ProcessBackKey(wxKeyEvent& event, int flags)
bool processed = DeleteSelectedContent(& newPos);
int deletions = 0;
if (processed)
deletions ++;
// Submit range in character positions, which are greater than caret positions,
// so subtract 1 for deleted character and add 1 for conversion to character position.
if (newPos > -1)
@ -1593,7 +1583,6 @@ bool wxRichTextCtrl::ProcessBackKey(wxKeyEvent& event, int flags)
if (CanDeleteRange(* GetFocusObject(), range.FromInternal()))
{
GetFocusObject()->DeleteRangeWithUndo(range, this, & GetBuffer());
deletions ++;
}
processed = true;
}
@ -1605,7 +1594,6 @@ bool wxRichTextCtrl::ProcessBackKey(wxKeyEvent& event, int flags)
if (CanDeleteRange(* GetFocusObject(), range.FromInternal()))
{
GetFocusObject()->DeleteRangeWithUndo(range, this, & GetBuffer());
deletions ++;
}
}
}