X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3a584a7a6ade199990dd4463488e4bbf3545349..c1ce7c198801c1766083a245874f07ea20b16407:/src/common/textbuf.cpp?ds=sidebyside diff --git a/src/common/textbuf.cpp b/src/common/textbuf.cpp index 5824b2014c..6158973ff1 100644 --- a/src/common/textbuf.cpp +++ b/src/common/textbuf.cpp @@ -3,15 +3,15 @@ // Purpose: implementation of wxTextBuffer class // Created: 14.11.01 // Author: Morten Hanssen, Vadim Zeitlin -// Copyright: (c) 1998-2001 wxWindows team -// Licence: wxWindows license +// Copyright: (c) 1998-2001 wxWidgets team +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ // headers // ============================================================================ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "textbuf.h" #endif @@ -43,7 +43,7 @@ // - Mac when compiling with CodeWarrior (__WXMAC__) const wxTextFileType wxTextBuffer::typeDefault = -#if defined(__WINDOWS__) +#if defined(__WINDOWS__) || defined(__DOS__) wxTextFileType_Dos; #elif defined(__UNIX__) wxTextFileType_Unix; @@ -143,7 +143,7 @@ wxTextBuffer::wxTextBuffer(const wxString& strBufferName) : m_strBufferName(strBufferName) { m_nCurLine = 0; - m_isOpened = FALSE; + m_isOpened = false; } wxTextBuffer::~wxTextBuffer() @@ -172,13 +172,13 @@ bool wxTextBuffer::Create() wxASSERT( !m_strBufferName.IsEmpty() ); // if the buffer already exists do nothing - if ( Exists() ) return FALSE; - + if ( Exists() ) return false; + if ( !OnOpen(m_strBufferName, WriteAccess) ) - return FALSE; + return false; OnClose(); - return TRUE; + return true; } bool wxTextBuffer::Open(const wxString& strBufferName, wxMBConv& conv) @@ -195,7 +195,7 @@ bool wxTextBuffer::Open(wxMBConv& conv) // open buffer in read-only mode if ( !OnOpen(m_strBufferName, ReadAccess) ) - return FALSE; + return false; // read buffer into memory m_isOpened = OnRead(conv); @@ -251,7 +251,8 @@ wxTextFileType wxTextBuffer::GuessType() const : wxTextFileType_##t2 // Watcom C++ doesn't seem to be able to handle the macro -#if !defined(__WATCOMC__) + // VS: Watcom 11 doesn't have a problem... +#if !(defined(__WATCOMC__) && (__WATCOMC__ < 1100)) if ( nDos > nUnix ) return GREATER_OF(Dos, Mac); else if ( nDos < nUnix ) @@ -274,9 +275,9 @@ bool wxTextBuffer::Close() m_aTypes.Clear(); m_aLines.Clear(); m_nCurLine = 0; - m_isOpened = FALSE; + m_isOpened = false; - return TRUE; + return true; } bool wxTextBuffer::Write(wxTextFileType typeNew, wxMBConv& conv)