[1231183] 'cleanup: mismatched indentation' and other cleanings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -144,24 +144,24 @@ void wxDataInputStream::Read64(wxUint64 *buffer, size_t size)
|
|||||||
|
|
||||||
void wxDataInputStream::Read32(wxUint32 *buffer, size_t size)
|
void wxDataInputStream::Read32(wxUint32 *buffer, size_t size)
|
||||||
{
|
{
|
||||||
m_input->Read(buffer, size * 4);
|
m_input->Read(buffer, size * 4);
|
||||||
|
|
||||||
if (m_be_order)
|
if (m_be_order)
|
||||||
{
|
|
||||||
for (wxUint32 i=0; i<size; i++)
|
|
||||||
{
|
{
|
||||||
wxUint32 v = wxUINT32_SWAP_ON_LE(*buffer);
|
for (wxUint32 i=0; i<size; i++)
|
||||||
*(buffer++) = v;
|
{
|
||||||
|
wxUint32 v = wxUINT32_SWAP_ON_LE(*buffer);
|
||||||
|
*(buffer++) = v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
|
||||||
{
|
|
||||||
for (wxUint32 i=0; i<size; i++)
|
|
||||||
{
|
{
|
||||||
wxUint32 v = wxUINT32_SWAP_ON_BE(*buffer);
|
for (wxUint32 i=0; i<size; i++)
|
||||||
*(buffer++) = v;
|
{
|
||||||
|
wxUint32 v = wxUINT32_SWAP_ON_BE(*buffer);
|
||||||
|
*(buffer++) = v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDataInputStream::Read16(wxUint16 *buffer, size_t size)
|
void wxDataInputStream::Read16(wxUint16 *buffer, size_t size)
|
||||||
|
@@ -612,11 +612,14 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
|
|||||||
nnm = *s ? s + 1 : s;
|
nnm = *s ? s + 1 : s;
|
||||||
*s = 0;
|
*s = 0;
|
||||||
// FIXME: wxGetUserHome could return temporary storage in Unicode mode
|
// FIXME: wxGetUserHome could return temporary storage in Unicode mode
|
||||||
if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL) {
|
if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL)
|
||||||
if (was_sep) /* replace only if it was there: */
|
{
|
||||||
*s = SEP;
|
if (was_sep) /* replace only if it was there: */
|
||||||
|
*s = SEP;
|
||||||
s = NULL;
|
s = NULL;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
nm = nnm;
|
nm = nnm;
|
||||||
s = home;
|
s = home;
|
||||||
}
|
}
|
||||||
@@ -1778,123 +1781,123 @@ bool wxIsWild( const wxString& pattern )
|
|||||||
|
|
||||||
bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
|
bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
|
||||||
{
|
{
|
||||||
if (text.empty())
|
if (text.empty())
|
||||||
|
{
|
||||||
|
/* Match if both are empty. */
|
||||||
|
return pat.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
const wxChar *m = pat.c_str(),
|
||||||
|
*n = text.c_str(),
|
||||||
|
*ma = NULL,
|
||||||
|
*na = NULL,
|
||||||
|
*mp = NULL,
|
||||||
|
*np = NULL;
|
||||||
|
int just = 0,
|
||||||
|
pcount = 0,
|
||||||
|
acount = 0,
|
||||||
|
count = 0;
|
||||||
|
|
||||||
|
if (dot_special && (*n == wxT('.')))
|
||||||
|
{
|
||||||
|
/* Never match so that hidden Unix files
|
||||||
|
* are never found. */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
if (*m == wxT('*'))
|
||||||
{
|
{
|
||||||
/* Match if both are empty. */
|
ma = ++m;
|
||||||
return pat.empty();
|
na = n;
|
||||||
|
just = 1;
|
||||||
|
mp = NULL;
|
||||||
|
acount = count;
|
||||||
}
|
}
|
||||||
|
else if (*m == wxT('?'))
|
||||||
const wxChar *m = pat.c_str(),
|
|
||||||
*n = text.c_str(),
|
|
||||||
*ma = NULL,
|
|
||||||
*na = NULL,
|
|
||||||
*mp = NULL,
|
|
||||||
*np = NULL;
|
|
||||||
int just = 0,
|
|
||||||
pcount = 0,
|
|
||||||
acount = 0,
|
|
||||||
count = 0;
|
|
||||||
|
|
||||||
if (dot_special && (*n == wxT('.')))
|
|
||||||
{
|
{
|
||||||
/* Never match so that hidden Unix files
|
m++;
|
||||||
* are never found. */
|
if (!*n++)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
for (;;)
|
|
||||||
{
|
{
|
||||||
if (*m == wxT('*'))
|
if (*m == wxT('\\'))
|
||||||
|
{
|
||||||
|
m++;
|
||||||
|
/* Quoting "nothing" is a bad thing */
|
||||||
|
if (!*m)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!*m)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* If we are out of both strings or we just
|
||||||
|
* saw a wildcard, then we can say we have a
|
||||||
|
* match
|
||||||
|
*/
|
||||||
|
if (!*n)
|
||||||
|
return true;
|
||||||
|
if (just)
|
||||||
|
return true;
|
||||||
|
just = 0;
|
||||||
|
goto not_matched;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* We could check for *n == NULL at this point, but
|
||||||
|
* since it's more common to have a character there,
|
||||||
|
* check to see if they match first (m and n) and
|
||||||
|
* then if they don't match, THEN we can check for
|
||||||
|
* the NULL of n
|
||||||
|
*/
|
||||||
|
just = 0;
|
||||||
|
if (*m == *n)
|
||||||
|
{
|
||||||
|
m++;
|
||||||
|
if (*n == wxT(' '))
|
||||||
|
mp = NULL;
|
||||||
|
count++;
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
not_matched:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If there are no more characters in the
|
||||||
|
* string, but we still need to find another
|
||||||
|
* character (*m != NULL), then it will be
|
||||||
|
* impossible to match it
|
||||||
|
*/
|
||||||
|
if (!*n)
|
||||||
|
return false;
|
||||||
|
if (mp)
|
||||||
{
|
{
|
||||||
ma = ++m;
|
m = mp;
|
||||||
na = n;
|
if (*np == wxT(' '))
|
||||||
just = 1;
|
{
|
||||||
mp = NULL;
|
mp = NULL;
|
||||||
acount = count;
|
goto check_percent;
|
||||||
}
|
}
|
||||||
else if (*m == wxT('?'))
|
n = ++np;
|
||||||
{
|
count = pcount;
|
||||||
m++;
|
|
||||||
if (!*n++)
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
check_percent:
|
||||||
|
|
||||||
|
if (ma)
|
||||||
{
|
{
|
||||||
if (*m == wxT('\\'))
|
m = ma;
|
||||||
{
|
n = ++na;
|
||||||
m++;
|
count = acount;
|
||||||
/* Quoting "nothing" is a bad thing */
|
|
||||||
if (!*m)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!*m)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* If we are out of both strings or we just
|
|
||||||
* saw a wildcard, then we can say we have a
|
|
||||||
* match
|
|
||||||
*/
|
|
||||||
if (!*n)
|
|
||||||
return true;
|
|
||||||
if (just)
|
|
||||||
return true;
|
|
||||||
just = 0;
|
|
||||||
goto not_matched;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* We could check for *n == NULL at this point, but
|
|
||||||
* since it's more common to have a character there,
|
|
||||||
* check to see if they match first (m and n) and
|
|
||||||
* then if they don't match, THEN we can check for
|
|
||||||
* the NULL of n
|
|
||||||
*/
|
|
||||||
just = 0;
|
|
||||||
if (*m == *n)
|
|
||||||
{
|
|
||||||
m++;
|
|
||||||
if (*n == wxT(' '))
|
|
||||||
mp = NULL;
|
|
||||||
count++;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
not_matched:
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If there are no more characters in the
|
|
||||||
* string, but we still need to find another
|
|
||||||
* character (*m != NULL), then it will be
|
|
||||||
* impossible to match it
|
|
||||||
*/
|
|
||||||
if (!*n)
|
|
||||||
return false;
|
|
||||||
if (mp)
|
|
||||||
{
|
|
||||||
m = mp;
|
|
||||||
if (*np == wxT(' '))
|
|
||||||
{
|
|
||||||
mp = NULL;
|
|
||||||
goto check_percent;
|
|
||||||
}
|
|
||||||
n = ++np;
|
|
||||||
count = pcount;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
check_percent:
|
|
||||||
|
|
||||||
if (ma)
|
|
||||||
{
|
|
||||||
m = ma;
|
|
||||||
n = ++na;
|
|
||||||
count = acount;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the type of an open file
|
// Return the type of an open file
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// Author: John Labenski
|
// Author: John Labenski
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 14.06.03 (extracted from src/*/filedlg.cpp)
|
// Created: 14.06.03 (extracted from src/*/filedlg.cpp)
|
||||||
// RCS-ID:
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Robert Roebling
|
// Copyright: (c) Robert Roebling
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxFileDialogBase, wxDialog)
|
IMPLEMENT_DYNAMIC_CLASS(wxFileDialogBase, wxDialog)
|
||||||
|
|
||||||
void wxFileDialogBase::Init()
|
void wxFileDialogBase::Init()
|
||||||
{
|
{
|
||||||
m_filterIndex = m_dialogStyle = 0;
|
m_filterIndex = m_dialogStyle = 0;
|
||||||
m_parent = NULL;
|
m_parent = NULL;
|
||||||
}
|
}
|
||||||
@@ -179,24 +179,24 @@ wxString wxFileSelector(const wxChar *title,
|
|||||||
|
|
||||||
// if filter is of form "All files (*)|*|..." set correct filter index
|
// if filter is of form "All files (*)|*|..." set correct filter index
|
||||||
if((wxStrlen(defaultExtension) != 0) && (filter2.Find(wxT('|')) != wxNOT_FOUND))
|
if((wxStrlen(defaultExtension) != 0) && (filter2.Find(wxT('|')) != wxNOT_FOUND))
|
||||||
{
|
{
|
||||||
int filterIndex = 0;
|
int filterIndex = 0;
|
||||||
|
|
||||||
wxArrayString descriptions, filters;
|
wxArrayString descriptions, filters;
|
||||||
// don't care about errors, handled already by wxFileDialog
|
// don't care about errors, handled already by wxFileDialog
|
||||||
(void)wxParseCommonDialogsFilter(filter2, descriptions, filters);
|
(void)wxParseCommonDialogsFilter(filter2, descriptions, filters);
|
||||||
for (size_t n=0; n<filters.GetCount(); n++)
|
for (size_t n=0; n<filters.GetCount(); n++)
|
||||||
{
|
{
|
||||||
if (filters[n].Contains(defaultExtension))
|
if (filters[n].Contains(defaultExtension))
|
||||||
{
|
{
|
||||||
filterIndex = n;
|
filterIndex = n;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filterIndex > 0)
|
if (filterIndex > 0)
|
||||||
fileDialog.SetFilterIndex(filterIndex);
|
fileDialog.SetFilterIndex(filterIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString filename;
|
wxString filename;
|
||||||
if ( fileDialog.ShowModal() == wxID_OK )
|
if ( fileDialog.ShowModal() == wxID_OK )
|
||||||
|
@@ -68,7 +68,7 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
|
|||||||
|
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case wxT('2'): // ASCII Grey
|
case wxT('2'): // ASCII Grey
|
||||||
case wxT('3'): // ASCII RGB
|
case wxT('3'): // ASCII RGB
|
||||||
case wxT('5'): // RAW Grey
|
case wxT('5'): // RAW Grey
|
||||||
case wxT('6'): break;
|
case wxT('6'): break;
|
||||||
@@ -94,14 +94,14 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (c=='2') // Ascii GREY
|
if (c=='2') // Ascii GREY
|
||||||
{
|
{
|
||||||
wxUint32 value, size=width*height;
|
wxUint32 value, size=width*height;
|
||||||
for (wxUint32 i=0; i<size; ++i)
|
for (wxUint32 i=0; i<size; ++i)
|
||||||
{
|
{
|
||||||
value=text_stream.Read32();
|
value=text_stream.Read32();
|
||||||
*ptr++=(unsigned char)value; // R
|
*ptr++=(unsigned char)value; // R
|
||||||
*ptr++=(unsigned char)value; // G
|
*ptr++=(unsigned char)value; // G
|
||||||
*ptr++=(unsigned char)value; // B
|
*ptr++=(unsigned char)value; // B
|
||||||
if ( !buf_stream )
|
if ( !buf_stream )
|
||||||
{
|
{
|
||||||
@@ -110,8 +110,8 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (c=='3') // Ascii RBG
|
if (c=='3') // Ascii RBG
|
||||||
{
|
{
|
||||||
wxUint32 value, size=3*width*height;
|
wxUint32 value, size=3*width*height;
|
||||||
for (wxUint32 i=0; i<size; ++i)
|
for (wxUint32 i=0; i<size; ++i)
|
||||||
{
|
{
|
||||||
@@ -126,9 +126,9 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (c=='5') // Raw GREY
|
if (c=='5') // Raw GREY
|
||||||
{
|
{
|
||||||
wxUint32 size=width*height;
|
wxUint32 size=width*height;
|
||||||
unsigned char value;
|
unsigned char value;
|
||||||
for (wxUint32 i=0; i<size; ++i)
|
for (wxUint32 i=0; i<size; ++i)
|
||||||
@@ -136,7 +136,7 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
|
|||||||
buf_stream.Read(&value,1);
|
buf_stream.Read(&value,1);
|
||||||
*ptr++=value; // R
|
*ptr++=value; // R
|
||||||
*ptr++=value; // G
|
*ptr++=value; // G
|
||||||
*ptr++=value; // B
|
*ptr++=value; // B
|
||||||
if ( !buf_stream )
|
if ( !buf_stream )
|
||||||
{
|
{
|
||||||
if (verbose) wxLogError(_("PNM: File seems truncated."));
|
if (verbose) wxLogError(_("PNM: File seems truncated."));
|
||||||
|
@@ -802,7 +802,8 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
|
|||||||
// copy it to our buffer and free memory
|
// copy it to our buffer and free memory
|
||||||
// Crashes on SmartPhone (FIXME)
|
// Crashes on SmartPhone (FIXME)
|
||||||
#if !defined(__SMARTPHONE__) /* of WinCE */
|
#if !defined(__SMARTPHONE__) /* of WinCE */
|
||||||
if( lpMsgBuf != 0 ) {
|
if( lpMsgBuf != 0 )
|
||||||
|
{
|
||||||
wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1);
|
wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1);
|
||||||
s_szBuf[WXSIZEOF(s_szBuf) - 1] = wxT('\0');
|
s_szBuf[WXSIZEOF(s_szBuf) - 1] = wxT('\0');
|
||||||
|
|
||||||
|
@@ -289,14 +289,14 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label)
|
|||||||
keyCode = WXK_WINDOWS_LEFT;
|
keyCode = WXK_WINDOWS_LEFT;
|
||||||
else if ( current == wxT("WINDOWS_RIGHT") )
|
else if ( current == wxT("WINDOWS_RIGHT") )
|
||||||
keyCode = WXK_WINDOWS_RIGHT;
|
keyCode = WXK_WINDOWS_RIGHT;
|
||||||
else if ( current == wxT("WINDOWS_MENU") )
|
else if ( current == wxT("WINDOWS_MENU") )
|
||||||
keyCode = WXK_WINDOWS_MENU;
|
keyCode = WXK_WINDOWS_MENU;
|
||||||
else if ( current == wxT("COMMAND") )
|
else if ( current == wxT("COMMAND") )
|
||||||
keyCode = WXK_COMMAND;
|
keyCode = WXK_COMMAND;
|
||||||
else if ( current.Left(3) == wxT("KP_") && wxIsdigit(current[3U]) ) {
|
else if ( current.Left(3) == wxT("KP_") && wxIsdigit(current[3U]) )
|
||||||
keyCode = WXK_NUMPAD0 + wxAtoi(current.c_str() + 3); }
|
keyCode = WXK_NUMPAD0 + wxAtoi(current.c_str() + 3);
|
||||||
else if ( current.Left(7) == wxT("SPECIAL") && wxIsdigit(current[7U]) ) {
|
else if ( current.Left(7) == wxT("SPECIAL") && wxIsdigit(current[7U]) )
|
||||||
keyCode = WXK_SPECIAL1 + wxAtoi(current.c_str() + 7) - 1; }
|
keyCode = WXK_SPECIAL1 + wxAtoi(current.c_str() + 7) - 1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("Unrecognized accel key '%s', accel string ignored."),
|
wxLogDebug(wxT("Unrecognized accel key '%s', accel string ignored."),
|
||||||
|
@@ -435,35 +435,35 @@ wxStringBase::iterator wxStringBase::erase(iterator it)
|
|||||||
|
|
||||||
wxStringBase& wxStringBase::erase(size_t nStart, size_t nLen)
|
wxStringBase& wxStringBase::erase(size_t nStart, size_t nLen)
|
||||||
{
|
{
|
||||||
wxASSERT(nStart <= length());
|
wxASSERT(nStart <= length());
|
||||||
size_t strLen = length() - nStart;
|
size_t strLen = length() - nStart;
|
||||||
// delete nLen or up to the end of the string characters
|
// delete nLen or up to the end of the string characters
|
||||||
nLen = strLen < nLen ? strLen : nLen;
|
nLen = strLen < nLen ? strLen : nLen;
|
||||||
wxString strTmp(c_str(), nStart);
|
wxString strTmp(c_str(), nStart);
|
||||||
strTmp.append(c_str() + nStart + nLen, length() - nStart - nLen);
|
strTmp.append(c_str() + nStart + nLen, length() - nStart - nLen);
|
||||||
|
|
||||||
swap(strTmp);
|
swap(strTmp);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxStringBase& wxStringBase::insert(size_t nPos, const wxChar *sz, size_t n)
|
wxStringBase& wxStringBase::insert(size_t nPos, const wxChar *sz, size_t n)
|
||||||
{
|
{
|
||||||
wxASSERT( nPos <= length() );
|
wxASSERT( nPos <= length() );
|
||||||
|
|
||||||
if ( n == npos ) n = wxStrlen(sz);
|
if ( n == npos ) n = wxStrlen(sz);
|
||||||
if ( n == 0 ) return *this;
|
if ( n == 0 ) return *this;
|
||||||
|
|
||||||
if ( !Alloc(length() + n) || !CopyBeforeWrite() ) {
|
if ( !Alloc(length() + n) || !CopyBeforeWrite() ) {
|
||||||
wxFAIL_MSG( _T("out of memory in wxStringBase::insert") );
|
wxFAIL_MSG( _T("out of memory in wxStringBase::insert") );
|
||||||
}
|
}
|
||||||
|
|
||||||
memmove(m_pchData + nPos + n, m_pchData + nPos,
|
memmove(m_pchData + nPos + n, m_pchData + nPos,
|
||||||
(length() - nPos) * sizeof(wxChar));
|
(length() - nPos) * sizeof(wxChar));
|
||||||
memcpy(m_pchData + nPos, sz, n * sizeof(wxChar));
|
memcpy(m_pchData + nPos, sz, n * sizeof(wxChar));
|
||||||
GetStringData()->nDataLength = length() + n;
|
GetStringData()->nDataLength = length() + n;
|
||||||
m_pchData[length()] = '\0';
|
m_pchData[length()] = '\0';
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStringBase::swap(wxStringBase& str)
|
void wxStringBase::swap(wxStringBase& str)
|
||||||
@@ -475,50 +475,50 @@ void wxStringBase::swap(wxStringBase& str)
|
|||||||
|
|
||||||
size_t wxStringBase::find(const wxStringBase& str, size_t nStart) const
|
size_t wxStringBase::find(const wxStringBase& str, size_t nStart) const
|
||||||
{
|
{
|
||||||
wxASSERT( str.GetStringData()->IsValid() );
|
wxASSERT( str.GetStringData()->IsValid() );
|
||||||
wxASSERT( nStart <= length() );
|
wxASSERT( nStart <= length() );
|
||||||
|
|
||||||
//anchor
|
//anchor
|
||||||
const wxChar* p = (const wxChar*)wxTmemchr(c_str() + nStart,
|
const wxChar* p = (const wxChar*)wxTmemchr(c_str() + nStart,
|
||||||
str.c_str()[0],
|
str.c_str()[0],
|
||||||
length() - nStart);
|
length() - nStart);
|
||||||
|
|
||||||
if(!p)
|
if(!p)
|
||||||
return npos;
|
return npos;
|
||||||
|
|
||||||
while(p - c_str() + str.length() <= length() &&
|
while(p - c_str() + str.length() <= length() &&
|
||||||
wxTmemcmp(p, str.c_str(), str.length()) )
|
wxTmemcmp(p, str.c_str(), str.length()) )
|
||||||
{
|
{
|
||||||
//Previosly passed as the first argument to wxTmemchr,
|
//Previosly passed as the first argument to wxTmemchr,
|
||||||
//but C/C++ standard does not specify evaluation order
|
//but C/C++ standard does not specify evaluation order
|
||||||
//of arguments to functions -
|
//of arguments to functions -
|
||||||
//http://embedded.com/showArticle.jhtml?articleID=9900607
|
//http://embedded.com/showArticle.jhtml?articleID=9900607
|
||||||
++p;
|
++p;
|
||||||
|
|
||||||
//anchor again
|
//anchor again
|
||||||
p = (const wxChar*)wxTmemchr(p,
|
p = (const wxChar*)wxTmemchr(p,
|
||||||
str.c_str()[0],
|
str.c_str()[0],
|
||||||
length() - (p - c_str()));
|
length() - (p - c_str()));
|
||||||
|
|
||||||
if(!p)
|
if(!p)
|
||||||
return npos;
|
return npos;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (p - c_str() + str.length() <= length()) ? p - c_str() : npos;
|
return (p - c_str() + str.length() <= length()) ? p - c_str() : npos;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxStringBase::find(const wxChar* sz, size_t nStart, size_t n) const
|
size_t wxStringBase::find(const wxChar* sz, size_t nStart, size_t n) const
|
||||||
{
|
{
|
||||||
return find(wxStringBase(sz, n), nStart);
|
return find(wxStringBase(sz, n), nStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxStringBase::find(wxChar ch, size_t nStart) const
|
size_t wxStringBase::find(wxChar ch, size_t nStart) const
|
||||||
{
|
{
|
||||||
wxASSERT( nStart <= length() );
|
wxASSERT( nStart <= length() );
|
||||||
|
|
||||||
const wxChar *p = (const wxChar*)wxTmemchr(c_str() + nStart, ch, length() - nStart);
|
const wxChar *p = (const wxChar*)wxTmemchr(c_str() + nStart, ch, length() - nStart);
|
||||||
|
|
||||||
return p == NULL ? npos : p - c_str();
|
return p == NULL ? npos : p - c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxStringBase::rfind(const wxStringBase& str, size_t nStart) const
|
size_t wxStringBase::rfind(const wxStringBase& str, size_t nStart) const
|
||||||
|
@@ -132,7 +132,7 @@ wxUint32 wxTextInputStream::Read32(int base)
|
|||||||
if(!m_input) return 0;
|
if(!m_input) return 0;
|
||||||
|
|
||||||
wxString word = ReadWord();
|
wxString word = ReadWord();
|
||||||
if(word.IsEmpty())
|
if(word.empty())
|
||||||
return 0;
|
return 0;
|
||||||
return wxStrtoul(word.c_str(), 0, base);
|
return wxStrtoul(word.c_str(), 0, base);
|
||||||
}
|
}
|
||||||
@@ -153,7 +153,7 @@ wxInt32 wxTextInputStream::Read32S(int base)
|
|||||||
if(!m_input) return 0;
|
if(!m_input) return 0;
|
||||||
|
|
||||||
wxString word = ReadWord();
|
wxString word = ReadWord();
|
||||||
if(word.IsEmpty())
|
if(word.empty())
|
||||||
return 0;
|
return 0;
|
||||||
return wxStrtol(word.c_str(), 0, base);
|
return wxStrtol(word.c_str(), 0, base);
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ double wxTextInputStream::ReadDouble()
|
|||||||
{
|
{
|
||||||
if(!m_input) return 0;
|
if(!m_input) return 0;
|
||||||
wxString word = ReadWord();
|
wxString word = ReadWord();
|
||||||
if(word.IsEmpty())
|
if(word.empty())
|
||||||
return 0;
|
return 0;
|
||||||
return wxStrtod(word.c_str(), 0);
|
return wxStrtod(word.c_str(), 0);
|
||||||
}
|
}
|
||||||
@@ -406,7 +406,7 @@ void wxTextOutputStream::WriteString(const wxString& string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
out << c;
|
out << c;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We must not write the trailing NULL here
|
// We must not write the trailing NULL here
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
|
@@ -4,9 +4,9 @@
|
|||||||
// Author: Kevin Smith
|
// Author: Kevin Smith
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: Jan 22 1999
|
// Created: Jan 22 1999
|
||||||
// RCS-ID:
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1999 Kevin Smith
|
// Copyright: (c) 1999 Kevin Smith
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||||
@@ -336,65 +336,66 @@ bool wxGenericValidator::TransferToWindow(void)
|
|||||||
// Called to transfer data from the window
|
// Called to transfer data from the window
|
||||||
bool wxGenericValidator::TransferFromWindow(void)
|
bool wxGenericValidator::TransferFromWindow(void)
|
||||||
{
|
{
|
||||||
if ( !m_validatorWindow )
|
if ( !m_validatorWindow )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// bool controls
|
// BOOL CONTROLS **************************************
|
||||||
#if wxUSE_CHECKBOX
|
#if wxUSE_CHECKBOX
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
|
||||||
{
|
|
||||||
wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
|
|
||||||
if (m_pBool)
|
|
||||||
{
|
{
|
||||||
*m_pBool = pControl->GetValue() ;
|
wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
|
||||||
return true;
|
if (m_pBool)
|
||||||
}
|
{
|
||||||
} else
|
*m_pBool = pControl->GetValue() ;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_RADIOBTN
|
#if wxUSE_RADIOBTN
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
|
||||||
{
|
{
|
||||||
wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
|
wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
|
||||||
if (m_pBool)
|
if (m_pBool)
|
||||||
{
|
{
|
||||||
*m_pBool = pControl->GetValue() ;
|
*m_pBool = pControl->GetValue() ;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
// int controls
|
|
||||||
|
// INT CONTROLS ***************************************
|
||||||
#if wxUSE_GAUGE
|
#if wxUSE_GAUGE
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
|
||||||
{
|
|
||||||
wxGauge* pControl = (wxGauge*) m_validatorWindow;
|
|
||||||
if (m_pInt)
|
|
||||||
{
|
{
|
||||||
*m_pInt = pControl->GetValue() ;
|
wxGauge* pControl = (wxGauge*) m_validatorWindow;
|
||||||
return true;
|
if (m_pInt)
|
||||||
}
|
{
|
||||||
} else
|
*m_pInt = pControl->GetValue() ;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_RADIOBOX
|
#if wxUSE_RADIOBOX
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
|
||||||
{
|
|
||||||
wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
|
|
||||||
if (m_pInt)
|
|
||||||
{
|
{
|
||||||
*m_pInt = pControl->GetSelection() ;
|
wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
|
||||||
return true;
|
if (m_pInt)
|
||||||
}
|
{
|
||||||
} else
|
*m_pInt = pControl->GetSelection() ;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_SCROLLBAR
|
#if wxUSE_SCROLLBAR
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
|
||||||
{
|
|
||||||
wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
|
|
||||||
if (m_pInt)
|
|
||||||
{
|
{
|
||||||
*m_pInt = pControl->GetThumbPosition() ;
|
wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
|
||||||
return true;
|
if (m_pInt)
|
||||||
}
|
{
|
||||||
} else
|
*m_pInt = pControl->GetThumbPosition() ;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_SPINCTRL && !defined(__WXMOTIF__)
|
#if wxUSE_SPINCTRL && !defined(__WXMOTIF__)
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinCtrl)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinCtrl)) )
|
||||||
@@ -408,153 +409,156 @@ bool wxGenericValidator::TransferFromWindow(void)
|
|||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_SPINBTN
|
#if wxUSE_SPINBTN
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
|
||||||
{
|
|
||||||
wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
|
|
||||||
if (m_pInt)
|
|
||||||
{
|
{
|
||||||
*m_pInt = pControl->GetValue() ;
|
wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
|
||||||
return true;
|
if (m_pInt)
|
||||||
}
|
{
|
||||||
} else
|
*m_pInt = pControl->GetValue() ;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_SLIDER
|
#if wxUSE_SLIDER
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSlider)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSlider)) )
|
||||||
{
|
|
||||||
wxSlider* pControl = (wxSlider*) m_validatorWindow;
|
|
||||||
if (m_pInt)
|
|
||||||
{
|
{
|
||||||
*m_pInt = pControl->GetValue() ;
|
wxSlider* pControl = (wxSlider*) m_validatorWindow;
|
||||||
return true;
|
if (m_pInt)
|
||||||
}
|
{
|
||||||
} else
|
*m_pInt = pControl->GetValue() ;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
// string controls
|
|
||||||
|
// STRING CONTROLS ************************************
|
||||||
#if wxUSE_BUTTON
|
#if wxUSE_BUTTON
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
|
||||||
{
|
|
||||||
wxButton* pControl = (wxButton*) m_validatorWindow;
|
|
||||||
if (m_pString)
|
|
||||||
{
|
{
|
||||||
*m_pString = pControl->GetLabel() ;
|
wxButton* pControl = (wxButton*) m_validatorWindow;
|
||||||
return true;
|
if (m_pString)
|
||||||
}
|
{
|
||||||
} else
|
*m_pString = pControl->GetLabel() ;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_COMBOBOX
|
#if wxUSE_COMBOBOX
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
|
||||||
{
|
|
||||||
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
|
|
||||||
if (m_pInt)
|
|
||||||
{
|
{
|
||||||
*m_pInt = pControl->GetSelection() ;
|
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
|
||||||
return true;
|
if (m_pInt)
|
||||||
}
|
{
|
||||||
else if (m_pString)
|
*m_pInt = pControl->GetSelection() ;
|
||||||
{
|
return true;
|
||||||
if (m_validatorWindow->GetWindowStyle() & wxCB_READONLY)
|
}
|
||||||
*m_pString = pControl->GetStringSelection();
|
else if (m_pString)
|
||||||
else
|
{
|
||||||
*m_pString = pControl->GetValue();
|
if (m_validatorWindow->GetWindowStyle() & wxCB_READONLY)
|
||||||
return true;
|
*m_pString = pControl->GetStringSelection();
|
||||||
}
|
else
|
||||||
} else
|
*m_pString = pControl->GetValue();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_CHOICE
|
#if wxUSE_CHOICE
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
|
||||||
{
|
{
|
||||||
wxChoice* pControl = (wxChoice*) m_validatorWindow;
|
wxChoice* pControl = (wxChoice*) m_validatorWindow;
|
||||||
if (m_pInt)
|
if (m_pInt)
|
||||||
{
|
{
|
||||||
*m_pInt = pControl->GetSelection() ;
|
*m_pInt = pControl->GetSelection() ;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (m_pString)
|
else if (m_pString)
|
||||||
{
|
{
|
||||||
*m_pString = pControl->GetStringSelection();
|
*m_pString = pControl->GetStringSelection();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_STATTEXT
|
#if wxUSE_STATTEXT
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
|
||||||
{
|
|
||||||
wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
|
|
||||||
if (m_pString)
|
|
||||||
{
|
{
|
||||||
*m_pString = pControl->GetLabel() ;
|
wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
|
||||||
return true;
|
if (m_pString)
|
||||||
}
|
{
|
||||||
} else
|
*m_pString = pControl->GetLabel() ;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_TEXTCTRL
|
#if wxUSE_TEXTCTRL
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
|
||||||
{
|
{
|
||||||
wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
|
wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
|
||||||
if (m_pString)
|
if (m_pString)
|
||||||
{
|
{
|
||||||
*m_pString = pControl->GetValue() ;
|
*m_pString = pControl->GetValue() ;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (m_pInt)
|
else if (m_pInt)
|
||||||
{
|
{
|
||||||
*m_pInt = wxAtoi(pControl->GetValue());
|
*m_pInt = wxAtoi(pControl->GetValue());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
// array controls
|
|
||||||
|
// ARRAY CONTROLS *************************************
|
||||||
#if wxUSE_CHECKLISTBOX
|
#if wxUSE_CHECKLISTBOX
|
||||||
// NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox MUST come first:
|
// NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox MUST come first:
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
|
||||||
{
|
|
||||||
wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
|
|
||||||
if (m_pArrayInt)
|
|
||||||
{
|
{
|
||||||
// clear our array
|
wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
|
||||||
m_pArrayInt->Clear();
|
if (m_pArrayInt)
|
||||||
|
{
|
||||||
|
// clear our array
|
||||||
|
m_pArrayInt->Clear();
|
||||||
|
|
||||||
// add each selected item to our array
|
// add each selected item to our array
|
||||||
size_t i,
|
size_t i,
|
||||||
count = pControl->GetCount();
|
count = pControl->GetCount();
|
||||||
for ( i = 0; i < count; i++ )
|
for ( i = 0; i < count; i++ )
|
||||||
{
|
{
|
||||||
if (pControl->IsChecked(i))
|
if (pControl->IsChecked(i))
|
||||||
m_pArrayInt->Add(i);
|
m_pArrayInt->Add(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_LISTBOX
|
#if wxUSE_LISTBOX
|
||||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
|
if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
|
||||||
{
|
|
||||||
wxListBox* pControl = (wxListBox*) m_validatorWindow;
|
|
||||||
if (m_pArrayInt)
|
|
||||||
{
|
{
|
||||||
// clear our array
|
wxListBox* pControl = (wxListBox*) m_validatorWindow;
|
||||||
m_pArrayInt->Clear();
|
if (m_pArrayInt)
|
||||||
|
{
|
||||||
|
// clear our array
|
||||||
|
m_pArrayInt->Clear();
|
||||||
|
|
||||||
// add each selected item to our array
|
// add each selected item to our array
|
||||||
size_t i,
|
size_t i,
|
||||||
count = pControl->GetCount();
|
count = pControl->GetCount();
|
||||||
for ( i = 0; i < count; i++ )
|
for ( i = 0; i < count; i++ )
|
||||||
{
|
{
|
||||||
if (pControl->Selected(i))
|
if (pControl->Selected(i))
|
||||||
m_pArrayInt->Add(i);
|
m_pArrayInt->Add(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// unrecognized control, or bad pointer
|
// unrecognized control, or bad pointer
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -261,7 +261,7 @@ wxString wxFileData::GetFileType() const
|
|||||||
return _("<LINK>");
|
return _("<LINK>");
|
||||||
else if (IsDrive())
|
else if (IsDrive())
|
||||||
return _("<DRIVE>");
|
return _("<DRIVE>");
|
||||||
else if (m_fileName.Find(wxT('.'), true) != wxNOT_FOUND)
|
else if (m_fileName.Find(wxT('.'), true) != wxNOT_FOUND)
|
||||||
return m_fileName.AfterLast(wxT('.'));
|
return m_fileName.AfterLast(wxT('.'));
|
||||||
|
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
@@ -318,7 +318,7 @@ wxString wxFileData::GetEntry( fileListFieldType num ) const
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case FileList_Time:
|
case FileList_Time:
|
||||||
if (!IsDrive())
|
if (!IsDrive())
|
||||||
s = GetModificationTime();
|
s = GetModificationTime();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -534,7 +534,7 @@ void wxFileCtrl::UpdateFiles()
|
|||||||
#endif // __UNIX__
|
#endif // __UNIX__
|
||||||
wxFileData *fd = new wxFileData(p, wxT(".."), wxFileData::is_dir, wxFileIconsTable::folder);
|
wxFileData *fd = new wxFileData(p, wxT(".."), wxFileData::is_dir, wxFileIconsTable::folder);
|
||||||
if (Add(fd, item) != -1)
|
if (Add(fd, item) != -1)
|
||||||
item.m_itemId++;
|
item.m_itemId++;
|
||||||
else
|
else
|
||||||
delete fd;
|
delete fd;
|
||||||
}
|
}
|
||||||
@@ -563,7 +563,7 @@ void wxFileCtrl::UpdateFiles()
|
|||||||
{
|
{
|
||||||
wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_dir, wxFileIconsTable::folder);
|
wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_dir, wxFileIconsTable::folder);
|
||||||
if (Add(fd, item) != -1)
|
if (Add(fd, item) != -1)
|
||||||
item.m_itemId++;
|
item.m_itemId++;
|
||||||
else
|
else
|
||||||
delete fd;
|
delete fd;
|
||||||
|
|
||||||
@@ -581,7 +581,7 @@ void wxFileCtrl::UpdateFiles()
|
|||||||
{
|
{
|
||||||
wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_file, wxFileIconsTable::file);
|
wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_file, wxFileIconsTable::file);
|
||||||
if (Add(fd, item) != -1)
|
if (Add(fd, item) != -1)
|
||||||
item.m_itemId++;
|
item.m_itemId++;
|
||||||
else
|
else
|
||||||
delete fd;
|
delete fd;
|
||||||
|
|
||||||
|
@@ -260,7 +260,7 @@ private:
|
|||||||
// Work around the fact that a focus kill event can be sent to
|
// Work around the fact that a focus kill event can be sent to
|
||||||
// a combobox within a set focus event.
|
// a combobox within a set focus event.
|
||||||
bool m_inSetFocus;
|
bool m_inSetFocus;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_DYNAMIC_CLASS(wxGridCellEditorEvtHandler)
|
DECLARE_DYNAMIC_CLASS(wxGridCellEditorEvtHandler)
|
||||||
DECLARE_NO_COPY_CLASS(wxGridCellEditorEvtHandler)
|
DECLARE_NO_COPY_CLASS(wxGridCellEditorEvtHandler)
|
||||||
@@ -1972,21 +1972,19 @@ void wxGridCellFloatRenderer::SetParameters(const wxString& params)
|
|||||||
{
|
{
|
||||||
wxLogDebug(_T("Invalid wxGridCellFloatRenderer width parameter string '%s ignored"), params.c_str());
|
wxLogDebug(_T("Invalid wxGridCellFloatRenderer width parameter string '%s ignored"), params.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
tmp = params.AfterFirst(_T(','));
|
tmp = params.AfterFirst(_T(','));
|
||||||
if ( !tmp.empty() )
|
if ( !tmp.empty() )
|
||||||
{
|
{
|
||||||
long precision;
|
long precision;
|
||||||
if ( tmp.ToLong(&precision) )
|
if ( tmp.ToLong(&precision) )
|
||||||
{
|
{
|
||||||
SetPrecision((int)precision);
|
SetPrecision((int)precision);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxLogDebug(_T("Invalid wxGridCellFloatRenderer precision parameter string '%s ignored"), params.c_str());
|
wxLogDebug(_T("Invalid wxGridCellFloatRenderer precision parameter string '%s ignored"), params.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -118,8 +118,9 @@ wxSize wxGridCellDateTimeRenderer::GetBestSize(wxGrid& grid,
|
|||||||
return DoGetBestSize(attr, dc, GetString(grid, row, col));
|
return DoGetBestSize(attr, dc, GetString(grid, row, col));
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGridCellDateTimeRenderer::SetParameters(const wxString& params){
|
void wxGridCellDateTimeRenderer::SetParameters(const wxString& params)
|
||||||
if (!params.IsEmpty())
|
{
|
||||||
|
if (!params.empty())
|
||||||
m_oformat=params;
|
m_oformat=params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,7 +135,7 @@ void wxGridCellDateTimeRenderer::SetParameters(const wxString& params){
|
|||||||
|
|
||||||
wxGridCellEnumRenderer::wxGridCellEnumRenderer(const wxString& choices)
|
wxGridCellEnumRenderer::wxGridCellEnumRenderer(const wxString& choices)
|
||||||
{
|
{
|
||||||
if (!choices.IsEmpty())
|
if (!choices.empty())
|
||||||
SetParameters(choices);
|
SetParameters(choices);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,11 +223,11 @@ void wxGridCellEnumRenderer::SetParameters(const wxString& params)
|
|||||||
// "John","Fred"..."Bob" in the combo choice box
|
// "John","Fred"..."Bob" in the combo choice box
|
||||||
|
|
||||||
wxGridCellEnumEditor::wxGridCellEnumEditor(const wxString& choices)
|
wxGridCellEnumEditor::wxGridCellEnumEditor(const wxString& choices)
|
||||||
: wxGridCellChoiceEditor()
|
:wxGridCellChoiceEditor()
|
||||||
{
|
{
|
||||||
m_startint = -1;
|
m_startint = -1;
|
||||||
|
|
||||||
if (!choices.IsEmpty())
|
if (!choices.empty())
|
||||||
SetParameters(choices);
|
SetParameters(choices);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,7 +252,7 @@ void wxGridCellEnumEditor::BeginEdit(int row, int col, wxGrid* grid)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxString startValue = table->GetValue(row, col);
|
wxString startValue = table->GetValue(row, col);
|
||||||
if (startValue.IsNumber() && !startValue.IsEmpty())
|
if (startValue.IsNumber() && !startValue.empty())
|
||||||
{
|
{
|
||||||
startValue.ToLong(&m_startint);
|
startValue.ToLong(&m_startint);
|
||||||
}
|
}
|
||||||
@@ -349,22 +350,24 @@ wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid,
|
|||||||
while ( tk.HasMoreTokens() )
|
while ( tk.HasMoreTokens() )
|
||||||
{
|
{
|
||||||
wxString tok = tk.GetNextToken();
|
wxString tok = tk.GetNextToken();
|
||||||
//FIXME: this causes us to print an extra unnecesary
|
//FIXME: this causes us to print an extra unnecesary
|
||||||
// space at the end of the line. But it
|
// space at the end of the line. But it
|
||||||
// is invisible , simplifies the size calculation
|
// is invisible , simplifies the size calculation
|
||||||
// and ensures tokens are separated in the display
|
// and ensures tokens are separated in the display
|
||||||
tok += _T(" ");
|
tok += _T(" ");
|
||||||
|
|
||||||
dc.GetTextExtent(tok, &x, &y);
|
dc.GetTextExtent(tok, &x, &y);
|
||||||
if ( curr_x + x > max_x) {
|
if ( curr_x + x > max_x)
|
||||||
|
{
|
||||||
lines.Add( wxString(thisline) );
|
lines.Add( wxString(thisline) );
|
||||||
thisline = tok;
|
thisline = tok;
|
||||||
curr_x=x;
|
curr_x=x;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
thisline+= tok;
|
thisline+= tok;
|
||||||
curr_x += x;
|
curr_x += x;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//Add last line
|
//Add last line
|
||||||
lines.Add( wxString(thisline) );
|
lines.Add( wxString(thisline) );
|
||||||
|
@@ -3716,8 +3716,8 @@ void wxListMainWindow::SetItemState( long litem, long state, long stateMask )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCHECK_RET( litem >= 0 && (size_t)litem < GetItemCount(),
|
wxCHECK_RET( litem >= 0 && (size_t)litem < GetItemCount(),
|
||||||
_T("invalid list ctrl item index in SetItem") );
|
_T("invalid list ctrl item index in SetItem") );
|
||||||
|
|
||||||
size_t oldCurrent = m_current;
|
size_t oldCurrent = m_current;
|
||||||
size_t item = (size_t)litem; // safe because of the check above
|
size_t item = (size_t)litem; // safe because of the check above
|
||||||
|
@@ -114,14 +114,14 @@ wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_Cache[tg].End1 = m_Cache[tg].End2 = -1;
|
m_Cache[tg].End1 = m_Cache[tg].End2 = -1;
|
||||||
|
|
||||||
if (wxIsCDATAElement(tagBuffer))
|
if (wxIsCDATAElement(tagBuffer))
|
||||||
{
|
{
|
||||||
// store the orig pos in case we are missing the closing
|
// store the orig pos in case we are missing the closing
|
||||||
// tag (see below)
|
// tag (see below)
|
||||||
wxInt32 old_pos = pos;
|
wxInt32 old_pos = pos;
|
||||||
bool foundCloseTag = false;
|
bool foundCloseTag = false;
|
||||||
|
|
||||||
// find next matching tag
|
// find next matching tag
|
||||||
int tag_len = wxStrlen(tagBuffer);
|
int tag_len = wxStrlen(tagBuffer);
|
||||||
while (pos < lng)
|
while (pos < lng)
|
||||||
@@ -152,7 +152,7 @@ wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// found a match
|
// found a match
|
||||||
if (match_pos == tag_len)
|
if (match_pos == tag_len)
|
||||||
{
|
{
|
||||||
pos = pos - tag_len - 3;
|
pos = pos - tag_len - 3;
|
||||||
foundCloseTag = true;
|
foundCloseTag = true;
|
||||||
@@ -365,12 +365,12 @@ wxHtmlTag::wxHtmlTag(wxHtmlTag *parent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#undef IS_WHITE
|
#undef IS_WHITE
|
||||||
}
|
}
|
||||||
m_Begin = i;
|
m_Begin = i;
|
||||||
|
|
||||||
cache->QueryTag(pos, &m_End1, &m_End2);
|
cache->QueryTag(pos, &m_End1, &m_End2);
|
||||||
if (m_End1 > end_pos) m_End1 = end_pos;
|
if (m_End1 > end_pos) m_End1 = end_pos;
|
||||||
if (m_End2 > end_pos) m_End2 = end_pos;
|
if (m_End2 > end_pos) m_End2 = end_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxHtmlTag::~wxHtmlTag()
|
wxHtmlTag::~wxHtmlTag()
|
||||||
|
Reference in New Issue
Block a user