Various fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-11-25 12:01:23 +00:00
parent 35c9d9582b
commit 6164d85e89
12 changed files with 68 additions and 59 deletions

View File

@@ -210,6 +210,16 @@ bool wxConfigBase::Write(const wxString& key, bool value)
return Write(key, l);
}
wxString wxConfigBase::ExpandEnvVars(const wxString& str) const
{
wxString tmp; // Required for BC++
if (IsExpandingEnvVars())
tmp = wxExpandEnvVars(str);
else
tmp = str;
return tmp;
}
// ----------------------------------------------------------------------------
// wxConfigPathChanger

View File

@@ -440,6 +440,23 @@ void wxListBase::Sort(const wxSortCompareFunction compfunc)
delete[] objArray;
}
bool wxListKey::operator==(wxListKeyValue value) const
{
switch ( m_keyType )
{
default:
wxFAIL_MSG("bad key type.");
// let compiler optimize the line above away in release build
// by not putting return here...
case wxKEY_STRING:
return strcmp(m_key.string, value.string) == 0;
case wxKEY_INTEGER:
return m_key.integer == value.integer;
}
}
// -----------------------------------------------------------------------------
// wxList (a.k.a. wxObjectList)
// -----------------------------------------------------------------------------

View File

@@ -923,6 +923,15 @@ int wxString::Printf(const char *pszFormat, ...)
int wxString::PrintfV(const char* pszFormat, va_list argptr)
{
#ifdef __BORLANDC__
static char s_szScratch[1024];
int iLen = vsprintf(s_szScratch, pszFormat, argptr);
AllocBeforeWrite(iLen);
strcpy(m_pchData, s_szScratch);
return iLen;
#else
#ifdef __WXMSW__
#ifdef _MSC_VER
#define wxVsprintf _vsnprintf
@@ -972,6 +981,7 @@ int wxString::PrintfV(const char* pszFormat, va_list argptr)
free(buffer);
return iLen;
#endif
}
// ----------------------------------------------------------------------------

View File

@@ -232,3 +232,18 @@ bool wxTextFile::Write(Type typeNew)
// replace the old file with this one
return fileTmp.Commit();
}
const char *wxTextFile::GetEOL(Type type)
{
switch ( type ) {
case Type_None: return "";
case Type_Unix: return "\n";
case Type_Dos: return "\r\n";
case Type_Mac: return "\r";
default:
wxFAIL_MSG("bad file type in wxTextFile::GetEOL.");
return (const char *) NULL;
}
}

View File

@@ -79,8 +79,6 @@ GENERICOBJS= \
$(MSWDIR)\laywin.obj \
$(MSWDIR)\msgdlgg.obj \
$(MSWDIR)\panelg.obj \
$(MSWDIR)\printps.obj \
$(MSWDIR)\prntdlgg.obj \
$(MSWDIR)\sashwin.obj \
$(MSWDIR)\scrolwin.obj \
$(MSWDIR)\splitter.obj \
@@ -88,6 +86,9 @@ GENERICOBJS= \
$(MSWDIR)\tabg.obj \
$(MSWDIR)\textdlgg.obj
# $(MSWDIR)\printps.obj \
# $(MSWDIR)\prntdlgg.obj \
COMMONOBJS = \
$(MSWDIR)\config.obj \
$(MSWDIR)\cmndata.obj \

View File

@@ -309,7 +309,7 @@ $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
$(MSWDIR)/app.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
$(CPPFLAGS) /D__NO_VC_CRTDBG__ /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(MSWDIR)/bitmap.obj: $*.$(SRCSUFF)