got rid of wxBuffer (finally!!!)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -486,8 +486,6 @@ private:
|
||||
// global data
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
WXDLLIMPEXP_DATA_BASE(extern wxChar*) wxBuffer;
|
||||
|
||||
WXDLLIMPEXP_DATA_BASE(extern HINSTANCE) wxhInstance;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@@ -56,12 +56,6 @@ class WXDLLIMPEXP_BASE wxPoint;
|
||||
// String functions (deprecated, use wxString)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Useful buffer (FIXME VZ: To be removed!!!)
|
||||
// Now only needed in MSW port
|
||||
#if !defined(__WXMOTIF__) && !defined(__WXGTK__) && !defined(__WXX11__) && !defined(__WXMGL__) && !defined(__WXMAC__)
|
||||
WXDLLIMPEXP_DATA_BASE(extern wxChar*) wxBuffer;
|
||||
#endif
|
||||
|
||||
// Make a copy of this string using 'new'
|
||||
WXDLLIMPEXP_BASE wxChar* copystring(const wxChar *s);
|
||||
|
||||
|
@@ -119,7 +119,6 @@
|
||||
// global variables
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
extern wxChar *wxBuffer;
|
||||
extern wxList WXDLLEXPORT wxPendingDelete;
|
||||
#ifndef __WXMICROWIN__
|
||||
extern void wxSetKeyboardHook(bool doIt);
|
||||
@@ -287,8 +286,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
||||
}
|
||||
#endif // wxUSE_UNICODE && !wxUSE_UNICODE_MSLU
|
||||
|
||||
wxBuffer = new wxChar[1500]; // FIXME
|
||||
|
||||
#if defined(__WIN95__) && !defined(__WXMICROWIN__)
|
||||
InitCommonControls();
|
||||
#endif // __WIN95__
|
||||
@@ -500,9 +497,6 @@ bool wxApp::UnregisterWindowClasses()
|
||||
|
||||
void wxApp::CleanUp()
|
||||
{
|
||||
delete[] wxBuffer;
|
||||
wxBuffer = NULL;
|
||||
|
||||
#ifndef __WXMICROWIN__
|
||||
wxSetKeyboardHook(FALSE);
|
||||
#endif
|
||||
|
@@ -583,13 +583,15 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
|
||||
oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont().GetResourceHandle());
|
||||
|
||||
GetTextMetrics(dc, &lpTextMetric);
|
||||
int i;
|
||||
for (i = 0; i < m_noItems; i++)
|
||||
|
||||
// FIXME: buffer overflow!!
|
||||
wxChar buf[1024];
|
||||
for (int i = 0; i < m_noItems; i++)
|
||||
{
|
||||
int len = (int)SendMessage(GetHwnd(), LB_GETTEXT, i, (LONG)wxBuffer);
|
||||
wxBuffer[len] = 0;
|
||||
int len = (int)SendMessage(GetHwnd(), LB_GETTEXT, i, (LPARAM)buf);
|
||||
buf[len] = 0;
|
||||
SIZE extentXY;
|
||||
::GetTextExtentPoint(dc, (LPTSTR)wxBuffer, len, &extentXY);
|
||||
::GetTextExtentPoint(dc, buf, len, &extentXY);
|
||||
int extentX = (int)(extentXY.cx + lpTextMetric.tmAveCharWidth);
|
||||
if (extentX > largestExtent)
|
||||
largestExtent = extentX;
|
||||
|
@@ -240,18 +240,6 @@ bool wxGetUserId(wxChar *buf, int maxSize)
|
||||
// Get user name e.g. Julian Smart
|
||||
bool wxGetUserName(wxChar *buf, int maxSize)
|
||||
{
|
||||
#if wxUSE_PENWINDOWS && !defined(__WATCOMC__) && !defined(__GNUWIN32__)
|
||||
extern HANDLE g_hPenWin; // PenWindows Running?
|
||||
if (g_hPenWin)
|
||||
{
|
||||
// PenWindows Does have a user concept!
|
||||
// Get the current owner of the recognizer
|
||||
GetPrivateProfileString("Current", "User", default_name, wxBuffer, maxSize - 1, "PENWIN.INI");
|
||||
strncpy(buf, wxBuffer, maxSize - 1);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef USE_NET_API
|
||||
CHAR szUserName[256];
|
||||
if ( !wxGetUserId(szUserName, WXSIZEOF(szUserName)) )
|
||||
@@ -332,7 +320,6 @@ error:
|
||||
wxStrncpy(buf, wxT("Unknown User"), maxSize);
|
||||
}
|
||||
#endif // Win32/16
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -83,22 +83,23 @@ bool wxWriteResource(const wxString& section, const wxString& entry, int value,
|
||||
bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file)
|
||||
{
|
||||
static const wxChar defunkt[] = wxT("$$default");
|
||||
|
||||
wxChar buf[1024];
|
||||
if (file != wxT(""))
|
||||
{
|
||||
int n = GetPrivateProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)defunkt,
|
||||
(LPTSTR)wxBuffer, 1000, (LPCTSTR)WXSTRINGCAST file);
|
||||
if (n == 0 || wxStrcmp(wxBuffer, defunkt) == 0)
|
||||
int n = GetPrivateProfileString(section, entry, defunkt,
|
||||
buf, WXSIZEOF(buf), file);
|
||||
if (n == 0 || wxStrcmp(buf, defunkt) == 0)
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
int n = GetProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)defunkt,
|
||||
(LPTSTR)wxBuffer, 1000);
|
||||
if (n == 0 || wxStrcmp(wxBuffer, defunkt) == 0)
|
||||
int n = GetProfileString(section, entry, defunkt, buf, WXSIZEOF(buf));
|
||||
if (n == 0 || wxStrcmp(buf, defunkt) == 0)
|
||||
return FALSE;
|
||||
}
|
||||
if (*value) delete[] (*value);
|
||||
*value = copystring(wxBuffer);
|
||||
*value = copystring(buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user