]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/choice.cpp
Silence warning about truncation since the comment says it ok
[wxWidgets.git] / src / os2 / choice.cpp
index f1501642526bf45992322e0edee41b1190753c9f..8235ed353217ecb2283c786fabe413f2f6025fa9 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choice.cpp
+// Name:        src/os2/choice.cpp
 // Purpose:     wxChoice
 // Author:      David Webster
 // Modified by:
@@ -201,38 +201,10 @@ int wxChoice::GetCount() const
     return((int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMCOUNT, (MPARAM)0, (MPARAM)0)));
 } // end of wxChoice::GetCount
 
-int wxChoice::FindString(
-  const wxString&                   rsStr
-) const
+void wxChoice::SetString( int n, const wxString& rsStr )
 {
-    int                             nPos;
-    int                             nTextLength;
-    PSZ                             zStr;
-    int                             nItemCount;
-
-    nItemCount = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMCOUNT, (MPARAM)0, (MPARAM)0));
-    for (nPos = 0; nPos < nItemCount; nPos++)
-    {
-        nTextLength = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0));
-        zStr = new char[nTextLength + 1];
-        ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)nPos, (SHORT)nTextLength), (MPARAM)zStr);
-        if (rsStr == (wxChar*)zStr)
-        {
-            delete [] zStr;
-            break;
-        }
-        delete [] zStr;
-    }
-    return nPos;
-} // end of wxChoice::FindString
-
-void wxChoice::SetString(
-  int                               n
-, const wxString&                   rsStr
-)
-{
-    LONG                            nIndexType = 0;
-    void*                           pData;
+    LONG  nIndexType = 0;
+    void* pData;
 
     if ( m_clientDataItemsType != wxClientData_None )
     {
@@ -263,13 +235,11 @@ void wxChoice::SetString(
     }
 } // end of wxChoice::SetString
 
-wxString wxChoice::GetString(
-  int                               n
-) const
+wxString wxChoice::GetString(int n) const
 {
-    int                             nLen = 0;
-    wxString                        sStr = wxEmptyString;
-    wxChar*                         zBuf;
+    int      nLen = 0;
+    wxString sStr = wxEmptyString;
+    wxChar*  zBuf;
 
     nLen = (size_t)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)n, (MPARAM)0));
     if (nLen != LIT_ERROR && nLen > 0)