Source cleaning: whitespaces, tabs, -1/wxID_ANY/wxNOT_FOUND/wxDefaultCoord, TRUE/true, FALSE/false, !!/!IsEmpty().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-09-23 18:20:56 +00:00
parent 957f865c97
commit cb719f2e29
29 changed files with 694 additions and 693 deletions

View File

@@ -102,25 +102,25 @@ bool wxTextFile::OnRead(wxMBConv& conv)
strPtr = strBuf = new char[1024];
strEnd = strBuf + 1024;
do
do
{
nRead = m_file.Read(buf, WXSIZEOF(buf));
if ( nRead == wxInvalidOffset )
if ( nRead == wxInvalidOffset )
{
// read error (error message already given in wxFile::Read)
delete[] strBuf;
return FALSE;
return false;
}
for (n = 0; n < nRead; n++)
{
ch = buf[n];
switch ( ch )
switch ( ch )
{
case '\n':
// Dos/Unix line termination
*strPtr = '\0';
AddLine(wxString(strBuf, conv),
AddLine(wxString(strBuf, conv),
chLast == '\r' ? wxTextFileType_Dos
: wxTextFileType_Unix);
strPtr = strBuf;
@@ -128,7 +128,7 @@ bool wxTextFile::OnRead(wxMBConv& conv)
break;
case '\r':
if ( chLast == '\r' )
if ( chLast == '\r' )
{
// Mac empty line
AddLine(wxEmptyString, wxTextFileType_Mac);
@@ -147,7 +147,7 @@ bool wxTextFile::OnRead(wxMBConv& conv)
strPtr = strBuf;
*(strPtr++) = ch;
}
else
else
{
// add to the current line
*(strPtr++) = ch;
@@ -168,15 +168,15 @@ bool wxTextFile::OnRead(wxMBConv& conv)
} while ( nRead == WXSIZEOF(buf) );
// anything in the last line?
if ( strPtr != strBuf )
if ( strPtr != strBuf )
{
*strPtr = '\0';
AddLine(wxString(strBuf, conv),
AddLine(wxString(strBuf, conv),
wxTextFileType_None); // no line terminator
}
delete[] strBuf;
return TRUE;
return true;
}
@@ -194,7 +194,7 @@ bool wxTextFile::OnWrite(wxTextFileType typeNew, wxMBConv& conv)
if ( !fileTmp.IsOpened() ) {
wxLogError(_("can't write buffer '%s' to disk."), m_strBufferName.c_str());
return FALSE;
return false;
}
size_t nCount = GetLineCount();