diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 6eccb3fff4..36e2fd1d7f 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4111,23 +4111,23 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) wxDataViewItem itemDragged = GetItemByRow( drag_item_row ); // Notify cell about drag - wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, m_owner->GetId() ); - event.SetEventObject( m_owner ); - event.SetItem( itemDragged ); - event.SetModel( model ); - if (!m_owner->HandleWindowEvent( event )) + wxDataViewEvent evt( wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, m_owner->GetId() ); + evt.SetEventObject( m_owner ); + evt.SetItem( itemDragged ); + evt.SetModel( model ); + if (!m_owner->HandleWindowEvent( evt )) return; - if (!event.IsAllowed()) + if (!evt.IsAllowed()) return; - wxDataObject *obj = event.GetDataObject(); + wxDataObject *obj = evt.GetDataObject(); if (!obj) return; wxDataViewDropSource drag( this, drag_item_row ); drag.SetData( *obj ); - /* wxDragResult res = */ drag.DoDragDrop(event.GetDragFlags()); + /* wxDragResult res = */ drag.DoDragDrop(evt.GetDragFlags()); delete obj; } return; diff --git a/src/msw/artmsw.cpp b/src/msw/artmsw.cpp index 04885e3d6b..404648effd 100644 --- a/src/msw/artmsw.cpp +++ b/src/msw/artmsw.cpp @@ -197,7 +197,7 @@ wxBitmap wxWindowsArtProvider::CreateBitmap(const wxArtID& id, wxIcon icon; icon.CreateFromHICON( (WXHICON)sii.hIcon ); - wxBitmap bitmap( icon ); + bitmap = wxBitmap(icon); ::DestroyIcon(sii.hIcon); if ( bitmap.IsOk() ) diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 8000f7c478..51a2dc6700 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -685,7 +685,7 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) unsigned char val = *src++; unsigned char reversed = 0; - for ( int bits = 0; bits < 8; bits++) + for ( int bit = 0; bit < 8; bit++) { reversed <<= 1; reversed |= (unsigned char)(val & 0x01); diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 5092584450..1e5df551cd 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -663,7 +663,7 @@ int wxFileDialog::ShowModal() const wxChar* extension = filterBuffer.t_str(); int maxFilter = (int)(of.nFilterIndex*2L) - 1; - for( int i = 0; i < maxFilter; i++ ) // get extension + for( int j = 0; j < maxFilter; j++ ) // get extension extension = extension + wxStrlen( extension ) + 1; // use dummy name a to avoid assert in AppendExtension @@ -725,11 +725,11 @@ int wxFileDialog::ShowModal() m_fileNames.Add(toke.GetNextToken()); #endif // OFN_EXPLORER - wxString dir(m_dir); + m_path = m_dir; if ( m_dir.Last() != wxT('\\') ) - dir += wxT('\\'); + m_path += wxT('\\'); - m_path = dir + m_fileName; + m_path += m_fileName; m_filterIndex = (int)of.nFilterIndex - 1; } else @@ -745,7 +745,7 @@ int wxFileDialog::ShowModal() const wxChar* extension = filterBuffer.t_str(); int maxFilter = (int)(of.nFilterIndex*2L) - 1; - for( int i = 0; i < maxFilter; i++ ) // get extension + for( int j = 0; j < maxFilter; j++ ) // get extension extension = extension + wxStrlen( extension ) + 1; m_fileName = AppendExtension(fileNameBuffer, extension); diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index 6952aee636..9441b830a1 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -1761,11 +1761,11 @@ void wxGDIPlusContext::DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxD interim.GetPixelFormat(),&data); bool hasAlpha = false; - for ( size_t y = 0 ; y < height && !hasAlpha ; ++y) + for ( size_t yy = 0 ; yy < height && !hasAlpha ; ++yy) { - for( size_t x = 0 ; x < width && !hasAlpha; ++x) + for( size_t xx = 0 ; xx < width && !hasAlpha; ++xx) { - ARGB *dest = (ARGB*)((BYTE*)data.Scan0 + data.Stride*y + x*4); + ARGB *dest = (ARGB*)((BYTE*)data.Scan0 + data.Stride*yy + xx*4); if ( ( *dest & Color::AlphaMask ) != 0 ) hasAlpha = true; } diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 9fb257735d..b5415be66e 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -688,7 +688,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) { // we must use position in SetOwnerDrawnMenuItem because // all separators have the same id - int pos = 0; + int position = 0; wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst(); while (node) { @@ -697,14 +697,14 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) if ( !item->IsOwnerDrawn()) { item->SetOwnerDrawn(true); - SetOwnerDrawnMenuItem(GetHmenu(), pos, + SetOwnerDrawnMenuItem(GetHmenu(), position, reinterpret_cast(item), TRUE); } item->SetMarginWidth(m_maxBitmapWidth); node = node->GetNext(); - pos++; + position++; } // set menu as ownerdrawn diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index 2106ba7cd7..35c3a67e00 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -1074,13 +1074,13 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc, SIZE accelSize; ::GetTextExtentPoint32(hdc, accel.c_str(), accel.length(), &accelSize); - int flags = DST_TEXT; + flags = DST_TEXT; // themes menu is using specified color for disabled labels if ( data->MenuLayout() == MenuDrawData::Classic && (stat & wxODDisabled) && !(stat & wxODSelected) ) flags |= DSS_DISABLED; - int x = rcText.right - data->ArrowMargin.GetTotalX() + x = rcText.right - data->ArrowMargin.GetTotalX() - data->ArrowSize.cx - data->ArrowBorder; @@ -1090,7 +1090,7 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc, else x -= m_parentMenu->GetMaxAccelWidth(); - int y = rcText.top + (rcText.bottom - rcText.top - accelSize.cy) / 2; + y = rcText.top + (rcText.bottom - rcText.top - accelSize.cy) / 2; ::DrawState(hdc, NULL, NULL, wxMSW_CONV_LPARAM(accel), accel.length(), x, y, 0, 0, flags); diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index 791417647e..9df2fc99b9 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -300,7 +300,7 @@ void wxMessageDialog::ReplaceStaticWithEdit() if ( !hwndBtn ) continue; // it's ok, not all buttons are always present - RECT rc = wxGetWindowRect(hwndBtn); + rc = wxGetWindowRect(hwndBtn); rc.top -= dh; rc.bottom -= dh; rc.left += dw/2; diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 5644db902d..b3f42c5118 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -1289,8 +1289,8 @@ wxColour wxNotebook::GetThemeBackgroundColour() const WCHAR szwThemeColor[256]; if (S_OK == wxUxThemeEngine::Get()->GetCurrentThemeName(szwThemeFile, 1024, szwThemeColor, 256, NULL, 0)) { - wxString themeFile(szwThemeFile), themeColor(szwThemeColor); - if (themeFile.Find(wxT("Aero")) != -1 && themeColor == wxT("NormalColor")) + wxString themeFile(szwThemeFile); + if (themeFile.Find(wxT("Aero")) != -1 && wxString(szwThemeColor) == wxT("NormalColor")) s_AeroStatus = 1; else s_AeroStatus = 0; diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp index 654fe80c3a..293b31f8b3 100644 --- a/src/msw/ole/activex.cpp +++ b/src/msw/ole/activex.cpp @@ -1007,13 +1007,13 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) // wxAutoOleInterface<> assumes a ref has already been added // TYPEATTR - TYPEATTR *ta = NULL; - hret = ti->GetTypeAttr(&ta); + TYPEATTR *ta2 = NULL; + hret = ti->GetTypeAttr(&ta2); CHECK_HR(hret); - if (ta->typekind == TKIND_DISPATCH) + if (ta2->typekind == TKIND_DISPATCH) { - // WXOLE_TRACEOUT("GUID = " << GetIIDName(ta->guid).c_str()); + // WXOLE_TRACEOUT("GUID = " << GetIIDName(ta2->guid).c_str()); if (defEventSink) { wxAutoIConnectionPoint cp; @@ -1022,8 +1022,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) wxAutoIConnectionPointContainer cpContainer(IID_IConnectionPointContainer, m_ActiveX); wxASSERT( cpContainer.IsOk()); - HRESULT hret = - cpContainer->FindConnectionPoint(ta->guid, cp.GetRef()); + hret = cpContainer->FindConnectionPoint(ta2->guid, cp.GetRef()); // Notice that the return value of CONNECT_E_NOCONNECTION is // expected if the interface doesn't support connection points. @@ -1035,7 +1034,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) if ( cp ) { wxActiveXEvents * const - events = new wxActiveXEvents(this, ta->guid); + events = new wxActiveXEvents(this, ta2->guid); hret = cp->Advise(events, &adviseCookie); // We don't need this object any more and cp will keep a @@ -1048,7 +1047,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) } } - ti->ReleaseTypeAttr(ta); + ti->ReleaseTypeAttr(ta2); } // free diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 2e4856ea74..8c5b1b1c35 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -356,13 +356,13 @@ void wxWindowsPrintPreview::DetermineScaling() if ( printerDC.IsOk() ) { wxPrinterDCImpl *impl = (wxPrinterDCImpl*) printerDC.GetImpl(); - HDC dc = GetHdcOf(*impl); - printerWidthMM = ::GetDeviceCaps(dc, HORZSIZE); - printerHeightMM = ::GetDeviceCaps(dc, VERTSIZE); - printerXRes = ::GetDeviceCaps(dc, HORZRES); - printerYRes = ::GetDeviceCaps(dc, VERTRES); - logPPIPrinterX = ::GetDeviceCaps(dc, LOGPIXELSX); - logPPIPrinterY = ::GetDeviceCaps(dc, LOGPIXELSY); + HDC hdc = GetHdcOf(*impl); + printerWidthMM = ::GetDeviceCaps(hdc, HORZSIZE); + printerHeightMM = ::GetDeviceCaps(hdc, VERTSIZE); + printerXRes = ::GetDeviceCaps(hdc, HORZRES); + printerYRes = ::GetDeviceCaps(hdc, VERTRES); + logPPIPrinterX = ::GetDeviceCaps(hdc, LOGPIXELSX); + logPPIPrinterY = ::GetDeviceCaps(hdc, LOGPIXELSY); paperRect = printerDC.GetPaperRect(); diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index b5f99d3853..c74360b00f 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -79,11 +79,11 @@ bool wxSpinButton::Create(wxWindow *parent, // get the right size for the control if ( width <= 0 || height <= 0 ) { - wxSize size = DoGetBestSize(); + wxSize bestSize = DoGetBestSize(); if ( width <= 0 ) - width = size.x; + width = bestSize.x; if ( height <= 0 ) - height = size.y; + height = bestSize.y; } if ( x < 0 ) diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 0d604a4bb0..2b1d67b847 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -194,12 +194,12 @@ void wxSpinCtrl::OnChar(wxKeyEvent& event) { case WXK_RETURN: { - wxCommandEvent event(wxEVT_TEXT_ENTER, m_windowId); - InitCommandEvent(event); + wxCommandEvent evt(wxEVT_TEXT_ENTER, m_windowId); + InitCommandEvent(evt); wxString val = wxGetWindowText(m_hwndBuddy); - event.SetString(val); - event.SetInt(GetValue()); - if ( HandleWindowEvent(event) ) + evt.SetString(val); + evt.SetInt(GetValue()); + if ( HandleWindowEvent(evt) ) return; break; } diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index 9a5637c01b..940f8e7091 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -479,8 +479,7 @@ void wxStaticBox::PaintForeground(wxDC& dc, const RECT&) // the label: this is consistent with the behaviour under pre-XP // systems (i.e. without visual themes) and generally makes sense wxBrush brush = wxBrush(GetBackgroundColour()); - wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl(); - ::FillRect(GetHdcOf(*impl), &dimensions, GetHbrushOf(brush)); + ::FillRect(hdc, &dimensions, GetHbrushOf(brush)); } else // paint parent background { diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 2e1fc3cd49..1774f222b7 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1974,10 +1974,10 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) { case WXK_RETURN: { - wxCommandEvent event(wxEVT_TEXT_ENTER, m_windowId); - InitCommandEvent(event); - event.SetString(GetValue()); - if ( HandleWindowEvent(event) ) + wxCommandEvent evt(wxEVT_TEXT_ENTER, m_windowId); + InitCommandEvent(evt); + evt.SetString(GetValue()); + if ( HandleWindowEvent(evt) ) if ( !HasFlag(wxTE_MULTILINE) ) return; //else: multiline controls need Enter for themselves diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 1630ef47cf..ff76183d42 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -799,10 +799,10 @@ bool wxToolBar::Realize() // MapBitmap() to work correctly for ( int y = 0; y < h; y++ ) { - for ( int x = 0; x < w; x++ ) + for ( int xx = 0; xx < w; xx++ ) { - if ( imgGreyed.IsTransparent(x, y) ) - imgGreyed.SetRGB(x, y, + if ( imgGreyed.IsTransparent(xx, y) ) + imgGreyed.SetRGB(xx, y, wxLIGHT_GREY->Red(), wxLIGHT_GREY->Green(), wxLIGHT_GREY->Blue()); @@ -885,11 +885,11 @@ bool wxToolBar::Realize() if ( addBitmap ) // no old bitmap or we can't replace it { - TBADDBITMAP addBitmap; - addBitmap.hInst = 0; - addBitmap.nID = (UINT_PTR)hBitmap; + TBADDBITMAP tbAddBitmap; + tbAddBitmap.hInst = 0; + tbAddBitmap.nID = (UINT_PTR)hBitmap; if ( ::SendMessage(GetHwnd(), TB_ADDBITMAP, - (WPARAM) nButtons, (LPARAM)&addBitmap) == -1 ) + (WPARAM) nButtons, (LPARAM)&tbAddBitmap) == -1 ) { wxFAIL_MSG(wxT("Could not add bitmap to toolbar")); } @@ -1025,12 +1025,12 @@ bool wxToolBar::Realize() while ( nodePrev ) { TBBUTTON& prevButton = buttons[prevIndex]; - wxToolBarToolBase *tool = nodePrev->GetData(); - if ( !tool->IsButton() || tool->GetKind() != wxITEM_RADIO ) + wxToolBarToolBase *toolPrev = nodePrev->GetData(); + if ( !toolPrev->IsButton() || toolPrev->GetKind() != wxITEM_RADIO ) break; - if ( tool->Toggle(false) ) - DoToggleTool(tool, false); + if ( toolPrev->Toggle(false) ) + DoToggleTool(toolPrev, false); prevButton.fsState &= ~TBSTATE_CHECKED; nodePrev = nodePrev->GetPrevious(); diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 88637e1ced..8bc7a6ac09 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1525,10 +1525,10 @@ wxTreeItemId wxTreeCtrl::DoInsertAfter(const wxTreeItemId& parent, // need this to make the "[+]" appear if ( firstChild ) { - TVGetItemRectParam param; + TVGetItemRectParam param2; - wxTreeView_GetItemRect(GetHwnd(), HITEM(parent), param, FALSE); - ::InvalidateRect(GetHwnd(), ¶m.rect, FALSE); + wxTreeView_GetItemRect(GetHwnd(), HITEM(parent), param2, FALSE); + ::InvalidateRect(GetHwnd(), ¶m2.rect, FALSE); } // associate the application tree item with Win32 tree item handle diff --git a/src/msw/window.cpp b/src/msw/window.cpp index a288c5c5c5..85340d781f 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2819,17 +2819,17 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, case WM_MOVING: { LPRECT pRect = (LPRECT)lParam; - wxRect rc; - rc.SetLeft(pRect->left); - rc.SetTop(pRect->top); - rc.SetRight(pRect->right); - rc.SetBottom(pRect->bottom); - processed = HandleMoving(rc); + wxRect rect; + rect.SetLeft(pRect->left); + rect.SetTop(pRect->top); + rect.SetRight(pRect->right); + rect.SetBottom(pRect->bottom); + processed = HandleMoving(rect); if (processed) { - pRect->left = rc.GetLeft(); - pRect->top = rc.GetTop(); - pRect->right = rc.GetRight(); - pRect->bottom = rc.GetBottom(); + pRect->left = rect.GetLeft(); + pRect->top = rect.GetTop(); + pRect->right = rect.GetRight(); + pRect->bottom = rect.GetBottom(); } } break; @@ -2849,17 +2849,17 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, case WM_SIZING: { LPRECT pRect = (LPRECT)lParam; - wxRect rc; - rc.SetLeft(pRect->left); - rc.SetTop(pRect->top); - rc.SetRight(pRect->right); - rc.SetBottom(pRect->bottom); - processed = HandleSizing(rc); + wxRect rect; + rect.SetLeft(pRect->left); + rect.SetTop(pRect->top); + rect.SetRight(pRect->right); + rect.SetBottom(pRect->bottom); + processed = HandleSizing(rect); if (processed) { - pRect->left = rc.GetLeft(); - pRect->top = rc.GetTop(); - pRect->right = rc.GetRight(); - pRect->bottom = rc.GetBottom(); + pRect->left = rect.GetLeft(); + pRect->top = rect.GetTop(); + pRect->right = rect.GetRight(); + pRect->bottom = rect.GetBottom(); } } break;