projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
no message
[wxWidgets.git]
/
src
/
common
/
string.cpp
diff --git
a/src/common/string.cpp
b/src/common/string.cpp
index fd6ee0a7800b51fd2a2db3283c402c8b2480705f..bd4dc94a6212c15a199610545ed1af08120a913c 100644
(file)
--- a/
src/common/string.cpp
+++ b/
src/common/string.cpp
@@
-113,7
+113,7
@@
extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy;
// function wxVsnprintfA (A for ANSI), should also find one for Unicode
// strings in Unicode build
#ifdef __WXMSW__
// function wxVsnprintfA (A for ANSI), should also find one for Unicode
// strings in Unicode build
#ifdef __WXMSW__
- #if
(defined(__VISUALC__) || defined(wxUSE_NORLANDER_HEADERS)) && !defined(__MINGW32__)
+ #if
defined(__VISUALC__) || wxUSE_NORLANDER_HEADERS
#define wxVsnprintfA _vsnprintf
#endif
#else // !Windows
#define wxVsnprintfA _vsnprintf
#endif
#else // !Windows
@@
-290,11
+290,11
@@
void wxString::InitWith(const wxChar *psz, size_t nPos, size_t nLength)
{
Init();
{
Init();
- wxASSERT( nPos <= wxStrlen(psz) );
-
if ( nLength == wxSTRING_MAXLEN )
nLength = wxStrlen(psz + nPos);
if ( nLength == wxSTRING_MAXLEN )
nLength = wxStrlen(psz + nPos);
+ wxASSERT_MSG( nPos + nLength <= wxStrlen(psz), _T("index out of bounds") );
+
STATISTICS_ADD(InitialLength, nLength);
if ( nLength > 0 ) {
STATISTICS_ADD(InitialLength, nLength);
if ( nLength > 0 ) {
@@
-528,6
+528,12
@@
void wxString::UngetWriteBuf()
GetStringData()->Validate(TRUE);
}
GetStringData()->Validate(TRUE);
}
+void wxString::UngetWriteBuf(size_t nLen)
+{
+ GetStringData()->nDataLength = nLen;
+ GetStringData()->Validate(TRUE);
+}
+
// ---------------------------------------------------------------------------
// data access
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// data access
// ---------------------------------------------------------------------------
@@
-904,6
+910,8
@@
bool wxString::IsWord() const
bool wxString::IsNumber() const
{
const wxChar *s = (const wxChar*) *this;
bool wxString::IsNumber() const
{
const wxChar *s = (const wxChar*) *this;
+ if (wxStrlen(s))
+ if ((s[0] == '-') || (s[0] == '+')) s++;
while(*s){
if(!wxIsdigit(*s)) return(FALSE);
s++;
while(*s){
if(!wxIsdigit(*s)) return(FALSE);
s++;