Applied patch [ 807164 ] fixes for core library

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-09-18 13:42:22 +00:00
parent 7d418908fe
commit 66b9ec3dab
4 changed files with 56 additions and 26 deletions

View File

@@ -2210,7 +2210,7 @@ wxWindow* wxGetTopLevelParent(wxWindow *win)
// Can return either a child object, or an integer // Can return either a child object, or an integer
// representing the child element, starting from 1. // 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 ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) if (!GetWindow())
@@ -2253,7 +2253,7 @@ wxAccStatus wxWindowAccessible::GetLocation(wxRect& rect, int elementId)
// Navigates from fromId to toId/toObject. // Navigates from fromId to toId/toObject.
wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId, wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId,
int* toId, wxAccessible** toObject) int* WXUNUSED(toId), wxAccessible** toObject)
{ {
wxASSERT( GetWindow() != NULL ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) if (!GetWindow())
@@ -2440,7 +2440,7 @@ wxAccStatus wxWindowAccessible::GetParent(wxAccessible** parent)
// or > 0 (the action for a child). // or > 0 (the action for a child).
// Return wxACC_NOT_SUPPORTED if there is no default action for this // Return wxACC_NOT_SUPPORTED if there is no default action for this
// window (e.g. an edit control). // window (e.g. an edit control).
wxAccStatus wxWindowAccessible::DoDefaultAction(int childId) wxAccStatus wxWindowAccessible::DoDefaultAction(int WXUNUSED(childId))
{ {
wxASSERT( GetWindow() != NULL ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) if (!GetWindow())
@@ -2455,7 +2455,7 @@ wxAccStatus wxWindowAccessible::DoDefaultAction(int childId)
// The retrieved string describes the action that is performed on an object, // 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 // 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." // 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 ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) if (!GetWindow())
@@ -2465,7 +2465,7 @@ wxAccStatus wxWindowAccessible::GetDefaultAction(int childId, wxString* actionNa
} }
// Returns the description for this object or a child. // 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 ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) 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. // 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 ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) if (!GetWindow())
@@ -2498,7 +2498,7 @@ wxAccStatus wxWindowAccessible::GetHelpText(int childId, wxString* helpText)
// Returns the keyboard shortcut for this object or child. // Returns the keyboard shortcut for this object or child.
// Return e.g. ALT+K // Return e.g. ALT+K
wxAccStatus wxWindowAccessible::GetKeyboardShortcut(int childId, wxString* shortcut) wxAccStatus wxWindowAccessible::GetKeyboardShortcut(int WXUNUSED(childId), wxString* WXUNUSED(shortcut))
{ {
wxASSERT( GetWindow() != NULL ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) if (!GetWindow())
@@ -2534,7 +2534,9 @@ wxAccStatus wxWindowAccessible::GetRole(int childId, wxAccRole* role)
*role = wxROLE_SYSTEM_CLIENT; *role = wxROLE_SYSTEM_CLIENT;
return wxACC_OK; return wxACC_OK;
#if 0
return wxACC_NOT_IMPLEMENTED; return wxACC_NOT_IMPLEMENTED;
#endif
} }
// Returns a state constant. // Returns a state constant.
@@ -2564,12 +2566,14 @@ wxAccStatus wxWindowAccessible::GetState(int childId, long* state)
*state = 0; *state = 0;
return wxACC_OK; return wxACC_OK;
#if 0
return wxACC_NOT_IMPLEMENTED; return wxACC_NOT_IMPLEMENTED;
#endif
} }
// Returns a localized string representing the value for the object // Returns a localized string representing the value for the object
// or child. // or child.
wxAccStatus wxWindowAccessible::GetValue(int childId, wxString* strValue) wxAccStatus wxWindowAccessible::GetValue(int WXUNUSED(childId), wxString* WXUNUSED(strValue))
{ {
wxASSERT( GetWindow() != NULL ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) if (!GetWindow())
@@ -2579,7 +2583,7 @@ wxAccStatus wxWindowAccessible::GetValue(int childId, wxString* strValue)
} }
// Selects the object or child. // Selects the object or child.
wxAccStatus wxWindowAccessible::Select(int childId, wxAccSelectionFlags selectFlags) wxAccStatus wxWindowAccessible::Select(int WXUNUSED(childId), wxAccSelectionFlags WXUNUSED(selectFlags))
{ {
wxASSERT( GetWindow() != NULL ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) if (!GetWindow())
@@ -2592,7 +2596,7 @@ wxAccStatus wxWindowAccessible::Select(int childId, wxAccSelectionFlags selectFl
// If childId is 0 and child is NULL, no object in // If childId is 0 and child is NULL, no object in
// this subhierarchy has the focus. // this subhierarchy has the focus.
// If this object has the focus, child should be 'this'. // 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 ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) if (!GetWindow())
@@ -2609,7 +2613,7 @@ wxAccStatus wxWindowAccessible::GetFocus(int* childId, wxAccessible** child)
// - an integer representing the selected child element, // - an integer representing the selected child element,
// or 0 if this object is selected (GetType() == wxT("long") // or 0 if this object is selected (GetType() == wxT("long")
// - a "void*" pointer to a wxAccessible child object // - a "void*" pointer to a wxAccessible child object
wxAccStatus wxWindowAccessible::GetSelections(wxVariant* selections) wxAccStatus wxWindowAccessible::GetSelections(wxVariant* WXUNUSED(selections))
{ {
wxASSERT( GetWindow() != NULL ); wxASSERT( GetWindow() != NULL );
if (!GetWindow()) if (!GetWindow())

View File

@@ -1105,7 +1105,7 @@ int wxListCtrl::GetItemCount() const
wxSize wxListCtrl::GetItemSpacing() 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)); return wxSize(LOWORD(spacing), HIWORD(spacing));
} }

View File

@@ -427,7 +427,11 @@ STDMETHODIMP wxIAccessible::accHitTest(long xLeft, long yLeft, VARIANT* pVarID)
return S_FALSE; 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; return E_NOTIMPL;
#endif
} }
// Retrieves the specified object's current screen location. All visual objects must // 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; return E_FAIL;
wxLogTrace(wxT("access"), wxString(wxT("accNavigate for ")) + m_pAccessible->GetWindow()->GetClassInfo()->GetClassName()); 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"); wxLogTrace(wxT("access"), "Invalid arg for accNavigate");
return E_INVALIDARG; 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; return E_NOTIMPL;
#endif
} }
// Retrieves the number of children that belong to this object. // Retrieves the number of children that belong to this object.
@@ -734,7 +748,11 @@ STDMETHODIMP wxIAccessible::get_accChildCount ( long* pCountChildren)
return S_OK; 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; return E_NOTIMPL;
#endif
} }
// Retrieves the IDispatch interface of the object's parent. // 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; return E_NOTIMPL;
#endif
} }
// Performs the object's default action. Not all objects have a default // 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; 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; return E_NOTIMPL;
#endif
} }
// Retrieves the selected children of this object. All objects // Retrieves the selected children of this object. All objects
@@ -1514,7 +1540,7 @@ STDMETHODIMP wxIAccessible::get_accSelection ( VARIANT * pVarChildren)
// Get type info // 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; *ppTypeInfo = NULL;
return E_NOTIMPL; return E_NOTIMPL;
@@ -1530,18 +1556,18 @@ STDMETHODIMP wxIAccessible::GetTypeInfoCount(unsigned int* typeInfoCount)
// Get ids of names // Get ids of names
STDMETHODIMP wxIAccessible::GetIDsOfNames(REFIID riid, OLECHAR** names, unsigned int cNames, STDMETHODIMP wxIAccessible::GetIDsOfNames(REFIID WXUNUSED(riid), OLECHAR** WXUNUSED(names), unsigned int WXUNUSED(cNames),
LCID lcid, DISPID* dispId) LCID WXUNUSED(lcid), DISPID* WXUNUSED(dispId))
{ {
return E_NOTIMPL; return E_NOTIMPL;
} }
// Invoke // Invoke
STDMETHODIMP wxIAccessible::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, STDMETHODIMP wxIAccessible::Invoke(DISPID WXUNUSED(dispIdMember), REFIID WXUNUSED(riid), LCID WXUNUSED(lcid),
WORD wFlags, DISPPARAMS *pDispParams, WORD WXUNUSED(wFlags), DISPPARAMS *WXUNUSED(pDispParams),
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, VARIANT *WXUNUSED(pVarResult), EXCEPINFO *WXUNUSED(pExcepInfo),
unsigned int *puArgErr ) unsigned int *WXUNUSED(puArgErr) )
{ {
return E_NOTIMPL; return E_NOTIMPL;
} }
@@ -1938,15 +1964,15 @@ int wxConvertToWindowsSelFlag(wxAccSelectionFlags wxsel)
{ {
int sel = 0; int sel = 0;
if (sel & wxACC_SEL_TAKEFOCUS) if (wxsel & wxACC_SEL_TAKEFOCUS)
sel |= SELFLAG_TAKEFOCUS; sel |= SELFLAG_TAKEFOCUS;
if (sel & wxACC_SEL_TAKESELECTION) if (wxsel & wxACC_SEL_TAKESELECTION)
sel |= SELFLAG_TAKESELECTION; sel |= SELFLAG_TAKESELECTION;
if (sel & wxACC_SEL_EXTENDSELECTION) if (wxsel & wxACC_SEL_EXTENDSELECTION)
sel |= SELFLAG_EXTENDSELECTION; sel |= SELFLAG_EXTENDSELECTION;
if (sel & wxACC_SEL_ADDSELECTION) if (wxsel & wxACC_SEL_ADDSELECTION)
sel |= SELFLAG_ADDSELECTION; sel |= SELFLAG_ADDSELECTION;
if (sel & wxACC_SEL_REMOVESELECTION) if (wxsel & wxACC_SEL_REMOVESELECTION)
sel |= SELFLAG_REMOVESELECTION; sel |= SELFLAG_REMOVESELECTION;
return sel; return sel;
} }

View File

@@ -2790,7 +2790,7 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
//WPARAM dwFlags = (WPARAM) (DWORD) wParam; //WPARAM dwFlags = (WPARAM) (DWORD) wParam;
LPARAM dwObjId = (LPARAM) (DWORD) lParam; LPARAM dwObjId = (LPARAM) (DWORD) lParam;
if (dwObjId == OBJID_CLIENT && GetOrCreateAccessible()) if (dwObjId == (LPARAM)OBJID_CLIENT && GetOrCreateAccessible())
{ {
return LresultFromObject(IID_IAccessible, wParam, (IUnknown*) GetAccessible()->GetIAccessible()); return LresultFromObject(IID_IAccessible, wParam, (IUnknown*) GetAccessible()->GetIAccessible());
} }