Applied patch [ 807164 ] fixes for core library
authorJulian Smart <julian@anthemion.co.uk>
Thu, 18 Sep 2003 13:42:22 +0000 (13:42 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 18 Sep 2003 13:42:22 +0000 (13:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wincmn.cpp
src/msw/listctrl.cpp
src/msw/ole/access.cpp
src/msw/window.cpp

index 6d770e2aa3659889ed22491a68c8483aebbb3797..ecd50f67349052e78b91c38d127d4b8d64e5aa73 100644 (file)
@@ -2210,7 +2210,7 @@ wxWindow* wxGetTopLevelParent(wxWindow *win)
 
 // Can return either a child object, or an integer
 // representing the child element, starting from 1.
-wxAccStatus wxWindowAccessible::HitTest(const wxPoint& pt, int* childId, wxAccessible** childObject)
+wxAccStatus wxWindowAccessible::HitTest(const wxPoint& WXUNUSED(pt), int* WXUNUSED(childId), wxAccessible** WXUNUSED(childObject))
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
@@ -2253,7 +2253,7 @@ wxAccStatus wxWindowAccessible::GetLocation(wxRect& rect, int elementId)
 
 // Navigates from fromId to toId/toObject.
 wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId,
-                             int* toId, wxAccessible** toObject)
+                             int* WXUNUSED(toId), wxAccessible** toObject)
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
@@ -2440,7 +2440,7 @@ wxAccStatus wxWindowAccessible::GetParent(wxAccessible** parent)
 // or > 0 (the action for a child).
 // Return wxACC_NOT_SUPPORTED if there is no default action for this
 // window (e.g. an edit control).
-wxAccStatus wxWindowAccessible::DoDefaultAction(int childId)
+wxAccStatus wxWindowAccessible::DoDefaultAction(int WXUNUSED(childId))
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
@@ -2455,7 +2455,7 @@ wxAccStatus wxWindowAccessible::DoDefaultAction(int childId)
 // The retrieved string describes the action that is performed on an object,
 // not what the object does as a result. For example, a toolbar button that prints
 // a document has a default action of "Press" rather than "Prints the current document."
-wxAccStatus wxWindowAccessible::GetDefaultAction(int childId, wxString* actionName)
+wxAccStatus wxWindowAccessible::GetDefaultAction(int WXUNUSED(childId), wxString* WXUNUSED(actionName))
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
@@ -2465,7 +2465,7 @@ wxAccStatus wxWindowAccessible::GetDefaultAction(int childId, wxString* actionNa
 }
 
 // Returns the description for this object or a child.
-wxAccStatus wxWindowAccessible::GetDescription(int childId, wxString* description)
+wxAccStatus wxWindowAccessible::GetDescription(int WXUNUSED(childId), wxString* description)
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
@@ -2481,7 +2481,7 @@ wxAccStatus wxWindowAccessible::GetDescription(int childId, wxString* descriptio
 }
 
 // Returns help text for this object or a child, similar to tooltip text.
-wxAccStatus wxWindowAccessible::GetHelpText(int childId, wxString* helpText)
+wxAccStatus wxWindowAccessible::GetHelpText(int WXUNUSED(childId), wxString* helpText)
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
@@ -2498,7 +2498,7 @@ wxAccStatus wxWindowAccessible::GetHelpText(int childId, wxString* helpText)
 
 // Returns the keyboard shortcut for this object or child.
 // Return e.g. ALT+K
-wxAccStatus wxWindowAccessible::GetKeyboardShortcut(int childId, wxString* shortcut)
+wxAccStatus wxWindowAccessible::GetKeyboardShortcut(int WXUNUSED(childId), wxString* WXUNUSED(shortcut))
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
@@ -2534,7 +2534,9 @@ wxAccStatus wxWindowAccessible::GetRole(int childId, wxAccRole* role)
     *role = wxROLE_SYSTEM_CLIENT;
     return wxACC_OK;
 
+    #if 0
     return wxACC_NOT_IMPLEMENTED;
+    #endif
 }
 
 // Returns a state constant.
@@ -2564,12 +2566,14 @@ wxAccStatus wxWindowAccessible::GetState(int childId, long* state)
     *state = 0;
     return wxACC_OK;
 
+    #if 0
     return wxACC_NOT_IMPLEMENTED;
+    #endif
 }
 
 // Returns a localized string representing the value for the object
 // or child.
-wxAccStatus wxWindowAccessible::GetValue(int childId, wxString* strValue)
+wxAccStatus wxWindowAccessible::GetValue(int WXUNUSED(childId), wxString* WXUNUSED(strValue))
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
@@ -2579,7 +2583,7 @@ wxAccStatus wxWindowAccessible::GetValue(int childId, wxString* strValue)
 }
 
 // Selects the object or child.
-wxAccStatus wxWindowAccessible::Select(int childId, wxAccSelectionFlags selectFlags)
+wxAccStatus wxWindowAccessible::Select(int WXUNUSED(childId), wxAccSelectionFlags WXUNUSED(selectFlags))
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
@@ -2592,7 +2596,7 @@ wxAccStatus wxWindowAccessible::Select(int childId, wxAccSelectionFlags selectFl
 // If childId is 0 and child is NULL, no object in
 // this subhierarchy has the focus.
 // If this object has the focus, child should be 'this'.
-wxAccStatus wxWindowAccessible::GetFocus(int* childId, wxAccessible** child)
+wxAccStatus wxWindowAccessible::GetFocus(int* WXUNUSED(childId), wxAccessible** WXUNUSED(child))
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
@@ -2609,7 +2613,7 @@ wxAccStatus wxWindowAccessible::GetFocus(int* childId, wxAccessible** child)
 // - an integer representing the selected child element,
 //   or 0 if this object is selected (GetType() == wxT("long")
 // - a "void*" pointer to a wxAccessible child object
-wxAccStatus wxWindowAccessible::GetSelections(wxVariant* selections)
+wxAccStatus wxWindowAccessible::GetSelections(wxVariant* WXUNUSED(selections))
 {
     wxASSERT( GetWindow() != NULL );
     if (!GetWindow())
index 98df698331816eace218947c0a13df08021b4768..351c3a512f514761efab5fc08dcec30d9a8570d1 100644 (file)
@@ -1105,7 +1105,7 @@ int wxListCtrl::GetItemCount() const
 
 wxSize wxListCtrl::GetItemSpacing() const
 {
-    const int spacing = GetItemSpacing(HasFlag(wxLC_SMALL_ICON));
+    const int spacing = ListView_GetItemSpacing(GetHwnd(), (BOOL)HasFlag(wxLC_SMALL_ICON));
 
     return wxSize(LOWORD(spacing), HIWORD(spacing));
 }
index 22251ebae9867a4e2e2579e30aa28a86e2aacffc..d545e9bfb5552573f7a7ea6bb69851d18731d8da 100644 (file)
@@ -427,7 +427,11 @@ STDMETHODIMP wxIAccessible::accHitTest(long xLeft, long yLeft, VARIANT* pVarID)
         return S_FALSE;
     }
     
+    #if 0 
+    // all cases above already cause some return action so below line
+    // is unreachable and cause unnecessary warning
     return E_NOTIMPL;
+    #endif
 }
 
 // Retrieves the specified object's current screen location. All visual objects must
@@ -487,7 +491,13 @@ STDMETHODIMP wxIAccessible::accNavigate ( long navDir, VARIANT varStart, VARIANT
         return E_FAIL;
     wxLogTrace(wxT("access"), wxString(wxT("accNavigate for ")) + m_pAccessible->GetWindow()->GetClassInfo()->GetClassName());
 
-    if ((varStart.vt != VT_I4 && varStart.vt != VT_EMPTY) || varStart.vt < 0)
+    if ((varStart.vt != VT_I4 && varStart.vt != VT_EMPTY) 
+                                                          #if 0
+                                                          // according to MSDN and sources varStart.vt is unsigned
+                                                          // so below line cause warning "Condition is always false"
+                                                          || varStart.vt < 0
+                                                          #endif
+                                                          )
     {
         wxLogTrace(wxT("access"), "Invalid arg for accNavigate");
         return E_INVALIDARG;
@@ -694,7 +704,11 @@ STDMETHODIMP wxIAccessible::get_accChild ( VARIANT varChildID, IDispatch** ppDis
         }
     }
 
+    #if 0 
+    // all cases above already cause some return action so below line
+    // is unreachable and cause unnecessary warning
     return E_NOTIMPL;
+    #endif
 }
 
 // Retrieves the number of children that belong to this object.
@@ -734,7 +748,11 @@ STDMETHODIMP wxIAccessible::get_accChildCount ( long* pCountChildren)
         return S_OK;
     }
 
+    #if 0 
+    // all cases above already cause some return action so below line
+    // is unreachable and cause unnecessary warning
     return E_NOTIMPL;
+    #endif
 }
 
 // Retrieves the IDispatch interface of the object's parent.
@@ -794,7 +812,11 @@ STDMETHODIMP wxIAccessible::get_accParent ( IDispatch** ppDispParent)
         }
     }
 
+    #if 0 
+    // all cases above already cause some return action so below line
+    // is unreachable and cause unnecessary warning
     return E_NOTIMPL;
+    #endif
 }
 
 // Performs the object's default action. Not all objects have a default
@@ -1443,7 +1465,11 @@ STDMETHODIMP wxIAccessible::get_accFocus ( VARIANT* pVarID)
         return S_FALSE;
     }
     
+    #if 0 
+    // all cases above already cause some return action so below line
+    // is unreachable and cause unnecessary warning
     return E_NOTIMPL;
+    #endif
 }
 
 // Retrieves the selected children of this object. All objects
@@ -1514,7 +1540,7 @@ STDMETHODIMP wxIAccessible::get_accSelection ( VARIANT * pVarChildren)
 
 // Get type info
 
-STDMETHODIMP wxIAccessible::GetTypeInfo(unsigned int typeInfo, LCID lcid, ITypeInfo** ppTypeInfo)
+STDMETHODIMP wxIAccessible::GetTypeInfo(unsigned int WXUNUSED(typeInfo), LCID WXUNUSED(lcid), ITypeInfo** ppTypeInfo)
 {
     *ppTypeInfo = NULL;
     return E_NOTIMPL;
@@ -1530,18 +1556,18 @@ STDMETHODIMP wxIAccessible::GetTypeInfoCount(unsigned int* typeInfoCount)
 
 // Get ids of names
 
-STDMETHODIMP wxIAccessible::GetIDsOfNames(REFIID riid, OLECHAR** names, unsigned int cNames,
-        LCID lcid, DISPID* dispId)
+STDMETHODIMP wxIAccessible::GetIDsOfNames(REFIID WXUNUSED(riid), OLECHAR** WXUNUSED(names), unsigned int WXUNUSED(cNames),
+        LCID WXUNUSED(lcid), DISPID* WXUNUSED(dispId))
 {
     return E_NOTIMPL;
 }
 
 // Invoke
 
-STDMETHODIMP wxIAccessible::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid
-                        WORD wFlags, DISPPARAMS *pDispParams
-                        VARIANT *pVarResult, EXCEPINFO *pExcepInfo
-                        unsigned int *puArgErr )
+STDMETHODIMP wxIAccessible::Invoke(DISPID WXUNUSED(dispIdMember), REFIID WXUNUSED(riid), LCID WXUNUSED(lcid)
+                        WORD WXUNUSED(wFlags), DISPPARAMS *WXUNUSED(pDispParams)
+                        VARIANT *WXUNUSED(pVarResult), EXCEPINFO *WXUNUSED(pExcepInfo)
+                        unsigned int *WXUNUSED(puArgErr) )
 {
     return E_NOTIMPL;
 }
@@ -1938,15 +1964,15 @@ int wxConvertToWindowsSelFlag(wxAccSelectionFlags wxsel)
 {
     int sel = 0;
 
-    if (sel & wxACC_SEL_TAKEFOCUS)
+    if (wxsel & wxACC_SEL_TAKEFOCUS)
         sel |= SELFLAG_TAKEFOCUS;
-    if (sel & wxACC_SEL_TAKESELECTION)
+    if (wxsel & wxACC_SEL_TAKESELECTION)
         sel |= SELFLAG_TAKESELECTION;
-    if (sel & wxACC_SEL_EXTENDSELECTION)
+    if (wxsel & wxACC_SEL_EXTENDSELECTION)
         sel |= SELFLAG_EXTENDSELECTION;
-    if (sel & wxACC_SEL_ADDSELECTION)
+    if (wxsel & wxACC_SEL_ADDSELECTION)
         sel |= SELFLAG_ADDSELECTION;
-    if (sel & wxACC_SEL_REMOVESELECTION)
+    if (wxsel & wxACC_SEL_REMOVESELECTION)
         sel |= SELFLAG_REMOVESELECTION;
     return sel;
 }
index f1cee3f773fee67c1a8c8ae72cadb8edf2a8776f..6ca8054528785357ccd73c44ef36ed7a7f3cd783 100644 (file)
@@ -2790,7 +2790,7 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
                 //WPARAM dwFlags = (WPARAM) (DWORD) wParam;
                 LPARAM dwObjId = (LPARAM) (DWORD) lParam;
 
-                if (dwObjId == OBJID_CLIENT && GetOrCreateAccessible())
+                if (dwObjId == (LPARAM)OBJID_CLIENT && GetOrCreateAccessible())
                 {
                     return LresultFromObject(IID_IAccessible, wParam, (IUnknown*) GetAccessible()->GetIAccessible());
                 }