Fix 'declaration hides previous local declaration' warnings

This commit is contained in:
Maarten Bent
2019-11-21 21:29:36 +01:00
parent bfe737e7e7
commit 016f00777e
2 changed files with 33 additions and 33 deletions

View File

@@ -1190,17 +1190,17 @@ void MyFrame::WriteInitialText()
r.Newline(); r.Newline();
wxRichTextAttr attr; wxRichTextAttr attr1;
attr.GetTextBoxAttr().GetMargins().GetLeft().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); attr1.GetTextBoxAttr().GetMargins().GetLeft().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS);
attr.GetTextBoxAttr().GetMargins().GetTop().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); attr1.GetTextBoxAttr().GetMargins().GetTop().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS);
attr.GetTextBoxAttr().GetMargins().GetRight().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); attr1.GetTextBoxAttr().GetMargins().GetRight().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS);
attr.GetTextBoxAttr().GetMargins().GetBottom().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); attr1.GetTextBoxAttr().GetMargins().GetBottom().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS);
attr.GetTextBoxAttr().GetBorder().SetColour(*wxBLACK); attr1.GetTextBoxAttr().GetBorder().SetColour(*wxBLACK);
attr.GetTextBoxAttr().GetBorder().SetWidth(1, wxTEXT_ATTR_UNITS_PIXELS); attr1.GetTextBoxAttr().GetBorder().SetWidth(1, wxTEXT_ATTR_UNITS_PIXELS);
attr.GetTextBoxAttr().GetBorder().SetStyle(wxTEXT_BOX_ATTR_BORDER_SOLID); attr1.GetTextBoxAttr().GetBorder().SetStyle(wxTEXT_BOX_ATTR_BORDER_SOLID);
wxRichTextBox* textBox = r.WriteTextBox(attr); wxRichTextBox* textBox = r.WriteTextBox(attr1);
r.SetFocusObject(textBox); r.SetFocusObject(textBox);
r.WriteText("This is a text box. Just testing! Once more unto the breach, dear friends, once more..."); r.WriteText("This is a text box. Just testing! Once more unto the breach, dear friends, once more...");
@@ -1216,22 +1216,22 @@ void MyFrame::WriteInitialText()
r.Newline(); r.Newline();
wxRichTextAttr attr; wxRichTextAttr attr1;
attr.GetTextBoxAttr().GetMargins().GetLeft().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); attr1.GetTextBoxAttr().GetMargins().GetLeft().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS);
attr.GetTextBoxAttr().GetMargins().GetTop().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); attr1.GetTextBoxAttr().GetMargins().GetTop().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS);
attr.GetTextBoxAttr().GetMargins().GetRight().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); attr1.GetTextBoxAttr().GetMargins().GetRight().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS);
attr.GetTextBoxAttr().GetMargins().GetBottom().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); attr1.GetTextBoxAttr().GetMargins().GetBottom().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS);
attr.GetTextBoxAttr().GetPadding() = attr.GetTextBoxAttr().GetMargins(); attr1.GetTextBoxAttr().GetPadding() = attr.GetTextBoxAttr().GetMargins();
attr.GetTextBoxAttr().GetBorder().SetColour(*wxBLACK); attr1.GetTextBoxAttr().GetBorder().SetColour(*wxBLACK);
attr.GetTextBoxAttr().GetBorder().SetWidth(1, wxTEXT_ATTR_UNITS_PIXELS); attr1.GetTextBoxAttr().GetBorder().SetWidth(1, wxTEXT_ATTR_UNITS_PIXELS);
attr.GetTextBoxAttr().GetBorder().SetStyle(wxTEXT_BOX_ATTR_BORDER_SOLID); attr1.GetTextBoxAttr().GetBorder().SetStyle(wxTEXT_BOX_ATTR_BORDER_SOLID);
wxRichTextAttr cellAttr = attr; wxRichTextAttr cellAttr = attr1;
cellAttr.GetTextBoxAttr().GetWidth().SetValue(200, wxTEXT_ATTR_UNITS_PIXELS); cellAttr.GetTextBoxAttr().GetWidth().SetValue(200, wxTEXT_ATTR_UNITS_PIXELS);
cellAttr.GetTextBoxAttr().GetHeight().SetValue(150, wxTEXT_ATTR_UNITS_PIXELS); cellAttr.GetTextBoxAttr().GetHeight().SetValue(150, wxTEXT_ATTR_UNITS_PIXELS);
wxRichTextTable* table = r.WriteTable(6, 4, attr, cellAttr); wxRichTextTable* table = r.WriteTable(6, 4, attr1, cellAttr);
int i, j; int i, j;
for (j = 0; j < table->GetRowCount(); j++) for (j = 0; j < table->GetRowCount(); j++)
@@ -1382,15 +1382,15 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
if (dialog.ShowModal() == wxID_OK) if (dialog.ShowModal() == wxID_OK)
{ {
wxString path = dialog.GetPath(); wxString path1 = dialog.GetPath();
if (!path.empty()) if (!path1.empty())
{ {
int filterIndex = dialog.GetFilterIndex(); int filterIndex = dialog.GetFilterIndex();
int fileType = (filterIndex < (int) fileTypes.GetCount()) int fileType = (filterIndex < (int) fileTypes.GetCount())
? fileTypes[filterIndex] ? fileTypes[filterIndex]
: wxRICHTEXT_TYPE_TEXT; : wxRICHTEXT_TYPE_TEXT;
m_richTextCtrl->LoadFile(path, fileType); m_richTextCtrl->LoadFile(path1, fileType);
} }
} }
} }
@@ -1420,14 +1420,14 @@ void MyFrame::OnSaveAs(wxCommandEvent& WXUNUSED(event))
if (dialog.ShowModal() == wxID_OK) if (dialog.ShowModal() == wxID_OK)
{ {
wxString path = dialog.GetPath(); wxString path1 = dialog.GetPath();
if (!path.empty()) if (!path1.empty())
{ {
wxBusyCursor busy; wxBusyCursor busy;
wxStopWatch stopwatch; wxStopWatch stopwatch;
m_richTextCtrl->SaveFile(path); m_richTextCtrl->SaveFile(path1);
long t = stopwatch.Time(); long t = stopwatch.Time();
wxLogDebug("Saving took %ldms", t); wxLogDebug("Saving took %ldms", t);
@@ -2315,10 +2315,10 @@ wxRichTextTable* MyRichTextCtrl::FindTable() const
while (obj) while (obj)
{ {
obj = obj->GetParent(); obj = obj->GetParent();
wxRichTextTable* table = wxDynamicCast(obj, wxRichTextTable); wxRichTextTable* table1 = wxDynamicCast(obj, wxRichTextTable);
if (table) if (table1)
{ {
return table; return table1;
} }
} }

View File

@@ -677,8 +677,8 @@ wxThread::ExitCode ThreadWorker::Entry()
} else { } else {
//wxLogMessage("ThreadWorker: Connected. Sending %d bytes of data",m_outsize); //wxLogMessage("ThreadWorker: Connected. Sending %d bytes of data",m_outsize);
etype = WorkerEvent::SENDING; etype = WorkerEvent::SENDING;
WorkerEvent e(this,etype); WorkerEvent e1(this,etype);
wxGetApp().AddPendingEvent(e); wxGetApp().AddPendingEvent(e1);
int to_process = m_outsize; int to_process = m_outsize;
do { do {
m_clientSocket->Write(m_outbuf,m_outsize); m_clientSocket->Write(m_outbuf,m_outsize);
@@ -692,8 +692,8 @@ wxThread::ExitCode ThreadWorker::Entry()
if (!failed) { if (!failed) {
etype = WorkerEvent::RECEIVING; etype = WorkerEvent::RECEIVING;
WorkerEvent e(this,etype); WorkerEvent e2(this,etype);
wxGetApp().AddPendingEvent(e); wxGetApp().AddPendingEvent(e2);
to_process = m_insize; to_process = m_insize;
do { do {
m_clientSocket->Read(m_inbuf,m_insize); m_clientSocket->Read(m_inbuf,m_insize);