From 68379eaf0ae64d105f8244b1db83e793f7dd83b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 10 Sep 2004 12:56:07 +0000 Subject: [PATCH] Source cleaning: whitespaces, tabs, TRUE/true, FALSE/false, -1/wxID_ANY/wxDefaultCoord, !!/!IsEmpty(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/calctrl.h | 16 +- include/wx/caret.h | 10 +- include/wx/checklst.h | 2 +- include/wx/clipbrd.h | 6 +- include/wx/cmdline.h | 14 +- include/wx/cmdproc.h | 6 +- include/wx/cmndata.h | 10 +- include/wx/confbase.h | 26 +- include/wx/containr.h | 2 +- include/wx/cppunit.h | 2 +- include/wx/cshelp.h | 8 +- include/wx/dataobj.h | 24 +- include/wx/datetime.h | 36 +-- include/wx/datstrm.h | 4 +- include/wx/db.h | 38 +-- include/wx/dbgrid.h | 6 +- include/wx/dbkeyg.h | 2 +- include/wx/dbtable.h | 58 ++--- include/wx/dc.h | 34 +-- include/wx/dcbuffer.h | 2 +- include/wx/dcmirror.h | 10 +- include/wx/debug.h | 18 +- include/wx/defs.h | 8 +- include/wx/dialup.h | 26 +- include/wx/dir.h | 4 +- include/wx/display.h | 2 +- include/wx/dnd.h | 8 +- include/wx/docmdi.h | 4 +- include/wx/docview.h | 30 +-- include/wx/dynarray.h | 14 +- include/wx/dynlib.h | 8 +- src/common/datacmn.cpp | 4 +- src/common/datetime.cpp | 148 ++++++------ src/common/datstrm.cpp | 10 +- src/common/db.cpp | 510 ++++++++++++++++++++-------------------- src/common/dbgrid.cpp | 66 +++--- src/common/dbtable.cpp | 246 +++++++++---------- src/common/dcbase.cpp | 6 +- src/common/dlgcmn.cpp | 36 +-- src/common/dobjcmn.cpp | 40 ++-- src/common/docmdi.cpp | 26 +- src/common/docview.cpp | 218 ++++++++--------- src/common/dynlib.cpp | 4 +- src/common/dynload.cpp | 16 +- 44 files changed, 884 insertions(+), 884 deletions(-) diff --git a/include/wx/calctrl.h b/include/wx/calctrl.h index fb1f324d46..d96eb26df8 100644 --- a/include/wx/calctrl.h +++ b/include/wx/calctrl.h @@ -92,7 +92,7 @@ protected: void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE) { m_border = border; - m_holiday = FALSE; + m_holiday = false; } #endif public: @@ -143,7 +143,7 @@ protected: void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE) { m_border = border; - m_holiday = FALSE; + m_holiday = false; } #endif private: @@ -205,12 +205,12 @@ END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&); -#define EVT_CALENDAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_DOUBLECLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), -#define EVT_CALENDAR_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), -#define EVT_CALENDAR_DAY(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_DAY_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), -#define EVT_CALENDAR_MONTH(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_MONTH_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), -#define EVT_CALENDAR_YEAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_YEAR_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), -#define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_WEEKDAY_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), +#define EVT_CALENDAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_DOUBLECLICKED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), +#define EVT_CALENDAR_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_SEL_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), +#define EVT_CALENDAR_DAY(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_DAY_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), +#define EVT_CALENDAR_MONTH(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_MONTH_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), +#define EVT_CALENDAR_YEAR(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_YEAR_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), +#define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_CALENDAR_WEEKDAY_CLICKED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxCalendarEventFunction, & fn ), (wxObject *) NULL), #endif // wxUSE_CALENDARCTRL diff --git a/include/wx/caret.h b/include/wx/caret.h index 0967690a1b..16caa514d8 100644 --- a/include/wx/caret.h +++ b/include/wx/caret.h @@ -118,7 +118,7 @@ public: // show/hide the caret (should be called by wxWindow when needed): // Show() must be called as many times as Hide() + 1 to make the caret // visible - virtual void Show(bool show = TRUE) + virtual void Show(bool show = true) { if ( show ) { @@ -131,7 +131,7 @@ public: DoHide(); } } - virtual void Hide() { Show(FALSE); } + virtual void Hide() { Show(false); } // blink time is measured in milliseconds and is the time elapsed // between 2 inversions of the caret (blink time of the caret is common @@ -156,7 +156,7 @@ protected: m_width = width; m_height = height; - return TRUE; + return true; } // pure virtuals to implement in the derived class @@ -212,11 +212,11 @@ public: wxCaretSuspend(wxWindow *win) { m_caret = win->GetCaret(); - m_show = FALSE; + m_show = false; if ( m_caret && m_caret->IsVisible() ) { m_caret->Hide(); - m_show = TRUE; + m_show = true; } } diff --git a/include/wx/checklst.h b/include/wx/checklst.h index ce34f6cbcd..8e33246eca 100644 --- a/include/wx/checklst.h +++ b/include/wx/checklst.h @@ -27,7 +27,7 @@ public: // check list box specific methods virtual bool IsChecked(size_t item) const = 0; - virtual void Check(size_t item, bool check = TRUE) = 0; + virtual void Check(size_t item, bool check = true) = 0; DECLARE_NO_COPY_CLASS(wxCheckListBoxBase) }; diff --git a/include/wx/clipbrd.h b/include/wx/clipbrd.h index f4c29ba4b7..e53990c2cb 100644 --- a/include/wx/clipbrd.h +++ b/include/wx/clipbrd.h @@ -65,17 +65,17 @@ public: // fill data with data on the clipboard (if available) virtual bool GetData( wxDataObject& data ) = 0; - + // clears wxTheClipboard and the system's clipboard if possible virtual void Clear() = 0; // flushes the clipboard: this means that the data which is currently on // clipboard will stay available even after the application exits (possibly // eating memory), otherwise the clipboard will be emptied on exit - virtual bool Flush() { return FALSE; } + virtual bool Flush() { return false; } // X11 has two clipboards which get selected by this call. Empty on MSW. - virtual void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { } + virtual void UsePrimarySelection( bool WXUNUSED(primary) = false ) { } // Returns global instance (wxTheClipboard) of the object: static wxClipboard *Get(); diff --git a/include/wx/cmdline.h b/include/wx/cmdline.h index 66beea5a44..32b7ff42ea 100644 --- a/include/wx/cmdline.h +++ b/include/wx/cmdline.h @@ -129,8 +129,8 @@ public: void SetSwitchChars(const wxString& switchChars); // long options are not POSIX-compliant, this option allows to disable them - void EnableLongOptions(bool enable = TRUE); - void DisableLongOptions() { EnableLongOptions(FALSE); } + void EnableLongOptions(bool enable = true); + void DisableLongOptions() { EnableLongOptions(false); } bool AreLongOptionsEnabled(); @@ -168,7 +168,7 @@ public: // // if showUsage is true, Usage() is called in case of syntax error or if // help was requested - int Parse(bool showUsage = TRUE); + int Parse(bool showUsage = true); // give the usage message describing all program options void Usage(); @@ -176,19 +176,19 @@ public: // get the command line arguments // ------------------------------ - // returns TRUE if the given switch was found + // returns true if the given switch was found bool Found(const wxString& name) const; - // returns TRUE if an option taking a string value was found and stores the + // returns true if an option taking a string value was found and stores the // value in the provided pointer bool Found(const wxString& name, wxString *value) const; - // returns TRUE if an option taking an integer value was found and stores + // returns true if an option taking an integer value was found and stores // the value in the provided pointer bool Found(const wxString& name, long *value) const; #if wxUSE_DATETIME - // returns TRUE if an option taking a date value was found and stores the + // returns true if an option taking a date value was found and stores the // value in the provided pointer bool Found(const wxString& name, wxDateTime *value) const; #endif // wxUSE_DATETIME diff --git a/include/wx/cmdproc.h b/include/wx/cmdproc.h index a7a55806e9..563c8480d2 100644 --- a/include/wx/cmdproc.h +++ b/include/wx/cmdproc.h @@ -29,7 +29,7 @@ class WXDLLEXPORT wxMenu; class WXDLLEXPORT wxCommand : public wxObject { public: - wxCommand(bool canUndoIt = FALSE, const wxString& name = wxEmptyString); + wxCommand(bool canUndoIt = false, const wxString& name = wxEmptyString); ~wxCommand(); // Override this to perform a command @@ -61,8 +61,8 @@ public: virtual ~wxCommandProcessor(); // Pass a command to the processor. The processor calls Do(); if - // successful, is appended to the command history unless storeIt is FALSE. - virtual bool Submit(wxCommand *command, bool storeIt = TRUE); + // successful, is appended to the command history unless storeIt is false. + virtual bool Submit(wxCommand *command, bool storeIt = true); // just store the command without executing it virtual void Store(wxCommand *command); diff --git a/include/wx/cmndata.h b/include/wx/cmndata.h index fae981643e..c6632a2c0b 100644 --- a/include/wx/cmndata.h +++ b/include/wx/cmndata.h @@ -49,7 +49,7 @@ public: wxColour m_dataColour; wxColour m_custColours[16]; bool m_chooseFull; - + private: DECLARE_DYNAMIC_CLASS(wxColourData) }; @@ -90,7 +90,7 @@ public: m_encodingInfo = data.m_encodingInfo; return *this; } - + void SetAllowSymbols(bool flag) { m_allowSymbols = flag; } bool GetAllowSymbols() const { return m_allowSymbols; } @@ -132,7 +132,7 @@ public: private: wxFontEncoding m_encoding; wxNativeEncodingInfo m_encodingInfo; - + private: DECLARE_DYNAMIC_CLASS(wxFontData) }; @@ -356,7 +356,7 @@ private: bool m_printSetupDialog; wxPrintData m_printData; -private: +private: DECLARE_DYNAMIC_CLASS(wxPrintDialogData) }; @@ -457,7 +457,7 @@ private: bool m_getDefaultInfo; // Equiv. to PSD_RETURNDEFAULT bool m_enableHelp; wxPrintData m_printData; - + private: DECLARE_DYNAMIC_CLASS(wxPageSetupDialogData) }; diff --git a/include/wx/confbase.h b/include/wx/confbase.h index 699a9e0ace..0e23972e4c 100644 --- a/include/wx/confbase.h +++ b/include/wx/confbase.h @@ -49,7 +49,7 @@ class WXDLLIMPEXP_BASE wxArrayString; /// should we use registry instead of configuration files under Windows? // (i.e. whether wxConfigBase::Create() will create a wxFileConfig (if it's -// FALSE) or wxRegConfig (if it's true and we're under Win32)) +// false) or wxRegConfig (if it's true and we're under Win32)) #ifndef wxUSE_CONFIG_NATIVE #define wxUSE_CONFIG_NATIVE 1 #endif @@ -94,7 +94,7 @@ public: static wxConfigBase *Set(wxConfigBase *pConfig); // get the config object, creates it on demand unless DontCreateOnDemand // was called - static wxConfigBase *Get(bool createOnDemand = TRUE) + static wxConfigBase *Get(bool createOnDemand = true) { if ( createOnDemand && (!ms_pConfig) ) Create(); return ms_pConfig; } // create a new config object: this function will create the "best" // implementation of wxConfig available for the current platform, see @@ -102,7 +102,7 @@ public: // the created object and also sets it as ms_pConfig. static wxConfigBase *Create(); // should Get() try to create a new log object if the current one is NULL? - static void DontCreateOnDemand() { ms_bAutoCreate = FALSE; } + static void DontCreateOnDemand() { ms_bAutoCreate = false; } // ctor & virtual dtor // ctor (can be used as default ctor too) @@ -137,15 +137,15 @@ public: virtual bool GetNextEntry (wxString& str, long& lIndex) const = 0; // get number of entries/subgroups in the current group, with or without // it's subgroups - virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const = 0; - virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const = 0; + virtual size_t GetNumberOfEntries(bool bRecursive = false) const = 0; + virtual size_t GetNumberOfGroups(bool bRecursive = false) const = 0; // tests of existence - // returns TRUE if the group by this name exists + // returns true if the group by this name exists virtual bool HasGroup(const wxString& strName) const = 0; // same as above, but for an entry virtual bool HasEntry(const wxString& strName) const = 0; - // returns TRUE if either a group or an entry with a given name exist + // returns true if either a group or an entry with a given name exist bool Exists(const wxString& strName) const { return HasGroup(strName) || HasEntry(strName); } @@ -156,7 +156,7 @@ public: return HasEntry(name) ? Type_String : Type_Unknown; } - // key access: returns TRUE if value was really read, FALSE if default used + // key access: returns true if value was really read, false if default used // (and if the key is not found the default value is returned.) // read a string from the key @@ -210,9 +210,9 @@ public: { return Write(key, wxString(value)); } // permanently writes all changes - virtual bool Flush(bool bCurrentOnly = FALSE) = 0; + virtual bool Flush(bool bCurrentOnly = false) = 0; - // renaming, all functions return FALSE on failure (probably because the new + // renaming, all functions return false on failure (probably because the new // name is already taken by an existing entry) // rename an entry virtual bool RenameEntry(const wxString& oldName, @@ -225,7 +225,7 @@ public: // deletes the specified entry and the group it belongs to if // it was the last key in it and the second parameter is true virtual bool DeleteEntry(const wxString& key, - bool bDeleteGroupIfEmpty = TRUE) = 0; + bool bDeleteGroupIfEmpty = true) = 0; // delete the group (with all subgroups) virtual bool DeleteGroup(const wxString& key) = 0; // delete the whole underlying object (disk file, registry key, ...) @@ -236,9 +236,9 @@ public: // we can automatically expand environment variables in the config entries // (this option is on by default, you can turn it on/off at any time) bool IsExpandingEnvVars() const { return m_bExpandEnvVars; } - void SetExpandEnvVars(bool bDoIt = TRUE) { m_bExpandEnvVars = bDoIt; } + void SetExpandEnvVars(bool bDoIt = true) { m_bExpandEnvVars = bDoIt; } // recording of default values - void SetRecordDefaults(bool bDoIt = TRUE) { m_bRecordDefaults = bDoIt; } + void SetRecordDefaults(bool bDoIt = true) { m_bRecordDefaults = bDoIt; } bool IsRecordingDefaults() const { return m_bRecordDefaults; } // does expansion only if needed wxString ExpandEnvVars(const wxString& str) const; diff --git a/include/wx/containr.h b/include/wx/containr.h index cd308a2306..a70b4eadef 100644 --- a/include/wx/containr.h +++ b/include/wx/containr.h @@ -65,7 +65,7 @@ public: void HandleOnFocus(wxFocusEvent& event); void HandleOnWindowDestroy(wxWindowBase *child); - // should be called from SetFocus(), returns FALSE if we did nothing with + // should be called from SetFocus(), returns false if we did nothing with // the focus and the default processing should take place bool DoSetFocus(); diff --git a/include/wx/cppunit.h b/include/wx/cppunit.h index 243e68303f..dbdae16f4a 100644 --- a/include/wx/cppunit.h +++ b/include/wx/cppunit.h @@ -47,7 +47,7 @@ // Base macro for wrapping CPPUNIT_TEST macros and so making them conditional // tests, meaning that the test only get registered and thus run when a given -// runtime condition is true. +// runtime condition is true. // In case the condition is evaluated as false a skip message is logged // (the message will only be shown in verbose mode). #define WXTEST_ANY_WITH_CONDITION(suiteName, Condition, testMethod, anyTest) \ diff --git a/include/wx/cshelp.h b/include/wx/cshelp.h index eb21207da1..9780189ffe 100644 --- a/include/wx/cshelp.h +++ b/include/wx/cshelp.h @@ -6,7 +6,7 @@ // Created: 08/09/2000 // RCS-ID: $Id$ // Copyright: (c) 2000 Julian Smart, Vadim Zeitlin -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CSHELPH__ @@ -41,7 +41,7 @@ class WXDLLEXPORT wxContextHelp : public wxObject { public: - wxContextHelp(wxWindow* win = NULL, bool beginHelp = TRUE); + wxContextHelp(wxWindow* win = NULL, bool beginHelp = true); virtual ~wxContextHelp(); bool BeginContextHelp(wxWindow* win); @@ -54,7 +54,7 @@ public: protected: bool m_inHelp; - bool m_status; // TRUE if the user left-clicked + bool m_status; // true if the user left-clicked private: DECLARE_DYNAMIC_CLASS(wxContextHelp) @@ -117,7 +117,7 @@ public: virtual wxString GetHelp(const wxWindowBase *window) = 0; // do show help for the given window (uses GetHelp() internally if - // applicable), return TRUE if it was done or FALSE if no help available + // applicable), return true if it was done or false if no help available // for this window virtual bool ShowHelp(wxWindowBase *window) = 0; diff --git a/include/wx/dataobj.h b/include/wx/dataobj.h index 6c8fac34d0..05be93fee2 100644 --- a/include/wx/dataobj.h +++ b/include/wx/dataobj.h @@ -143,18 +143,18 @@ public: virtual size_t GetDataSize(const wxDataFormat& format) const = 0; // copy raw data (in the specified format) to the provided buffer, return - // TRUE if data copied successfully, FALSE otherwise + // true if data copied successfully, false otherwise virtual bool GetDataHere(const wxDataFormat& format, void *buf) const = 0; // get data from the buffer of specified length (in the given format), - // return TRUE if the data was read successfully, FALSE otherwise + // return true if the data was read successfully, false otherwise virtual bool SetData(const wxDataFormat& WXUNUSED(format), size_t WXUNUSED(len), const void * WXUNUSED(buf)) { - return FALSE; + return false; } - // returns TRUE if this format is supported + // returns true if this format is supported bool IsSupported(const wxDataFormat& format, Direction dir = Get) const; }; @@ -180,7 +180,7 @@ public: // ---------------------------------------------------------------------------- // wxDataObjectSimple is a wxDataObject which only supports one format (in -// both Get and Set directions, but you may return FALSE from GetDataHere() or +// both Get and Set directions, but you may return false from GetDataHere() or // SetData() if one of them is not supported). This is the simplest possible // wxDataObject implementation. // @@ -218,11 +218,11 @@ public: // copy our data to the buffer virtual bool GetDataHere(void *WXUNUSED(buf)) const - { return FALSE; } + { return false; } // copy data from buffer to our data virtual bool SetData(size_t WXUNUSED(len), const void *WXUNUSED(buf)) - { return FALSE; } + { return false; } // implement base class pure virtuals // ---------------------------------- @@ -270,8 +270,8 @@ public: // add data object (it will be deleted by wxDataObjectComposite, hence it // must be allocated on the heap) whose format will become the preferred - // one if preferred == TRUE - void Add(wxDataObjectSimple *dataObject, bool preferred = FALSE); + // one if preferred == true + void Add(wxDataObjectSimple *dataObject, bool preferred = false); // implement base class pure virtuals // ---------------------------------- @@ -340,7 +340,7 @@ public: virtual size_t GetFormatCount(Direction WXUNUSED(dir) = Get) const { return 2; } virtual void GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction WXUNUSED(dir) = Get) const; - + virtual size_t GetDataSize() const { return GetDataSize(GetPreferredFormat()); } virtual bool GetDataHere(void *buf) const { return GetDataHere(GetPreferredFormat(), buf); } virtual bool SetData(size_t len, const void *buf) { return SetData(GetPreferredFormat(), len, buf); } @@ -375,7 +375,7 @@ public: private: wxString m_text; - + DECLARE_NO_COPY_CLASS(wxTextDataObject) }; @@ -422,7 +422,7 @@ public: // the Get() functions do nothing for us virtual size_t GetDataSize() const { return 0; } - virtual bool GetDataHere(void *WXUNUSED(buf)) const { return FALSE; } + virtual bool GetDataHere(void *WXUNUSED(buf)) const { return false; } protected: wxArrayString m_filenames; diff --git a/include/wx/datetime.h b/include/wx/datetime.h index 6e45b0fcd4..3004de66b1 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -463,7 +463,7 @@ public: // get the current country static Country GetCountry(); - // return TRUE if the country is a West European one (in practice, + // return true if the country is a West European one (in practice, // this means that the same DST rules as for EEC apply) static bool IsWestEuropeanCountry(Country country = Country_Default); @@ -479,7 +479,7 @@ public: // return the current month static Month GetCurrentMonth(Calendar cal = Gregorian); - // returns TRUE if the given year is a leap year in the given calendar + // returns true if the given year is a leap year in the given calendar static bool IsLeapYear(int year = Inv_Year, Calendar cal = Gregorian); // get the century (19 for 1999, 20 for 2000 and -5 for 492 BC) @@ -508,7 +508,7 @@ public: // get the AM and PM strings in the current locale (may be empty) static void GetAmPmStrings(wxString *am, wxString *pm); - // return TRUE if the given country uses DST for this year + // return true if the given country uses DST for this year static bool IsDSTApplicable(int year = Inv_Year, Country country = Country_Default); @@ -664,7 +664,7 @@ public: inline wxDateTime GetPrevWeekDay(WeekDay weekday) const; // set to Nth occurence of given weekday in the given month of the - // given year (time is set to 0), return TRUE on success and FALSE on + // given year (time is set to 0), return true on success and false on // failure. n may be positive (1..5) or negative to count from the end // of the month (see helper function SetToLastWeekDay()) bool SetToWeekDay(WeekDay weekday, @@ -685,7 +685,7 @@ public: int year = Inv_Year); // sets the date to the given day of the given week in the year, - // returns TRUE on success and FALSE if given date doesn't exist (e.g. + // returns true on success and false if given date doesn't exist (e.g. // numWeek is > 53) bool SetToTheWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, @@ -759,12 +759,12 @@ public: // ------------------------------------------------------------------------ // transform to any given timezone - inline wxDateTime ToTimezone(const TimeZone& tz, bool noDST = FALSE) const; - wxDateTime& MakeTimezone(const TimeZone& tz, bool noDST = FALSE); + inline wxDateTime ToTimezone(const TimeZone& tz, bool noDST = false) const; + wxDateTime& MakeTimezone(const TimeZone& tz, bool noDST = false); // transform to GMT/UTC - wxDateTime ToGMT(bool noDST = FALSE) const { return ToTimezone(GMT0, noDST); } - wxDateTime& MakeGMT(bool noDST = FALSE) { return MakeTimezone(GMT0, noDST); } + wxDateTime ToGMT(bool noDST = false) const { return ToTimezone(GMT0, noDST); } + wxDateTime& MakeGMT(bool noDST = false) { return MakeTimezone(GMT0, noDST); } // is daylight savings time in effect at this moment according to the // rules of the specified country? @@ -854,20 +854,20 @@ public: // comparison (see also functions below for operator versions) // ------------------------------------------------------------------------ - // returns TRUE if the two moments are strictly identical + // returns true if the two moments are strictly identical inline bool IsEqualTo(const wxDateTime& datetime) const; - // returns TRUE if the date is strictly earlier than the given one + // returns true if the date is strictly earlier than the given one inline bool IsEarlierThan(const wxDateTime& datetime) const; - // returns TRUE if the date is strictly later than the given one + // returns true if the date is strictly later than the given one inline bool IsLaterThan(const wxDateTime& datetime) const; - // returns TRUE if the date is strictly in the given range + // returns true if the date is strictly in the given range inline bool IsStrictlyBetween(const wxDateTime& t1, const wxDateTime& t2) const; - // returns TRUE if the date is in the given range + // returns true if the date is in the given range inline bool IsBetween(const wxDateTime& t1, const wxDateTime& t2) const; // do these two objects refer to the same date? @@ -984,7 +984,7 @@ private: // fixed to 1000 static const long TIME_T_FACTOR; - // returns TRUE if we fall in range in which we can use standard ANSI C + // returns true if we fall in range in which we can use standard ANSI C // functions inline bool IsInStdRange() const; @@ -1096,11 +1096,11 @@ public: // are two timespans equal? inline bool IsEqualTo(const wxTimeSpan& ts) const; // compare two timestamps: works with the absolute values, i.e. -2 - // hours is longer than 1 hour. Also, it will return FALSE if the + // hours is longer than 1 hour. Also, it will return false if the // timespans are equal in absolute value. inline bool IsLongerThan(const wxTimeSpan& ts) const; // compare two timestamps: works with the absolute values, i.e. 1 - // hour is shorter than -2 hours. Also, it will return FALSE if the + // hour is shorter than -2 hours. Also, it will return false if the // timespans are equal in absolute value. bool IsShorterThan(const wxTimeSpan& t) const { return !IsLongerThan(t); } @@ -1301,7 +1301,7 @@ class WXDLLIMPEXP_BASE wxDateTimeHolidayAuthority { friend class wxDateTimeHolidaysModule; public: - // returns TRUE if the given date is a holiday + // returns true if the given date is a holiday static bool IsHoliday(const wxDateTime& dt); // fills the provided array with all holidays in the given range, returns diff --git a/include/wx/datstrm.h b/include/wx/datstrm.h index 18738669d8..76d82f6133 100644 --- a/include/wx/datstrm.h +++ b/include/wx/datstrm.h @@ -6,7 +6,7 @@ // Created: 28/06/1998 // RCS-ID: $Id$ // Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DATSTREAM_H_ @@ -31,7 +31,7 @@ public: wxDataInputStream(wxInputStream& s); #endif ~wxDataInputStream(); - + bool IsOk() { return m_input->IsOk(); } wxUint64 Read64(); diff --git a/include/wx/db.h b/include/wx/db.h index 9cb6da18de..1db41bad87 100644 --- a/include/wx/db.h +++ b/include/wx/db.h @@ -26,7 +26,7 @@ #define _WX_DB_H_ -// BJO 20000503: introduce new GetColumns members which are more database independant and +// BJO 20000503: introduce new GetColumns members which are more database independant and // return columns in the order they were created #define OLD_GETCOLUMNS 1 #define EXPERIMENTAL_WXDB_FUNCTIONS 1 @@ -42,7 +42,7 @@ #include "wx/defs.h" #include "wx/string.h" -#if defined(__VISUALC__) +#if defined(__VISUALC__) // we need to include standard Windows headers but we can't include // directly when using MFC because it includes it itself in a // different manner @@ -293,8 +293,8 @@ class WXDLLIMPEXP_ODBC wxDbConnectInf public: wxDbConnectInf(); - wxDbConnectInf(HENV henv, const wxString &dsn, const wxString &userID=wxEmptyString, - const wxString &password=wxEmptyString, const wxString &defaultDir=wxEmptyString, + wxDbConnectInf(HENV henv, const wxString &dsn, const wxString &userID=wxEmptyString, + const wxString &password=wxEmptyString, const wxString &defaultDir=wxEmptyString, const wxString &description=wxEmptyString, const wxString &fileType=wxEmptyString); ~wxDbConnectInf(); @@ -488,13 +488,13 @@ private: wxDBMS dbmsType; // Type of datasource - i.e. Oracle, dBase, SQLServer, etc // Private member functions - bool getDbInfo(bool failOnDataTypeUnsupported=TRUE); + bool getDbInfo(bool failOnDataTypeUnsupported=true); bool getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo); bool setConnectionOptions(void); void logError(const wxString &errMsg, const wxString &SQLState); const wxChar *convertUserID(const wxChar *userID, wxString &UserID); void initialize(); - bool open(bool failOnDataTypeUnsupported=TRUE); + bool open(bool failOnDataTypeUnsupported=true); #if !wxODBC_BACKWARD_COMPATABILITY // ODBC handles @@ -606,9 +606,9 @@ public: ~wxDb(); // Data Source Name, User ID, Password and whether open should fail on data type not supported - bool Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported=TRUE); - bool Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthStr, bool failOnDataTypeUnsupported=TRUE); - bool Open(wxDbConnectInf *dbConnectInf, bool failOnDataTypeUnsupported=TRUE); + bool Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported=true); + bool Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthStr, bool failOnDataTypeUnsupported=true); + bool Open(wxDbConnectInf *dbConnectInf, bool failOnDataTypeUnsupported=true); bool Open(wxDb *copyDb); // pointer to a wxDb whose connection info should be copied rather than re-queried void Close(void); bool CommitTrans(void); @@ -616,7 +616,7 @@ public: bool DispAllErrors(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT); bool GetNextError(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT); void DispNextError(void); - bool CreateView(const wxString &viewName, const wxString &colList, const wxString &pSqlStmt, bool attemptDrop=TRUE); + bool CreateView(const wxString &viewName, const wxString &colList, const wxString &pSqlStmt, bool attemptDrop=true); bool DropView(const wxString &viewName); bool ExecSql(const wxString &pSqlStmt); bool GetNext(void); @@ -628,7 +628,7 @@ public: int GetKeyFields(const wxString &tableName, wxDbColInf* colInf, UWORD noCols); wxDbColInf *GetColumns(wxChar *tableName[], const wxChar *userID=NULL); - wxDbColInf *GetColumns(const wxString &tableName, UWORD *numCols, const wxChar *userID=NULL); + wxDbColInf *GetColumns(const wxString &tableName, UWORD *numCols, const wxChar *userID=NULL); int GetColumnCount(const wxString &tableName, const wxChar *userID=NULL); const wxChar *GetDatabaseName(void) {return dbInf.dbmsName;} @@ -651,25 +651,25 @@ public: wxDbSqlTypeInfo GetTypeInfBlob() {return typeInfBlob;} // tableName can refer to a table, view, alias or synonym - bool TableExists(const wxString &tableName, const wxChar *userID=NULL, + bool TableExists(const wxString &tableName, const wxChar *userID=NULL, const wxString &tablePath=wxEmptyString); - bool TablePrivileges(const wxString &tableName, const wxString &priv, - const wxChar *userID=NULL, const wxChar *schema=NULL, + bool TablePrivileges(const wxString &tableName, const wxString &priv, + const wxChar *userID=NULL, const wxChar *schema=NULL, const wxString &path=wxEmptyString); // These two functions return the table name or column name in a form ready // for use in SQL statements. For example, if the datasource allows spaces // in the table name or column name, the returned string will have the - // correct enclosing marks around the name to allow it to be properly + // correct enclosing marks around the name to allow it to be properly // included in a SQL statement const wxString SQLTableName(const wxChar *tableName); const wxString SQLColumnName(const wxChar *colName); - void LogError(const wxString &errMsg, const wxString &SQLState = wxEmptyString) + void LogError(const wxString &errMsg, const wxString &SQLState = wxEmptyString) { logError(errMsg, SQLState); } void SetDebugErrorMessages(bool state) { silent = !state; } - bool SetSqlLogging(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME, - bool append = FALSE); + bool SetSqlLogging(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME, + bool append = false); bool WriteSqlLog(const wxString &logMsg); wxDBMS Dbms(void); @@ -742,7 +742,7 @@ wxDbSqlLog(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME); #if 0 // MSW/VC6 ONLY!!! Experimental int WXDLLEXPORT wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const wxString &description=wxEmptyString, - bool sysDSN=FALSE, const wxString &defDir=wxEmptyString, wxWindow *parent=NULL); + bool sysDSN=false, const wxString &defDir=wxEmptyString, wxWindow *parent=NULL); #endif // This routine allows you to query a driver manager diff --git a/include/wx/dbgrid.h b/include/wx/dbgrid.h index 7be25daf90..c057b4b116 100644 --- a/include/wx/dbgrid.h +++ b/include/wx/dbgrid.h @@ -118,7 +118,7 @@ class WXDLLIMPEXP_DBGRID wxDbGridTableBase : public wxGridTableBase { public: wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo *ColInfo, - int count = wxUSE_QUERY, bool takeOwnership = TRUE); + int count = wxUSE_QUERY, bool takeOwnership = true); ~wxDbGridTableBase(); virtual int GetNumberRows() @@ -150,12 +150,12 @@ public: virtual wxString GetColLabelValue(int col); - virtual bool AssignDbTable(wxDbTable *tab, int count = wxUSE_QUERY, bool takeOwnership=TRUE); + virtual bool AssignDbTable(wxDbTable *tab, int count = wxUSE_QUERY, bool takeOwnership=true); virtual void ValidateRow(int row); virtual bool UpdateRow(int row) const { if (m_row != row) - return TRUE; + return true; else return Writeback(); } diff --git a/include/wx/dbkeyg.h b/include/wx/dbkeyg.h index d6187688b9..1c6f8da3c8 100644 --- a/include/wx/dbkeyg.h +++ b/include/wx/dbkeyg.h @@ -3,7 +3,7 @@ // Purpose: Generic key support for wxDbTable // Author: Roger Gammans // Modified by: -// Created: +// Created: // RCS-ID: $Id$ // Copyright: (c) 1999 The Computer Surgery (roger@computer-surgery.co.uk) // Licence: wxWindows licence diff --git a/include/wx/dbtable.h b/include/wx/dbtable.h index a6b3bd34cb..d59066b215 100644 --- a/include/wx/dbtable.h +++ b/include/wx/dbtable.h @@ -32,8 +32,8 @@ const int wxDB_ROWID_LEN = 24; // 18 is the max, 24 is in case it gets larger const int wxDB_DEFAULT_CURSOR = 0; -const bool wxDB_QUERY_ONLY = TRUE; -const bool wxDB_DISABLE_VIEW = TRUE; +const bool wxDB_QUERY_ONLY = true; +const bool wxDB_DISABLE_VIEW = true; // Used to indicate end of a variable length list of // column numbers passed to member functions @@ -55,7 +55,7 @@ public: SWORD SqlCtype; // C data type; e.g. SQL_C_LONG void *PtrDataObj; // Address of the data object int SzDataObj; // Size, in bytes, of the data object - bool KeyField; // TRUE if this column is part of the PRIMARY KEY to the table; Date fields should NOT be KeyFields. + bool KeyField; // true if this column is part of the PRIMARY KEY to the table; Date fields should NOT be KeyFields. bool Updateable; // Specifies whether this column is updateable bool InsertAllowed; // Specifies whether this column should be included in an INSERT statement bool DerivedCol; // Specifies whether this column is a derived value @@ -181,27 +181,27 @@ public: #endif // Public member functions wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns, - const wxString &qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY, + const wxString &qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY, const wxString &tblPath=wxEmptyString); // DEPRECATED wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns, - const wxChar *qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY, + const wxChar *qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY, const wxString &tblPath=wxEmptyString); virtual ~wxDbTable(); - bool Open(bool checkPrivileges=FALSE, bool checkTableExists=TRUE); - bool CreateTable(bool attemptDrop=TRUE); + bool Open(bool checkPrivileges=false, bool checkTableExists=true); + bool CreateTable(bool attemptDrop=true); bool DropTable(void); - bool CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCols, - wxDbIdxDef *pIdxDefs, bool attemptDrop=TRUE); + bool CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCols, + wxDbIdxDef *pIdxDefs, bool attemptDrop=true); bool DropIndex(const wxString &idxName); // Accessors // The member variables returned by these accessors are all - // set when the wxDbTable instance is created and cannot be + // set when the wxDbTable instance is created and cannot be // changed, hence there is no corresponding SetXxxx function wxDb *GetDb() { return pDb; } const wxString &GetTableName() { return tableName; } @@ -238,10 +238,10 @@ public: bool Delete(void); bool DeleteWhere(const wxString &pWhereClause); bool DeleteMatching(void); - virtual bool Query(bool forUpdate = FALSE, bool distinct = FALSE); + virtual bool Query(bool forUpdate = false, bool distinct = false); bool QueryBySqlStmt(const wxString &pSqlStmt); - bool QueryMatching(bool forUpdate = FALSE, bool distinct = FALSE); - bool QueryOnKeyFields(bool forUpdate = FALSE, bool distinct = FALSE); + bool QueryMatching(bool forUpdate = false, bool distinct = false); + bool QueryOnKeyFields(bool forUpdate = false, bool distinct = false); bool Refresh(void); bool GetNext(void) { return(getRec(SQL_FETCH_NEXT)); } bool operator++(int) { return(getRec(SQL_FETCH_NEXT)); } @@ -265,8 +265,8 @@ public: void BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxString &pWhereClause=wxEmptyString); void BuildUpdateStmt(wxChar *pSqlStmt, int typeOfUpd, const wxString &pWhereClause=wxEmptyString); - void BuildWhereClause(wxString &pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=FALSE); - void BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=FALSE); + void BuildWhereClause(wxString &pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=false); + void BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=false); #if wxODBC_BACKWARD_COMPATABILITY // The following member functions are deprecated. You should use the BuildXxxxxStmt functions (above) @@ -276,43 +276,43 @@ public: { BuildDeleteStmt(pSqlStmt,typeOfDel,pWhereClause); } void GetUpdateStmt(char *pSqlStmt, int typeOfUpd, const char *pWhereClause = NULL) { BuildUpdateStmt(pSqlStmt,typeOfUpd,pWhereClause); } - void GetWhereClause(char *pWhereClause, int typeOfWhere, - const char *qualTableName = NULL, bool useLikeComparison=FALSE) + void GetWhereClause(char *pWhereClause, int typeOfWhere, + const char *qualTableName = NULL, bool useLikeComparison=false) { BuildWhereClause(pWhereClause,typeOfWhere,qualTableName,useLikeComparison); } #endif bool CanSelectForUpdate(void); bool CanUpdByROWID(void); - void ClearMemberVar(UWORD colNo, bool setToNull=FALSE); - void ClearMemberVars(bool setToNull=FALSE); + void ClearMemberVar(UWORD colNo, bool setToNull=false); + void ClearMemberVars(bool setToNull=false); bool SetQueryTimeout(UDWORD nSeconds); wxDbColDef *GetColDefs() { return colDefs; } - void SetColDefs(UWORD index, const wxString &fieldName, int dataType, + void SetColDefs(UWORD index, const wxString &fieldName, int dataType, void *pData, SWORD cType, - int size, bool keyField = FALSE, bool upd = TRUE, - bool insAllow = TRUE, bool derivedCol = FALSE); + int size, bool keyField = false, bool upd = true, + bool insAllow = true, bool derivedCol = false); wxDbColDataPtr *SetColDefs(wxDbColInf *colInfs, UWORD numCols); bool CloseCursor(HSTMT cursor); bool DeleteCursor(HSTMT *hstmtDel); void SetCursor(HSTMT *hstmtActivate = (void **) wxDB_DEFAULT_CURSOR); HSTMT GetCursor(void) { return(hstmt); } - HSTMT *GetNewCursor(bool setCursor = FALSE, bool bindColumns = TRUE); + HSTMT *GetNewCursor(bool setCursor = false, bool bindColumns = true); #if wxODBC_BACKWARD_COMPATABILITY // The following member function is deprecated. You should use the GetNewCursor - HSTMT *NewCursor(bool setCursor = FALSE, bool bindColumns = TRUE) { return GetNewCursor(setCursor,bindColumns); } + HSTMT *NewCursor(bool setCursor = false, bool bindColumns = true) { return GetNewCursor(setCursor,bindColumns); } #endif ULONG Count(const wxString &args=_T("*")); int DB_STATUS(void) { return(pDb->DB_STATUS); } bool IsColNull(UWORD colNo) const; - bool SetColNull(UWORD colNo, bool set=TRUE); - bool SetColNull(const wxString &colName, bool set=TRUE); + bool SetColNull(UWORD colNo, bool set=true); + bool SetColNull(const wxString &colName, bool set=true); #if wxODBC_BACKWARD_COMPATABILITY // The following member functions are deprecated. You should use the SetColNull() - bool SetNull(int colNo, bool set=TRUE) { return (SetNull(colNo,set)); } - bool SetNull(const char *colName, bool set=TRUE) { return (SetNull(colName,set)); } + bool SetNull(int colNo, bool set=true) { return (SetNull(colNo,set)); } + bool SetNull(const char *colName, bool set=true) { return (SetNull(colName,set)); } #endif #ifdef __WXDEBUG__ ULONG GetTableID() { return tableID; } @@ -334,7 +334,7 @@ public: // typedef enum {unmodified=0, UpdatePending, InsertPending } recStatus; // recStatus get_ModifiedStatus() { return m_recstatus; } - + // void modify() { // if (m_recstatus==unmodified) // m_recstatus=UpdatePending; diff --git a/include/wx/dc.h b/include/wx/dc.h index 24899df0a0..cf1b3fdcbc 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -39,7 +39,7 @@ class WXDLLEXPORT wxDrawObject public: wxDrawObject() - : m_isBBoxValid(FALSE) + : m_isBBoxValid(false) , m_minX(0), m_minY(0), m_maxX(0), m_maxY(0) { } @@ -58,7 +58,7 @@ public: } else { - m_isBBoxValid = TRUE; + m_isBBoxValid = true; m_minX = x; m_minY = y; @@ -69,7 +69,7 @@ public: void ResetBoundingBox() { - m_isBBoxValid = FALSE; + m_isBBoxValid = false; m_minX = m_maxX = m_minY = m_maxY = 0; } @@ -106,10 +106,10 @@ class WXDLLEXPORT wxDCBase : public wxObject public: wxDCBase() : m_colour(wxColourDisplay()) - , m_ok(TRUE) - , m_clipping(FALSE) + , m_ok(true) + , m_clipping(false) , m_isInteractive(0) - , m_isBBoxValid(FALSE) + , m_isBBoxValid(false) , m_logicalOriginX(0), m_logicalOriginY(0) , m_deviceOriginX(0), m_deviceOriginY(0) , m_logicalScaleX(1.0), m_logicalScaleY(1.0) @@ -129,7 +129,7 @@ public: , m_font() #if wxUSE_PALETTE , m_palette() - , m_hasCustomPalette(FALSE) + , m_hasCustomPalette(false) #endif // wxUSE_PALETTE { ResetBoundingBox(); @@ -251,10 +251,10 @@ public: { DoDrawIcon(icon, pt.x, pt.y); } void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = FALSE) + bool useMask = false) { DoDrawBitmap(bmp, x, y, useMask); } void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, - bool useMask = FALSE) + bool useMask = false) { DoDrawBitmap(bmp, pt.x, pt.y, useMask); } void DrawText(const wxString& text, wxCoord x, wxCoord y) @@ -285,14 +285,14 @@ public: bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1) + int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) { return DoBlit(xdest, ydest, width, height, source, xsrc, ysrc, rop, useMask, xsrcMask, ysrcMask); } bool Blit(const wxPoint& destPt, const wxSize& sz, wxDC *source, const wxPoint& srcPt, - int rop = wxCOPY, bool useMask = FALSE, const wxPoint& srcPtMask = wxPoint(-1, -1)) + int rop = wxCOPY, bool useMask = false, const wxPoint& srcPtMask = wxDefaultPosition) { return DoBlit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y); @@ -361,7 +361,7 @@ public: virtual void Clear() = 0; - virtual bool StartDoc(const wxString& WXUNUSED(message)) { return TRUE; } + virtual bool StartDoc(const wxString& WXUNUSED(message)) { return true; } virtual void EndDoc() { } virtual void StartPage() { } @@ -538,7 +538,7 @@ public: // // FIXME: is this (still) used? virtual void SetOptimization(bool WXUNUSED(opt)) { } - virtual bool GetOptimization() { return FALSE; } + virtual bool GetOptimization() { return false; } // bounding box // ------------ @@ -554,7 +554,7 @@ public: } else { - m_isBBoxValid = TRUE; + m_isBBoxValid = true; m_minX = x; m_minY = y; @@ -565,7 +565,7 @@ public: void ResetBoundingBox() { - m_isBBoxValid = FALSE; + m_isBBoxValid = false; m_minX = m_maxX = m_minY = m_maxY = 0; } @@ -658,7 +658,7 @@ protected: virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) = 0; virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = FALSE) = 0; + bool useMask = false) = 0; virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) = 0; virtual void DoDrawRotatedText(const wxString& text, @@ -667,7 +667,7 @@ protected: virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1) = 0; + int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) = 0; virtual void DoGetSize(int *width, int *height) const = 0; virtual void DoGetSizeMM(int* width, int* height) const = 0; diff --git a/include/wx/dcbuffer.h b/include/wx/dcbuffer.h index 1b5d728020..b186d30e15 100644 --- a/include/wx/dcbuffer.h +++ b/include/wx/dcbuffer.h @@ -124,7 +124,7 @@ public: : m_paintdc(window) { window->PrepareDC( m_paintdc ); - + if( buffer != wxNullBitmap ) Init(&m_paintdc, buffer); else diff --git a/include/wx/dcmirror.h b/include/wx/dcmirror.h index c9a200c6de..5c6cfaa7a0 100644 --- a/include/wx/dcmirror.h +++ b/include/wx/dcmirror.h @@ -137,7 +137,7 @@ protected: wxFAIL_MSG( _T("this is probably wrong") ); m_dc.DoDrawArc(GetX(x1, y1), GetY(x1, y1), - GetX(x2, y2), GetY(x2, y2), + GetX(x2, y2), GetY(x2, y2), xc, yc); } @@ -154,7 +154,7 @@ protected: wxFAIL_MSG( _T("this is probably wrong") ); m_dc.DoDrawEllipticArc(GetX(x, y), GetY(x, y), - GetX(w, h), GetY(w, h), + GetX(w, h), GetY(w, h), sa, ea); } @@ -188,7 +188,7 @@ protected: } virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = FALSE) + bool useMask = false) { m_dc.DoDrawBitmap(bmp, GetX(x, y), GetY(x, y), useMask); } @@ -209,8 +209,8 @@ protected: virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord w, wxCoord h, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, - wxCoord xsrcMask = -1, wxCoord ysrcMask = -1) + int rop = wxCOPY, bool useMask = false, + wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) { return m_dc.DoBlit(GetX(xdest, ydest), GetY(xdest, ydest), GetX(w, h), GetY(w, h), diff --git a/include/wx/debug.h b/include/wx/debug.h index f353646e8b..3b8387efb3 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -1,12 +1,12 @@ /** -* Name: wx/debug.h -* Purpose: Misc debug functions and macros -* Author: Vadim Zeitlin +* Name: wx/debug.h +* Purpose: Misc debug functions and macros +* Author: Vadim Zeitlin * Modified by: Ryan Norton (Converted to C) -* Created: 29/01/98 -* RCS-ID: $Id$ -* Copyright: (c) 1998 Vadim Zeitlin -* Licence: wxWindows licence +* Created: 29/01/98 +* RCS-ID: $Id$ +* Copyright: (c) 1998 Vadim Zeitlin +* Licence: wxWindows licence */ /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ @@ -52,7 +52,7 @@ /* */ /* All debugging macros rely on ASSERT() which in turn calls user-defined */ /* OnAssert() function. To keep things simple, it's called even when the */ -/* expression is TRUE (i.e. everything is ok) and by default does nothing: just */ +/* expression is true (i.e. everything is ok) and by default does nothing: just */ /* returns the same value back. But if you redefine it to do something more sexy */ /* (popping up a message box in your favourite GUI, sending you e-mail or */ /* whatever) it will affect all ASSERTs, FAILs and CHECKs in your code. */ @@ -125,7 +125,7 @@ #endif /* __WXDEBUG__ */ #ifdef __cplusplus - /* Use of wxFalse instead of FALSE suppresses compiler warnings about testing */ + /* Use of wxFalse instead of false suppresses compiler warnings about testing */ /* constant expression */ WXDLLIMPEXP_DATA_BASE(extern const bool) wxFalse; #endif diff --git a/include/wx/defs.h b/include/wx/defs.h index f385649ec3..6fc8a46f85 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -696,9 +696,9 @@ typedef wxUint16 wxWord; typedef int wxInt32; typedef unsigned int wxUint32; - #if defined(__MACH__) && !defined(SIZEOF_WCHAR_T) - #define SIZEOF_WCHAR_T 4 - #endif + #if defined(__MACH__) && !defined(SIZEOF_WCHAR_T) + #define SIZEOF_WCHAR_T 4 + #endif #if wxUSE_WCHAR_T && !defined(SIZEOF_WCHAR_T) /* also assume that sizeof(wchar_t) == 2 (under Unix the most */ /* common case is 4 but there configure would have defined */ @@ -1039,7 +1039,7 @@ enum wxStretch wxTILE = 0xc000, // for compatibility only, default now, don't use explicitly any more -#if WXWIN_COMPATIBILITY_2_4 +#if WXWIN_COMPATIBILITY_2_4 wxADJUST_MINSIZE = 0x00100000 #else wxADJUST_MINSIZE = 0 diff --git a/include/wx/dialup.h b/include/wx/dialup.h index 63686fe30e..4cacae44b6 100644 --- a/include/wx/dialup.h +++ b/include/wx/dialup.h @@ -56,7 +56,7 @@ public: static wxDialUpManager *Create(); // could the dialup manager be initialized correctly? If this function - // returns FALSE, no other functions will work neither, so it's a good idea + // returns false, no other functions will work neither, so it's a good idea // to call this function and check its result before calling any other // wxDialUpManager methods virtual bool IsOk() const = 0; @@ -78,20 +78,20 @@ public: // if no username/password are given, the function will try to do without // them, but will ask the user if really needed // - // if async parameter is FALSE, the function waits until the end of dialing - // and returns TRUE upon successful completion. - // if async is TRUE, the function only initiates the connection and returns + // if async parameter is false, the function waits until the end of dialing + // and returns true upon successful completion. + // if async is true, the function only initiates the connection and returns // immediately - the result is reported via events (an event is sent // anyhow, but if dialing failed it will be a DISCONNECTED one) virtual bool Dial(const wxString& nameOfISP = wxEmptyString, const wxString& username = wxEmptyString, const wxString& password = wxEmptyString, - bool async = TRUE) = 0; + bool async = true) = 0; - // returns TRUE if (async) dialing is in progress + // returns true if (async) dialing is in progress virtual bool IsDialing() const = 0; - // cancel dialing the number initiated with Dial(async = TRUE) + // cancel dialing the number initiated with Dial(async = true) // NB: this won't result in DISCONNECTED event being sent virtual bool CancelDialing() = 0; @@ -101,7 +101,7 @@ public: // online status // ------------- - // returns TRUE if the computer has a permanent network connection (i.e. is + // returns true if the computer has a permanent network connection (i.e. is // on a LAN) and so there is no need to use Dial() function to go online // // NB: this functions tries to guess the result and it is not always @@ -109,7 +109,7 @@ public: // confirmation or give him a possibility to override it virtual bool IsAlwaysOnline() const = 0; - // returns TRUE if the computer is connected to the network: under Windows, + // returns true if the computer is connected to the network: under Windows, // this just means that a RAS connection exists, under Unix we check that // the "well-known host" (as specified by SetWellKnownHost) is reachable virtual bool IsOnline() const = 0; @@ -118,7 +118,7 @@ public: // so, in general, the user should be allowed to override it. This function // allows to forcefully set the online status - whatever our internal // algorithm may think about it. - virtual void SetOnlineStatus(bool isOnline = TRUE) = 0; + virtual void SetOnlineStatus(bool isOnline = true) = 0; // set misc wxDialUpManager options // -------------------------------- @@ -129,7 +129,7 @@ public: // Windows, the notification about the change of connection status is // instantenous. // - // Returns FALSE if couldn't set up automatic check for online status. + // Returns false if couldn't set up automatic check for online status. virtual bool EnableAutoCheckOnlineStatus(size_t nSeconds = 60) = 0; // disable automatic check for connection status change - notice that the @@ -192,9 +192,9 @@ typedef void (wxEvtHandler::*wxDialUpEventFunction)(wxDialUpEvent&); // macros to catch dialup events #define EVT_DIALUP_CONNECTED(func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_DIALUP_CONNECTED, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxDialUpEventFunction, & func ), NULL), + DECLARE_EVENT_TABLE_ENTRY( wxEVT_DIALUP_CONNECTED, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxDialUpEventFunction, & func ), NULL), #define EVT_DIALUP_DISCONNECTED(func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_DIALUP_DISCONNECTED, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxDialUpEventFunction, & func ), NULL), + DECLARE_EVENT_TABLE_ENTRY( wxEVT_DIALUP_DISCONNECTED, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxDialUpEventFunction, & func ), NULL), #endif // wxUSE_DIALUP_MANAGER diff --git a/include/wx/dir.h b/include/wx/dir.h index 4a49f7c6bc..e1a525cfc2 100644 --- a/include/wx/dir.h +++ b/include/wx/dir.h @@ -104,7 +104,7 @@ public: // open the directory for enumerating bool Open(const wxString& dir); - // returns TRUE if the directory was successfully opened + // returns true if the directory was successfully opened bool IsOpened() const; // get the full name of the directory (without '/' at the end) @@ -114,7 +114,7 @@ public: // ------------------------- // start enumerating all files matching filespec (or all files if it is - // empty) and flags, return TRUE on success + // empty) and flags, return true on success bool GetFirst(wxString *filename, const wxString& filespec = wxEmptyString, int flags = wxDIR_DEFAULT) const; diff --git a/include/wx/display.h b/include/wx/display.h index e46e596b70..f81a57b18a 100644 --- a/include/wx/display.h +++ b/include/wx/display.h @@ -24,7 +24,7 @@ class WXDLLEXPORT wxWindow; class WXDLLEXPORT wxPoint; class WXDLLEXPORT wxRect; -class WXDLLEXPORT wxString; +class WXDLLEXPORT wxString; WX_DECLARE_EXPORTED_OBJARRAY(wxVideoMode, wxArrayVideoModes); diff --git a/include/wx/dnd.h b/include/wx/dnd.h index 7c4bce111d..3c893f685a 100644 --- a/include/wx/dnd.h +++ b/include/wx/dnd.h @@ -97,9 +97,9 @@ public: virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly) = 0; // override to give feedback depending on the current operation result - // "effect" and return TRUE if you did something, FALSE to let the library + // "effect" and return true if you did something, false to let the library // give the default feedback - virtual bool GiveFeedback(wxDragResult WXUNUSED(effect)) { return FALSE; } + virtual bool GiveFeedback(wxDragResult WXUNUSED(effect)) { return false; } protected: const wxCursor& GetCursor(wxDragResult res) const @@ -177,7 +177,7 @@ public: virtual void OnLeave() { } // this function is called when data is dropped at position (x, y) - if it - // returns TRUE, OnData() will be called immediately afterwards which will + // returns true, OnData() will be called immediately afterwards which will // allow to retrieve the data dropped. virtual bool OnDrop(wxCoord x, wxCoord y) = 0; @@ -189,7 +189,7 @@ public: virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) = 0; // may be called *only* from inside OnData() and will fill m_dataObject - // with the data from the drop source if it returns TRUE + // with the data from the drop source if it returns true virtual bool GetData() = 0; protected: diff --git a/include/wx/docmdi.h b/include/wx/docmdi.h index c8e94f3159..6f7db58da5 100644 --- a/include/wx/docmdi.h +++ b/include/wx/docmdi.h @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DOCMDI_H_ @@ -92,7 +92,7 @@ public: inline void SetDocument(wxDocument *doc) { m_childDocument = doc; } inline void SetView(wxView *view) { m_childView = view; } bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); } - + protected: void Init(); wxDocument* m_childDocument; diff --git a/include/wx/docview.h b/include/wx/docview.h index 94a13b2cc5..2ea29e2bf9 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -72,7 +72,7 @@ public: ~wxDocument(); // accessors - void SetFilename(const wxString& filename, bool notifyViews = FALSE); + void SetFilename(const wxString& filename, bool notifyViews = false); wxString GetFilename() const { return m_documentFile; } void SetTitle(const wxString& title) { m_documentTitle = title; }; @@ -82,7 +82,7 @@ public: wxString GetDocumentName() const { return m_documentTypeName; } bool GetDocumentSaved() const { return m_savedYet; } - void SetDocumentSaved(bool saved = TRUE) { m_savedYet = saved; } + void SetDocumentSaved(bool saved = true) { m_savedYet = saved; } virtual bool Close(); virtual bool Save(); @@ -103,9 +103,9 @@ public: virtual bool OnNewDocument(); virtual bool OnCloseDocument(); - // Prompts for saving if about to close a modified document. Returns TRUE + // Prompts for saving if about to close a modified document. Returns true // if ok to close the document (may have saved in the meantime, or set - // modified to FALSE) + // modified to false) virtual bool OnSaveModified(); // Called by framework if created automatically by the default document @@ -198,12 +198,12 @@ public: // Called by framework if created automatically by the default document // manager class: gives view a chance to initialise - virtual bool OnCreate(wxDocument *WXUNUSED(doc), long WXUNUSED(flags)) { return TRUE; }; + virtual bool OnCreate(wxDocument *WXUNUSED(doc), long WXUNUSED(flags)) { return true; }; // Checks if the view is the last one for the document; if so, asks user // to confirm save data (if modified). If ok, deletes itself and returns - // TRUE. - virtual bool Close(bool deleteWindow = TRUE); + // true. + virtual bool Close(bool deleteWindow = true); // Override to do cleanup/veto close virtual bool OnClose(bool deleteWindow); @@ -317,7 +317,7 @@ private: class WXDLLEXPORT wxDocManager: public wxEvtHandler { public: - wxDocManager(long flags = wxDEFAULT_DOCMAN_FLAGS, bool initialize = TRUE); + wxDocManager(long flags = wxDEFAULT_DOCMAN_FLAGS, bool initialize = true); ~wxDocManager(); virtual bool Initialize(); @@ -363,11 +363,11 @@ public: virtual bool FlushDoc(wxDocument *doc); virtual wxDocTemplate *MatchTemplate(const wxString& path); virtual wxDocTemplate *SelectDocumentPath(wxDocTemplate **templates, - int noTemplates, wxString& path, long flags, bool save = FALSE); + int noTemplates, wxString& path, long flags, bool save = false); virtual wxDocTemplate *SelectDocumentType(wxDocTemplate **templates, - int noTemplates, bool sort = FALSE); + int noTemplates, bool sort = false); virtual wxDocTemplate *SelectViewType(wxDocTemplate **templates, - int noTemplates, bool sort = FALSE); + int noTemplates, bool sort = false); virtual wxDocTemplate *FindTemplateForPath(const wxString& path); void AssociateTemplate(wxDocTemplate *temp); @@ -383,17 +383,17 @@ public: void RemoveDocument(wxDocument *doc); // closes all currently open documents - bool CloseDocuments(bool force = TRUE); + bool CloseDocuments(bool force = true); // closes the specified document - bool CloseDocument(wxDocument* doc, bool force = FALSE); + bool CloseDocument(wxDocument* doc, bool force = false); // Clear remaining documents and templates - bool Clear(bool force = TRUE); + bool Clear(bool force = true); // Views or windows should inform the document manager // when a view is going in or out of focus - virtual void ActivateView(wxView *view, bool activate = TRUE); + virtual void ActivateView(wxView *view, bool activate = true); virtual wxView *GetCurrentView() const; wxList& GetDocuments() { return m_docs; } diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index 79e9a5e7af..0f1751ade0 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -141,7 +141,7 @@ protected: \ T& Item(size_t uiIndex) const \ { wxASSERT( uiIndex < size() ); return (T&)operator[](uiIndex); } \ \ - int Index(T e, bool bFromEnd = FALSE) const; \ + int Index(T e, bool bFromEnd = false) const; \ int Index(T lItem, CMPFUNC fnCompare) const; \ size_t IndexForInsert(T lItem, CMPFUNC fnCompare) const; \ void Add(T lItem, size_t nInsert = 1) \ @@ -189,7 +189,7 @@ protected: \ { wxASSERT( uiIndex < m_nCount ); return m_pItems[uiIndex]; } \ T& operator[](size_t uiIndex) const { return Item(uiIndex); } \ \ - int Index(T lItem, bool bFromEnd = FALSE) const; \ + int Index(T lItem, bool bFromEnd = false) const; \ int Index(T lItem, CMPFUNC fnCompare) const; \ size_t IndexForInsert(T lItem, CMPFUNC fnCompare) const; \ void Add(T lItem, size_t nInsert = 1); \ @@ -293,7 +293,7 @@ public: \ T& Last() const \ { return Item(Count() - 1); } \ \ - int Index(T e, bool bFromEnd = FALSE) const \ + int Index(T e, bool bFromEnd = false) const \ { return base::Index(e, bFromEnd); } \ \ void Add(T Item, size_t nInsert = 1) \ @@ -313,7 +313,7 @@ public: \ } #define _WX_DEFINE_TYPEARRAY_PTR(T, name, base, classexp) \ - _WX_DEFINE_TYPEARRAY(T, name, base, classexp) + _WX_DEFINE_TYPEARRAY(T, name, base, classexp) #else // if !wxUSE_STL @@ -342,7 +342,7 @@ public: \ T& Last() const \ { return (T&)(base::operator[](Count() - 1)); } \ \ - int Index(T Item, bool bFromEnd = FALSE) const \ + int Index(T Item, bool bFromEnd = false) const \ { return base::Index((base_type)Item, bFromEnd); } \ \ void Add(T Item, size_t nInsert = 1) \ @@ -575,7 +575,7 @@ public: \ T& Last() const \ { return *(T*)(base::operator[](size() - 1)); } \ \ - int Index(const T& Item, bool bFromEnd = FALSE) const; \ + int Index(const T& Item, bool bFromEnd = false) const; \ \ void Add(const T& Item, size_t nInsert = 1); \ void Add(const T* pItem) \ @@ -789,7 +789,7 @@ private: \ #define WX_DECLARE_OBJARRAY_WITH_DECL(T, name, decl) \ typedef T _wxObjArray##name; \ _WX_DECLARE_OBJARRAY(_wxObjArray##name, name, wxArrayPtrVoid, decl) - + #define WX_DECLARE_USER_EXPORTED_OBJARRAY(T, name, expmode) \ WX_DECLARE_OBJARRAY_WITH_DECL(T, name, class expmode) diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h index 1bdf32c860..03da571c63 100644 --- a/include/wx/dynlib.h +++ b/include/wx/dynlib.h @@ -131,7 +131,7 @@ public: // to use it polymorphically. ~wxDynamicLibrary() { Unload(); } - // return TRUE if the library was loaded successfully + // return true if the library was loaded successfully bool IsLoaded() const { return m_handle != 0; } // load the library with the given name (full or not), return true if ok @@ -220,11 +220,11 @@ public: which case the library is searched for in all standard locations (use GetDllExt() to construct the filename) - if success pointer is not NULL, it will be filled with TRUE if everything - went ok and FALSE otherwise + if success pointer is not NULL, it will be filled with true if everything + went ok and false otherwise */ static wxDllType LoadLibrary(const wxString& name, bool *success = NULL); - + /* This function unloads the shared library previously loaded with LoadLibrary diff --git a/src/common/datacmn.cpp b/src/common/datacmn.cpp index b74d729ffa..d2b5ba4544 100644 --- a/src/common/datacmn.cpp +++ b/src/common/datacmn.cpp @@ -155,6 +155,6 @@ WXDLLEXPORT_DATA(const wxChar *) wxUserResourceStr = wxT("TEXT"); #endif -const wxSize wxDefaultSize(-1, -1); -const wxPoint wxDefaultPosition(-1, -1); +const wxSize wxDefaultSize(wxDefaultCoord, wxDefaultCoord); +const wxPoint wxDefaultPosition(wxDefaultCoord, wxDefaultCoord); diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 3ac780395f..7828abd182 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -171,7 +171,7 @@ public: { wxDateTimeHolidayAuthority::AddAuthority(new wxDateTimeWorkDays); - return TRUE; + return true; } virtual void OnExit() @@ -275,8 +275,8 @@ wxDateTime::wxDateTime_t GetNumOfDaysInMonth(int year, wxDateTime::Month month) static int GetTimeZone() { #ifdef WX_GMTOFF_IN_TM - // set to TRUE when the timezone is set - static bool s_timezoneSet = FALSE; + // set to true when the timezone is set + static bool s_timezoneSet = false; static long gmtoffset = LONG_MAX; // invalid timezone // ensure that the timezone variable is set by calling localtime @@ -288,7 +288,7 @@ static int GetTimeZone() struct tm *tm; tm = localtime(&t); - s_timezoneSet = TRUE; + s_timezoneSet = true; // note that GMT offset is the opposite of time zone and so to return // consistent results in both WX_GMTOFF_IN_TM and !WX_GMTOFF_IN_TM @@ -500,7 +500,7 @@ static bool GetNumericToken(size_t len, const wxChar*& p, unsigned long *number) break; } - return !!s && s.ToULong(number); + return !s.IsEmpty() && s.ToULong(number); } // scans all alphabetic characters and returns the resulting string @@ -691,7 +691,7 @@ bool wxDateTime::IsLeapYear(int year, wxDateTime::Calendar cal) { wxFAIL_MSG(_T("unknown calendar")); - return FALSE; + return false; } } @@ -1002,7 +1002,7 @@ wxDateTime wxDateTime::GetBeginDST(int year, Country country) dt += wxTimeSpan::Hours(1); // disable DST tests because it could result in an infinite recursion! - dt.MakeGMT(TRUE); + dt.MakeGMT(true); } else switch ( country ) { @@ -1103,7 +1103,7 @@ wxDateTime wxDateTime::GetEndDST(int year, Country country) dt += wxTimeSpan::Hours(1); // disable DST tests because it could result in an infinite recursion! - dt.MakeGMT(TRUE); + dt.MakeGMT(true); } else switch ( country ) { @@ -1662,10 +1662,10 @@ bool wxDateTime::SetToTheWeek(wxDateTime_t numWeek, if ( GetYear() != year ) { // oops... numWeek was too big - return FALSE; + return false; } - return TRUE; + return true; } wxDateTime& wxDateTime::SetToLastMonthDay(Month month, @@ -1770,9 +1770,9 @@ bool wxDateTime::SetToWeekDay(WeekDay weekday, Month month, int year) { - wxCHECK_MSG( weekday != Inv_WeekDay, FALSE, _T("invalid weekday") ); + wxCHECK_MSG( weekday != Inv_WeekDay, false, _T("invalid weekday") ); - // we don't check explicitly that -5 <= n <= 5 because we will return FALSE + // we don't check explicitly that -5 <= n <= 5 because we will return false // anyhow in such case - but may be should still give an assert for it? // take the current month/year if none specified @@ -1824,12 +1824,12 @@ bool wxDateTime::SetToWeekDay(WeekDay weekday, { *this = dt; - return TRUE; + return true; } else { // no such day in this month - return FALSE; + return false; } } @@ -2087,17 +2087,17 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const fmt = _T("%02d"); } - bool restart = TRUE; + bool restart = true; while ( restart ) { - restart = FALSE; + restart = false; // start of the format specification switch ( *p ) { case _T('a'): // a weekday name case _T('A'): - // second parameter should be TRUE for abbreviated names + // second parameter should be true for abbreviated names res += GetWeekDayName(tm.GetWeekDay(), *p == _T('a') ? Name_Abbr : Name_Full); break; @@ -2328,7 +2328,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const fmt.Prepend(_T('%')); fmt.Append(_T('d')); - restart = TRUE; + restart = true; break; } @@ -2661,17 +2661,17 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, unsigned long num; // what fields have we found? - bool haveWDay = FALSE, - haveYDay = FALSE, - haveDay = FALSE, - haveMon = FALSE, - haveYear = FALSE, - haveHour = FALSE, - haveMin = FALSE, - haveSec = FALSE; - - bool hourIsIn12hFormat = FALSE, // or in 24h one? - isPM = FALSE; // AM by default + bool haveWDay = false, + haveYDay = false, + haveDay = false, + haveMon = false, + haveYear = false, + haveHour = false, + haveMin = false, + haveSec = false; + + bool hourIsIn12hFormat = false, // or in 24h one? + isPM = false; // AM by default // and the value of the items we have (init them to get rid of warnings) wxDateTime_t sec = 0, @@ -2760,7 +2760,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } } - haveWDay = TRUE; + haveWDay = true; break; case _T('b'): // a month name @@ -2774,7 +2774,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } } - haveMon = TRUE; + haveMon = true; break; case _T('c'): // locale default date and time representation @@ -2805,7 +2805,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, Tm tm = dt.GetTm(); haveDay = haveMon = haveYear = - haveHour = haveMin = haveSec = TRUE; + haveHour = haveMin = haveSec = true; hour = tm.hour; min = tm.min; @@ -2829,7 +2829,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, // we can't check whether the day range is correct yet, will // do it later - assume ok for now - haveDay = TRUE; + haveDay = true; mday = (wxDateTime_t)num; break; @@ -2840,7 +2840,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveHour = TRUE; + haveHour = true; hour = (wxDateTime_t)num; break; @@ -2851,8 +2851,8 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveHour = TRUE; - hourIsIn12hFormat = TRUE; + haveHour = true; + hourIsIn12hFormat = true; hour = (wxDateTime_t)(num % 12); // 12 should be 0 break; @@ -2863,7 +2863,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveYDay = TRUE; + haveYDay = true; yday = (wxDateTime_t)num; break; @@ -2874,7 +2874,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveMon = TRUE; + haveMon = true; mon = (Month)(num - 1); break; @@ -2885,7 +2885,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveMin = TRUE; + haveMin = true; min = (wxDateTime_t)num; break; @@ -2898,7 +2898,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; // no am/pm strings defined if ( token.CmpNoCase(pm) == 0 ) { - isPM = TRUE; + isPM = true; } else if ( token.CmpNoCase(am) != 0 ) { @@ -2918,7 +2918,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveHour = haveMin = haveSec = TRUE; + haveHour = haveMin = haveSec = true; Tm tm = dt.GetTm(); hour = tm.hour; @@ -2937,7 +2937,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveHour = haveMin = TRUE; + haveHour = haveMin = true; Tm tm = dt.GetTm(); hour = tm.hour; @@ -2951,7 +2951,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveSec = TRUE; + haveSec = true; sec = (wxDateTime_t)num; break; @@ -2965,7 +2965,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveHour = haveMin = haveSec = TRUE; + haveHour = haveMin = haveSec = true; Tm tm = dt.GetTm(); hour = tm.hour; @@ -2981,7 +2981,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveWDay = TRUE; + haveWDay = true; wday = (WeekDay)num; break; @@ -2998,7 +2998,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, { input = result; - haveDay = haveMon = haveYear = TRUE; + haveDay = haveMon = haveYear = true; year = 1900 + tm.tm_year; mon = (Month)tm.tm_mon; @@ -3042,7 +3042,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, Tm tm = dt.GetTm(); - haveDay = haveMon = haveYear = TRUE; + haveDay = haveMon = haveYear = true; year = tm.year; mon = tm.mon; @@ -3064,7 +3064,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveHour = haveMin = haveSec = TRUE; + haveHour = haveMin = haveSec = true; hour = tm.tm_hour; min = tm.tm_min; @@ -3092,7 +3092,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveHour = haveMin = haveSec = TRUE; + haveHour = haveMin = haveSec = true; Tm tm = dt.GetTm(); hour = tm.hour; @@ -3111,7 +3111,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveYear = TRUE; + haveYear = true; // TODO should have an option for roll over date instead of // hard coding it here @@ -3125,7 +3125,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, return (wxChar *)NULL; } - haveYear = TRUE; + haveYear = true; year = (wxDateTime_t)num; break; @@ -3342,10 +3342,10 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) // have the ability to back track. // what do we have? - bool haveDay = FALSE, // the months day? - haveWDay = FALSE, // the day of week? - haveMon = FALSE, // the month? - haveYear = FALSE; // the year? + bool haveDay = false, // the months day? + haveWDay = false, // the day of week? + haveMon = false, // the month? + haveYear = false; // the year? // and the value of the items we have (init them to get rid of warnings) WeekDay wday = Inv_WeekDay; @@ -3369,21 +3369,21 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) { // guess what this number is - bool isDay = FALSE, - isMonth = FALSE, - isYear = FALSE; + bool isDay = false, + isMonth = false, + isYear = false; if ( !haveMon && val > 0 && val <= 12 ) { // assume it is month - isMonth = TRUE; + isMonth = true; } else // not the month { if ( haveDay ) { // this can only be the year - isYear = TRUE; + isYear = true; } else // may be either day or year { @@ -3395,11 +3395,11 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) if ( (val == 0) || (val > (unsigned long)maxDays) ) { // no - isYear = TRUE; + isYear = true; } else // yes, suppose it's the day { - isDay = TRUE; + isDay = true; } } } @@ -3409,7 +3409,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) if ( haveYear ) break; - haveYear = TRUE; + haveYear = true; year = (wxDateTime_t)val; } @@ -3418,13 +3418,13 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) if ( haveDay ) break; - haveDay = TRUE; + haveDay = true; day = (wxDateTime_t)val; } else if ( isMonth ) { - haveMon = TRUE; + haveMon = true; mon = (Month)(val - 1); } @@ -3444,7 +3444,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) // no need to check in month range as always < 12, but // the days are counted from 1 unlike the months day = (wxDateTime_t)mon + 1; - haveDay = TRUE; + haveDay = true; } else { @@ -3456,7 +3456,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) mon = mon2; - haveMon = TRUE; + haveMon = true; } else // not a valid month name { @@ -3469,7 +3469,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) break; } - haveWDay = TRUE; + haveWDay = true; } else // not a valid weekday name { @@ -3524,7 +3524,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) break; } - haveDay = TRUE; + haveDay = true; day = (wxDateTime_t)(n + 1); } @@ -3567,10 +3567,10 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) { day = year; - haveMon = TRUE; - haveYear = FALSE; + haveMon = true; + haveYear = false; } - //else: no, can't exchange, leave haveMon == FALSE + //else: no, can't exchange, leave haveMon == false } } @@ -3910,11 +3910,11 @@ bool wxDateTimeHolidayAuthority::IsHoliday(const wxDateTime& dt) { if ( ms_authorities[n]->DoIsHoliday(dt) ) { - return TRUE; + return true; } } - return FALSE; + return false; } /* static */ diff --git a/src/common/datstrm.cpp b/src/common/datstrm.cpp index 1580055ca7..f64aafbbba 100644 --- a/src/common/datstrm.cpp +++ b/src/common/datstrm.cpp @@ -6,7 +6,7 @@ // Created: 28/06/98 // RCS-ID: $Id$ // Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) @@ -30,10 +30,10 @@ #if wxUSE_UNICODE wxDataInputStream::wxDataInputStream(wxInputStream& s, wxMBConv& conv) - : m_input(&s), m_be_order(FALSE), m_conv(conv) + : m_input(&s), m_be_order(false), m_conv(conv) #else wxDataInputStream::wxDataInputStream(wxInputStream& s) - : m_input(&s), m_be_order(FALSE) + : m_input(&s), m_be_order(false) #endif { } @@ -269,10 +269,10 @@ wxDataInputStream& wxDataInputStream::operator>>(float& f) #if wxUSE_UNICODE wxDataOutputStream::wxDataOutputStream(wxOutputStream& s, wxMBConv& conv) - : m_output(&s), m_be_order(FALSE), m_conv(conv) + : m_output(&s), m_be_order(false), m_conv(conv) #else wxDataOutputStream::wxDataOutputStream(wxOutputStream& s) - : m_output(&s), m_be_order(FALSE) + : m_output(&s), m_be_order(false) #endif { } diff --git a/src/common/db.cpp b/src/common/db.cpp index 950ace5032..332172031f 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -106,7 +106,7 @@ typedef struct wxDbConnectInf::wxDbConnectInf() { Henv = 0; - freeHenvOnDestroy = FALSE; + freeHenvOnDestroy = false; Initialize(); } // Constructor @@ -118,7 +118,7 @@ wxDbConnectInf::wxDbConnectInf(HENV henv, const wxString &dsn, const wxString &u const wxString &fileType, const wxString &description) { Henv = 0; - freeHenvOnDestroy = FALSE; + freeHenvOnDestroy = false; Initialize(); @@ -149,7 +149,7 @@ wxDbConnectInf::~wxDbConnectInf() /********** wxDbConnectInf::Initialize() **********/ bool wxDbConnectInf::Initialize() { - freeHenvOnDestroy = FALSE; + freeHenvOnDestroy = false; if (freeHenvOnDestroy && Henv) FreeHenv(); @@ -163,9 +163,9 @@ bool wxDbConnectInf::Initialize() FileType.Empty(); DefaultDir.Empty(); - useConnectionStr = FALSE; + useConnectionStr = false; - return TRUE; + return true; } // wxDbConnectInf::Initialize() @@ -180,12 +180,12 @@ bool wxDbConnectInf::AllocHenv() if (SQLAllocEnv(&Henv) != SQL_SUCCESS) { wxLogDebug(wxT("A problem occured while trying to get a connection to the data source")); - return FALSE; + return false; } - freeHenvOnDestroy = TRUE; + freeHenvOnDestroy = true; - return TRUE; + return true; } // wxDbConnectInf::AllocHenv() @@ -197,7 +197,7 @@ void wxDbConnectInf::FreeHenv() SQLFreeEnv(Henv); Henv = 0; - freeHenvOnDestroy = FALSE; + freeHenvOnDestroy = false; } // wxDbConnectInf::FreeHenv() @@ -227,7 +227,7 @@ void wxDbConnectInf::SetPassword(const wxString &password) void wxDbConnectInf::SetConnectionStr(const wxString &connectStr) { wxASSERT(connectStr.Length() < sizeof(ConnectionStr)); - + useConnectionStr = wxStrlen(connectStr) > 0; wxStrcpy(ConnectionStr, connectStr); @@ -393,7 +393,7 @@ bool wxDbColInf::Initialize() FkTableName[0] = 0; pColFor = NULL; - return TRUE; + return true; } // wxDbColInf::Initialize() @@ -421,7 +421,7 @@ bool wxDbTableInf::Initialize() numCols = 0; pColInf = NULL; - return TRUE; + return true; } // wxDbTableInf::Initialize() @@ -449,7 +449,7 @@ bool wxDbInf::Initialize() numTables = 0; pTableInf = NULL; - return TRUE; + return true; } // wxDbInf::Initialize() @@ -530,7 +530,7 @@ void wxDb::initialize() typeInfBlob.MaximumScale = 0; // Error reporting is turned OFF by default - silent = TRUE; + silent = true; // Allocate a data source connection handle if (SQLAllocConnect(henv, &hdbc) != SQL_SUCCESS) @@ -540,9 +540,9 @@ void wxDb::initialize() DB_STATUS = 0; // Mark database as not open as of yet - dbIsOpen = FALSE; - dbIsCached = FALSE; - dbOpenedWithConnectionString = FALSE; + dbIsOpen = false; + dbIsCached = false; + dbOpenedWithConnectionString = false; } // wxDb::initialize() @@ -589,7 +589,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported) */ // Mark database as open - dbIsOpen = TRUE; + dbIsOpen = true; // Allocate a statement handle for the database connection if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS) @@ -597,11 +597,11 @@ bool wxDb::open(bool failOnDataTypeUnsupported) // Set Connection Options if (!setConnectionOptions()) - return(FALSE); + return false; // Query the data source for inf. about itself if (!getDbInfo(failOnDataTypeUnsupported)) - return(FALSE); + return false; // Query the data source regarding data type information @@ -647,7 +647,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported) // VARCHAR = Variable length character string if (!getDataTypeInfo(SQL_VARCHAR, typeInfVarchar)) if (!getDataTypeInfo(SQL_CHAR, typeInfVarchar)) - return(FALSE); + return false; else typeInfVarchar.FsqlType = SQL_CHAR; else @@ -661,7 +661,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported) if (!getDataTypeInfo(SQL_NUMERIC,typeInfFloat)) { if (failOnDataTypeUnsupported) - return(FALSE); + return false; } else typeInfFloat.FsqlType = SQL_NUMERIC; @@ -682,7 +682,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported) if (!getDataTypeInfo(typeInfFloat.FsqlType, typeInfInteger)) { if (failOnDataTypeUnsupported) - return(FALSE); + return false; } else typeInfInteger.FsqlType = typeInfFloat.FsqlType; @@ -704,7 +704,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported) #endif // SQL_DATETIME defined { if (failOnDataTypeUnsupported) - return(FALSE); + return false; } } else @@ -719,7 +719,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported) if (!getDataTypeInfo(SQL_VARBINARY,typeInfBlob)) { if (failOnDataTypeUnsupported) - return(FALSE); + return false; } else typeInfBlob.FsqlType = SQL_VARBINARY; @@ -738,7 +738,7 @@ bool wxDb::open(bool failOnDataTypeUnsupported) #endif // Completed Successfully - return(TRUE); + return true; } bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported) @@ -782,7 +782,7 @@ bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported) outConnectBuffer[outConnectBufferLen] = 0; outConnectionStr = outConnectBuffer; - dbOpenedWithConnectionString = TRUE; + dbOpenedWithConnectionString = true; return open(failOnDataTypeUnsupported); } @@ -887,7 +887,7 @@ bool wxDb::Open(wxDb *copyDb) outConnectBuffer[outConnectBufferLen] = 0; outConnectionStr = outConnectBuffer; - dbOpenedWithConnectionString = TRUE; + dbOpenedWithConnectionString = true; } else { @@ -910,7 +910,7 @@ bool wxDb::Open(wxDb *copyDb) */ // Mark database as open - dbIsOpen = TRUE; + dbIsOpen = true; // Allocate a statement handle for the database connection if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS) @@ -918,7 +918,7 @@ bool wxDb::Open(wxDb *copyDb) // Set Connection Options if (!setConnectionOptions()) - return(FALSE); + return false; // Instead of Querying the data source for info about itself, it can just be copied // from the wxDb instance that was passed in (copyDb). @@ -999,7 +999,7 @@ bool wxDb::Open(wxDb *copyDb) #endif // Completed Successfully - return(TRUE); + return true; } // wxDb::Open() 2 @@ -1066,7 +1066,7 @@ bool wxDb::setConnectionOptions(void) #endif // Completed Successfully - return(TRUE); + return true; } // wxDb::setConnectionOptions() @@ -1079,256 +1079,256 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported) retcode = SQLGetInfo(hdbc, SQL_SERVER_NAME, (UCHAR*) dbInf.serverName, 80, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_DATABASE_NAME, (UCHAR*) dbInf.databaseName, 128, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_DBMS_NAME, (UCHAR*) dbInf.dbmsName, 40, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } // 16-Mar-1999 // After upgrading to MSVC6, the original 20 char buffer below was insufficient, // causing database connectivity to fail in some cases. retcode = SQLGetInfo(hdbc, SQL_DBMS_VER, (UCHAR*) dbInf.dbmsVer, 64, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_ACTIVE_CONNECTIONS, (UCHAR*) &dbInf.maxConnections, sizeof(dbInf.maxConnections), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_ACTIVE_STATEMENTS, (UCHAR*) &dbInf.maxStmts, sizeof(dbInf.maxStmts), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_DRIVER_NAME, (UCHAR*) dbInf.driverName, 40, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_DRIVER_ODBC_VER, (UCHAR*) dbInf.odbcVer, 60, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_ODBC_VER, (UCHAR*) dbInf.drvMgrOdbcVer, 60, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_DRIVER_VER, (UCHAR*) dbInf.driverVer, 60, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_ODBC_API_CONFORMANCE, (UCHAR*) &dbInf.apiConfLvl, sizeof(dbInf.apiConfLvl), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_ODBC_SAG_CLI_CONFORMANCE, (UCHAR*) &dbInf.cliConfLvl, sizeof(dbInf.cliConfLvl), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) { // Not all drivers support this call - Nick Gorham(unixODBC) dbInf.cliConfLvl = 0; - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; } retcode = SQLGetInfo(hdbc, SQL_ODBC_SQL_CONFORMANCE, (UCHAR*) &dbInf.sqlConfLvl, sizeof(dbInf.sqlConfLvl), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_OUTER_JOINS, (UCHAR*) dbInf.outerJoins, 2, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_PROCEDURES, (UCHAR*) dbInf.procedureSupport, 2, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_ACCESSIBLE_TABLES, (UCHAR*) dbInf.accessibleTables, 2, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_CURSOR_COMMIT_BEHAVIOR, (UCHAR*) &dbInf.cursorCommitBehavior, sizeof(dbInf.cursorCommitBehavior), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_CURSOR_ROLLBACK_BEHAVIOR, (UCHAR*) &dbInf.cursorRollbackBehavior, sizeof(dbInf.cursorRollbackBehavior), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_NON_NULLABLE_COLUMNS, (UCHAR*) &dbInf.supportNotNullClause, sizeof(dbInf.supportNotNullClause), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_ODBC_SQL_OPT_IEF, (UCHAR*) dbInf.supportIEF, 2, &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, (UCHAR*) &dbInf.txnIsolation, sizeof(dbInf.txnIsolation), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_TXN_ISOLATION_OPTION, (UCHAR*) &dbInf.txnIsolationOptions, sizeof(dbInf.txnIsolationOptions), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_FETCH_DIRECTION, (UCHAR*) &dbInf.fetchDirections, sizeof(dbInf.fetchDirections), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_LOCK_TYPES, (UCHAR*) &dbInf.lockTypes, sizeof(dbInf.lockTypes), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_POS_OPERATIONS, (UCHAR*) &dbInf.posOperations, sizeof(dbInf.posOperations), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_POSITIONED_STATEMENTS, (UCHAR*) &dbInf.posStmts, sizeof(dbInf.posStmts), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_SCROLL_CONCURRENCY, (UCHAR*) &dbInf.scrollConcurrency, sizeof(dbInf.scrollConcurrency), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_SCROLL_OPTIONS, (UCHAR*) &dbInf.scrollOptions, sizeof(dbInf.scrollOptions), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_STATIC_SENSITIVITY, (UCHAR*) &dbInf.staticSensitivity, sizeof(dbInf.staticSensitivity), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_TXN_CAPABLE, (UCHAR*) &dbInf.txnCapable, sizeof(dbInf.txnCapable), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } retcode = SQLGetInfo(hdbc, SQL_LOGIN_TIMEOUT, (UCHAR*) &dbInf.loginTimeout, sizeof(dbInf.loginTimeout), &cb); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return FALSE; - } + { + DispAllErrors(henv, hdbc); + if (failOnDataTypeUnsupported) + return false; + } #ifdef DBDEBUG_CONSOLE cout << wxT("***** DATA SOURCE INFORMATION *****") << endl; @@ -1526,7 +1526,7 @@ bool wxDb::getDbInfo(bool failOnDataTypeUnsupported) #endif // Completed Successfully - return(TRUE); + return true; } // wxDb::getDbInfo() @@ -1557,7 +1557,7 @@ bool wxDb::getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo) #endif DispAllErrors(henv, hdbc, hstmt); SQLFreeStmt(hstmt, SQL_CLOSE); - return(FALSE); + return false; } wxChar typeName[DB_TYPE_NAME_LEN+1]; @@ -1614,7 +1614,7 @@ bool wxDb::getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo) return(DispAllErrors(henv, hdbc, hstmt)); // Completed Successfully - return(TRUE); + return true; } // wxDb::getDataTypeInfo() @@ -1671,7 +1671,7 @@ void wxDb::Close(void) wxStrcpy(DBerrorList[i], errorList[i]); dbmsType = dbmsUNIDENTIFIED; - dbIsOpen = FALSE; + dbIsOpen = false; } // wxDb::Close() @@ -1687,7 +1687,7 @@ bool wxDb::CommitTrans(void) } // Completed successfully - return(TRUE); + return true; } // wxDb::CommitTrans() @@ -1700,7 +1700,7 @@ bool wxDb::RollbackTrans(void) return(DispAllErrors(henv, hdbc)); // Completed successfully - return(TRUE); + return true; } // wxDb::RollbackTrans() @@ -1717,7 +1717,7 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) * If in DBDEBUG_CONSOLE mode, the constructed string will be displayed in the console * window and program execution will be paused until the user presses a key. * - * This function always returns a FALSE, so that functions which call this function + * This function always returns a false, so that functions which call this function * can have a line like "return (DispAllErrors(henv, hdbc));" to indicate the failure * of the users request, so that the calling code can then process the error msg log */ @@ -1743,7 +1743,7 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) } } - return(FALSE); // This function always returns FALSE. + return false; // This function always returns false. } // wxDb::DispAllErrors() @@ -1752,9 +1752,9 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) bool wxDb::GetNextError(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) { if (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS) - return(TRUE); + return true; else - return(FALSE); + return false; } // wxDb::GetNextError() @@ -2061,7 +2061,7 @@ bool wxDb::CreateView(const wxString &viewName, const wxString &colList, // Drop the view first if (attemptDrop && !DropView(viewName)) - return FALSE; + return false; // Build the create view statement sqlStmt = wxT("CREATE VIEW "); @@ -2092,7 +2092,7 @@ bool wxDb::CreateView(const wxString &viewName, const wxString &colList, bool wxDb::DropView(const wxString &viewName) { /* - * NOTE: This function returns TRUE if the View does not exist, but + * NOTE: This function returns true if the View does not exist, but * only for identified databases. Code will need to be added * below for any other databases when those databases are defined * to handle this situation consistently @@ -2119,16 +2119,16 @@ bool wxDb::DropView(const wxString &viewName) DispNextError(); DispAllErrors(henv, hdbc, hstmt); RollbackTrans(); - return(FALSE); + return false; } } } // Commit the transaction if (!CommitTrans()) - return(FALSE); + return false; - return TRUE; + return true; } // wxDb::DropView() @@ -2144,12 +2144,12 @@ bool wxDb::ExecSql(const wxString &pSqlStmt) if (retcode == SQL_SUCCESS || (Dbms() == dbmsDB2 && (retcode == SQL_SUCCESS_WITH_INFO || retcode == SQL_NO_DATA_FOUND))) { - return(TRUE); + return true; } else { DispAllErrors(henv, hdbc, hstmt); - return(FALSE); + return false; } } // wxDb::ExecSql() @@ -2159,11 +2159,11 @@ bool wxDb::ExecSql(const wxString &pSqlStmt) bool wxDb::GetNext(void) { if (SQLFetch(hstmt) == SQL_SUCCESS) - return(TRUE); + return true; else { DispAllErrors(henv, hdbc, hstmt); - return(FALSE); + return false; } } // wxDb::GetNext() @@ -2176,11 +2176,11 @@ bool wxDb::GetData(UWORD colNo, SWORD cType, PTR pData, SDWORD maxLen, SDWORD FA wxASSERT(cbReturned); if (SQLGetData(hstmt, colNo, cType, pData, maxLen, cbReturned) == SQL_SUCCESS) - return(TRUE); + return true; else { DispAllErrors(henv, hdbc, hstmt); - return(FALSE); + return false; } } // wxDb::GetData() @@ -3239,7 +3239,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName) FILE *fp = wxFopen(fileName.c_str(),wxT("wt")); if (fp == NULL) - return(FALSE); + return false; SQLFreeStmt(hstmt, SQL_CLOSE); @@ -3270,14 +3270,14 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName) { DispAllErrors(henv, hdbc, hstmt); fclose(fp); - return(FALSE); + return false; } wxString outStr; tblNameSave.Empty(); int cnt = 0; - while (TRUE) + while (true) { retcode = SQLFetch(hstmt); if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) @@ -3316,7 +3316,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName) { SQLFreeStmt(hstmt, SQL_CLOSE); fclose(fp); - return(FALSE); + return false; } cnt++; } @@ -3334,7 +3334,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName) bool wxDb::TableExists(const wxString &tableName, const wxChar *userID, const wxString &tablePath) /* - * Table name can refer to a table, view, alias or synonym. Returns TRUE + * Table name can refer to a table, view, alias or synonym. Returns true * if the object exists in the database. This function does not indicate * whether or not the user has privleges to query or perform other functions * on the table. @@ -3411,7 +3411,7 @@ bool wxDb::TableExists(const wxString &tableName, const wxChar *userID, const wx SQLFreeStmt(hstmt, SQL_CLOSE); - return(TRUE); + return true; } // wxDb::TableExists() @@ -3472,30 +3472,30 @@ bool wxDb::TablePrivileges(const wxString &tableName, const wxString &priv, cons if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO)) return(DispAllErrors(henv, hdbc, hstmt)); - bool failed = FALSE; + bool failed = false; retcode = SQLFetch(hstmt); while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) { if (SQLGetData(hstmt, 1, SQL_C_CHAR, (UCHAR*) result.tableQual, sizeof(result.tableQual), &cbRetVal) != SQL_SUCCESS) - failed = TRUE; + failed = true; if (!failed && SQLGetData(hstmt, 2, SQL_C_CHAR, (UCHAR*) result.tableOwner, sizeof(result.tableOwner), &cbRetVal) != SQL_SUCCESS) - failed = TRUE; + failed = true; if (!failed && SQLGetData(hstmt, 3, SQL_C_CHAR, (UCHAR*) result.tableName, sizeof(result.tableName), &cbRetVal) != SQL_SUCCESS) - failed = TRUE; + failed = true; if (!failed && SQLGetData(hstmt, 4, SQL_C_CHAR, (UCHAR*) result.grantor, sizeof(result.grantor), &cbRetVal) != SQL_SUCCESS) - failed = TRUE; + failed = true; if (!failed && SQLGetData(hstmt, 5, SQL_C_CHAR, (UCHAR*) result.grantee, sizeof(result.grantee), &cbRetVal) != SQL_SUCCESS) - failed = TRUE; + failed = true; if (!failed && SQLGetData(hstmt, 6, SQL_C_CHAR, (UCHAR*) result.privilege, sizeof(result.privilege), &cbRetVal) != SQL_SUCCESS) - failed = TRUE; + failed = true; if (!failed && SQLGetData(hstmt, 7, SQL_C_CHAR, (UCHAR*) result.grantable, sizeof(result.grantable), &cbRetVal) != SQL_SUCCESS) - failed = TRUE; + failed = true; if (failed) { @@ -3507,31 +3507,31 @@ bool wxDb::TablePrivileges(const wxString &tableName, const wxString &priv, cons result.grantor, result.grantee); #endif - if (UserID.IsSameAs(result.tableOwner,FALSE)) + if (UserID.IsSameAs(result.tableOwner,false)) { SQLFreeStmt(hstmt, SQL_CLOSE); - return TRUE; + return true; } - if (UserID.IsSameAs(result.grantee,FALSE) && + if (UserID.IsSameAs(result.grantee,false) && !wxStrcmp(result.privilege,priv)) { SQLFreeStmt(hstmt, SQL_CLOSE); - return TRUE; + return true; } if (!wxStrcmp(result.grantee,curRole) && !wxStrcmp(result.privilege,priv)) { SQLFreeStmt(hstmt, SQL_CLOSE); - return TRUE; + return true; } retcode = SQLFetch(hstmt); } SQLFreeStmt(hstmt, SQL_CLOSE); - return FALSE; + return false; } // wxDb::TablePrivileges @@ -3576,7 +3576,7 @@ bool wxDb::SetSqlLogging(wxDbSqlLogState state, const wxString &filename, bool a { fpSqlLog = wxFopen(filename, (append ? wxT("at") : wxT("wt"))); if (fpSqlLog == NULL) - return(FALSE); + return false; } } else // sqlLogOFF @@ -3584,13 +3584,13 @@ bool wxDb::SetSqlLogging(wxDbSqlLogState state, const wxString &filename, bool a if (fpSqlLog) { if (fclose(fpSqlLog)) - return(FALSE); + return false; fpSqlLog = 0; } } sqlLogState = state; - return(TRUE); + return true; } // wxDb::SetSqlLogging() @@ -3601,16 +3601,16 @@ bool wxDb::WriteSqlLog(const wxString &logMsg) wxASSERT(logMsg.Length()); if (fpSqlLog == 0 || sqlLogState == sqlLogOFF) - return(FALSE); + return false; if (wxFputs(wxT("\n"), fpSqlLog) == EOF) - return(FALSE); + return false; if (wxFputs(logMsg, fpSqlLog) == EOF) - return(FALSE); + return false; if (wxFputs(wxT("\n"), fpSqlLog) == EOF) - return(FALSE); + return false; - return(TRUE); + return true; } // wxDb::WriteSqlLog() @@ -3638,7 +3638,7 @@ wxDBMS wxDb::Dbms(void) * - Does not support the SQL_TIMESTAMP structure * - Supports only one cursor and one connect (apparently? with Microsoft driver only?) * - Does not automatically create the primary index if the 'keyField' param of SetColDef - * is TRUE. The user must create ALL indexes from their program. + * is true. The user must create ALL indexes from their program. * - Table names can only be 8 characters long * - Column names can only be 10 characters long * @@ -3764,7 +3764,7 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName, // Must specify a columnLength if modifying a VARCHAR type column if (dataType == DB_DATA_TYPE_VARCHAR && !columnLength) - return FALSE; + return false; wxString dataTypeName; wxString sqlStmt; @@ -3788,7 +3788,7 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName, dataTypeName = typeInfBlob.TypeName; break; default: - return FALSE; + return false; } // Set the modify or alter syntax depending on the type of database connected to @@ -3801,7 +3801,7 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName, alterSlashModify = _T("ALTER COLUMN"); break; case dbmsUNIDENTIFIED : - return FALSE; + return false; case dbmsSYBASE_ASA : case dbmsSYBASE_ASE : case dbmsMY_SQL : @@ -3870,11 +3870,11 @@ wxDb WXDLLIMPEXP_ODBC *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnly { if (pDbConfig->UseConnectionStr()) { - if (pList->PtrDb->OpenedWithConnectionString() && + if (pList->PtrDb->OpenedWithConnectionString() && (!wxStrcmp(pDbConfig->GetConnectionStr(), pList->ConnectionStr))) { // Found a free connection - pList->Free = FALSE; + pList->Free = false; return(pList->PtrDb); } } @@ -3884,7 +3884,7 @@ wxDb WXDLLIMPEXP_ODBC *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnly (!wxStrcmp(pDbConfig->GetDsn(), pList->Dsn))) { // Found a free connection - pList->Free = FALSE; + pList->Free = false; return(pList->PtrDb); } } @@ -3924,7 +3924,7 @@ wxDb WXDLLIMPEXP_ODBC *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnly // Initialize new node in the linked list pList->PtrNext = 0; - pList->Free = FALSE; + pList->Free = false; pList->Dsn = pDbConfig->GetDsn(); pList->Uid = pDbConfig->GetUserID(); pList->AuthStr = pDbConfig->GetPassword(); @@ -3951,8 +3951,8 @@ wxDb WXDLLIMPEXP_ODBC *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnly // Connect to the datasource if (opened) { - pList->PtrDb->setCached(TRUE); // Prevent a user from deleting a cached connection - pList->PtrDb->SetSqlLogging(SQLLOGstate, SQLLOGfn, TRUE); + pList->PtrDb->setCached(true); // Prevent a user from deleting a cached connection + pList->PtrDb->SetSqlLogging(SQLLOGstate, SQLLOGfn, true); return(pList->PtrDb); } else // Unable to connect, destroy list item @@ -3981,11 +3981,11 @@ bool WXDLLIMPEXP_ODBC wxDbFreeConnection(wxDb *pDb) for (pList = PtrBegDbList; pList; pList = pList->PtrNext) { if (pList->PtrDb == pDb) // Found it, now free it!!! - return (pList->Free = TRUE); + return (pList->Free = true); } // Never found the database object, return failure - return(FALSE); + return false; } // wxDbFreeConnection() @@ -4001,7 +4001,7 @@ void WXDLLIMPEXP_ODBC wxDbCloseConnections(void) pNext = pList->PtrNext; // Save the pointer to next pList->PtrDb->CommitTrans(); // Commit any open transactions on wxDb object pList->PtrDb->Close(); // Close the wxDb object - pList->PtrDb->setCached(FALSE); // Allows deletion of the wxDb instance + pList->PtrDb->setCached(false); // Allows deletion of the wxDb instance delete pList->PtrDb; // Deletes the wxDb object delete pList; // Deletes the linked list object } @@ -4021,7 +4021,7 @@ int WXDLLIMPEXP_ODBC wxDbConnectionsInUse(void) // Scan the linked list counting db connections that are currently in use for (pList = PtrBegDbList; pList; pList = pList->PtrNext) { - if (pList->Free == FALSE) + if (pList->Free == false) cnt++; } @@ -4081,20 +4081,20 @@ const wxChar WXDLLIMPEXP_ODBC *wxDbLogExtendedErrorMsg(const wxChar *userText, /********** wxDbSqlLog() **********/ bool wxDbSqlLog(wxDbSqlLogState state, const wxChar *filename) { - bool append = FALSE; + bool append = false; wxDbList *pList; for (pList = PtrBegDbList; pList; pList = pList->PtrNext) { if (!pList->PtrDb->SetSqlLogging(state,filename,append)) - return(FALSE); - append = TRUE; + return false; + append = true; } SQLLOGstate = state; SQLLOGfn = filename; - return(TRUE); + return true; } // wxDbSqlLog() @@ -4132,7 +4132,7 @@ int wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const int k; do { - k = setupStr.Find((wxChar)2,TRUE); + k = setupStr.Find((wxChar)2,true); if (k != wxNOT_FOUND) setupStr[(UINT)k] = wxT('\0'); } @@ -4194,9 +4194,9 @@ bool wxDbGetDataSource(HENV henv, wxChar *Dsn, SWORD DsnMax, wxChar *DsDesc, if (SQLDataSources(henv, direction, (SQLTCHAR FAR *) Dsn, DsnMax, &cb1, (SQLTCHAR FAR *) DsDesc, DsDescMax, &cb2) == SQL_SUCCESS) - return(TRUE); + return true; else - return(FALSE); + return false; } // wxDbGetDataSource() diff --git a/src/common/dbgrid.cpp b/src/common/dbgrid.cpp index feecae05dc..cb3cd9c99e 100644 --- a/src/common/dbgrid.cpp +++ b/src/common/dbgrid.cpp @@ -132,7 +132,7 @@ wxDbGridTableBase::wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo* ColInfo, m_keys(), m_data(tab), m_dbowner(takeOwnership), - m_rowmodified(FALSE) + m_rowmodified(false) { if (count == wxUSE_QUERY) @@ -201,7 +201,7 @@ bool wxDbGridTableBase::CanHaveAttributes() // use the default attr provider by default SetAttrProvider(new wxDbGridCellAttrProvider(m_data, m_ColInfo)); } - return TRUE; + return true; } @@ -259,8 +259,8 @@ bool wxDbGridTableBase::AssignDbTable(wxDbTable *tab, int count, bool takeOwners grid->EndBatch(); } m_dbowner = takeOwnership; - m_rowmodified = FALSE; - return TRUE; + m_rowmodified = false; + return true; } wxString wxDbGridTableBase::GetTypeName(int WXUNUSED(row), int col) @@ -317,19 +317,19 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName if (typeName == wxGRID_VALUE_STRING) { //FIXME ummm What about blob field etc. - return TRUE; + return true; } if (m_data->IsColNull(m_ColInfo[col].DbCol)) { - return FALSE; + return false; } if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) { //If a virtual column then we can't find it's type. we have to - // return FALSE to get using wxVariant. - return FALSE; + // return false to get using wxVariant. + return false; } int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype; @@ -339,9 +339,9 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName (sqltype == SQL_C_TIME) || (sqltype == SQL_C_TIMESTAMP)) { - return TRUE; + return true; } - return FALSE; + return false; } if (typeName == wxGRID_VALUE_NUMBER) { @@ -350,9 +350,9 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName (sqltype == SQL_C_SLONG) || (sqltype == SQL_C_ULONG)) { - return TRUE; + return true; } - return FALSE; + return false; } if (typeName == wxGRID_VALUE_FLOAT) { @@ -363,11 +363,11 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName (sqltype == SQL_C_FLOAT) || (sqltype == SQL_C_DOUBLE)) { - return TRUE; + return true; } - return FALSE; + return false; } - return FALSE; + return false; } bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString& typeName) @@ -375,19 +375,19 @@ bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString if (typeName == wxGRID_VALUE_STRING) { //FIXME ummm What about blob field etc. - return TRUE; + return true; } if (!(m_data->GetColDefs()[(m_ColInfo[col].DbCol)].Updateable)) { - return FALSE; + return false; } if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) { //If a virtual column then we can't find it's type. we have to faulse to //get using wxVairent. - return FALSE; + return false; } int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype; @@ -397,9 +397,9 @@ bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString (sqltype == SQL_C_TIME) || (sqltype == SQL_C_TIMESTAMP)) { - return TRUE; + return true; } - return FALSE; + return false; } if (typeName == wxGRID_VALUE_NUMBER) { @@ -408,9 +408,9 @@ bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString (sqltype == SQL_C_SLONG) || (sqltype == SQL_C_ULONG)) { - return TRUE; + return true; } - return FALSE; + return false; } if (typeName == wxGRID_VALUE_FLOAT) { @@ -421,11 +421,11 @@ bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString (sqltype == SQL_C_FLOAT) || (sqltype == SQL_C_DOUBLE)) { - return TRUE; + return true; } - return FALSE; + return false; } - return FALSE; + return false; } long wxDbGridTableBase::GetValueAsLong(int row, int col) @@ -556,7 +556,7 @@ void wxDbGridTableBase::SetValueAsCustom(int row, int col, const wxString& typeN return; } wxVariant val(date); - m_rowmodified = TRUE; + m_rowmodified = true; m_data->SetCol(m_ColInfo[col].DbCol,val); } } @@ -603,7 +603,7 @@ void wxDbGridTableBase::SetValue(int row, int col,const wxString& value) ValidateRow(row); wxVariant val(value); - m_rowmodified = TRUE; + m_rowmodified = true; m_data->SetCol(m_ColInfo[col].DbCol,val); } @@ -615,7 +615,7 @@ void wxDbGridTableBase::SetValueAsLong(int row, int col, long value) ValidateRow(row); wxVariant val(value); - m_rowmodified = TRUE; + m_rowmodified = true; m_data->SetCol(m_ColInfo[col].DbCol,val); } @@ -627,7 +627,7 @@ void wxDbGridTableBase::SetValueAsDouble(int row, int col, double value) ValidateRow(row); wxVariant val(value); - m_rowmodified = TRUE; + m_rowmodified = true; m_data->SetCol(m_ColInfo[col].DbCol,val); } @@ -640,7 +640,7 @@ void wxDbGridTableBase::SetValueAsBool(int row, int col, bool value) ValidateRow(row); wxVariant val(value); - m_rowmodified = TRUE; + m_rowmodified = true; m_data->SetCol(m_ColInfo[col].DbCol,val); } @@ -687,17 +687,17 @@ void wxDbGridTableBase::ValidateRow(int row) m_row = row; } - m_rowmodified = FALSE; + m_rowmodified = false; } bool wxDbGridTableBase::Writeback() const { if (!m_rowmodified) { - return TRUE; + return true; } - bool result=TRUE; + bool result=true; wxLogDebug(wxT("\trow key unknown")); // FIXME: this code requires dbtable support for record status diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index ce60d096dc..bfc966f811 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -95,14 +95,14 @@ bool wxDbColDef::Initialize() SqlCtype = SQL_C_LONG; PtrDataObj = NULL; SzDataObj = 0; - KeyField = FALSE; - Updateable = FALSE; - InsertAllowed = FALSE; - DerivedCol = FALSE; + KeyField = false; + Updateable = false; + InsertAllowed = false; + DerivedCol = false; CbValue = 0; - Null = FALSE; + Null = false; - return TRUE; + return true; } // wxDbColDef::Initialize() @@ -154,9 +154,9 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num where.Empty(); // Where clause orderBy.Empty(); // Order By clause from.Empty(); // From clause - selectForUpdate = FALSE; // SELECT ... FOR UPDATE; Indicates whether to include the FOR UPDATE phrase + selectForUpdate = false; // SELECT ... FOR UPDATE; Indicates whether to include the FOR UPDATE phrase queryOnly = qryOnly; - insertable = TRUE; + insertable = true; tablePath.Empty(); tableName.Empty(); queryTableName.Empty(); @@ -165,7 +165,7 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num wxASSERT(pDb); if (!pDb) - return FALSE; + return false; tableName = tblName; // Table Name if (tblPath.Length()) @@ -262,7 +262,7 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num { // Should never happen pDb->GetNextError(henv, hdbc, hstmtInternal); - return FALSE; + return false; } } } @@ -291,11 +291,11 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num } // Make the default cursor the active cursor - hstmtDefault = GetNewCursor(FALSE,FALSE); + hstmtDefault = GetNewCursor(false,false); wxASSERT(hstmtDefault); hstmt = *hstmtDefault; - return TRUE; + return true; } // wxDbTable::initialize() @@ -312,7 +312,7 @@ void wxDbTable::cleanup() #ifdef __WXDEBUG__ if (tableID) { - bool found = FALSE; + bool found = false; wxList::compatibility_iterator pNode; pNode = TablesInUse.GetFirst(); @@ -320,7 +320,7 @@ void wxDbTable::cleanup() { if (((wxTablesInUse *)pNode->GetData())->tableID == tableID) { - found = TRUE; + found = true; delete (wxTablesInUse *)pNode->GetData(); TablesInUse.Erase(pNode); } @@ -445,7 +445,7 @@ bool wxDbTable::bindParams(bool forUpdate) { wxASSERT(!queryOnly); if (queryOnly) - return(FALSE); + return false; SWORD fSqlType = 0; SDWORD precision = 0; @@ -526,7 +526,7 @@ bool wxDbTable::bindParams(bool forUpdate) } // Completed successfully - return(TRUE); + return true; } // wxDbTable::bindParams() @@ -534,14 +534,14 @@ bool wxDbTable::bindParams(bool forUpdate) /********** wxDbTable::bindInsertParams() **********/ bool wxDbTable::bindInsertParams(void) { - return bindParams(FALSE); + return bindParams(false); } // wxDbTable::bindInsertParams() /********** wxDbTable::bindUpdateParams() **********/ bool wxDbTable::bindUpdateParams(void) { - return bindParams(TRUE); + return bindParams(true); } // wxDbTable::bindUpdateParams() @@ -561,7 +561,7 @@ bool wxDbTable::bindCols(HSTMT cursor) } // Completed successfully - return(TRUE); + return true; } // wxDbTable::bindCols() @@ -581,7 +581,7 @@ bool wxDbTable::getRec(UWORD fetchType) if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) { if (retcode == SQL_NO_DATA_FOUND) - return(FALSE); + return false; else return(pDb->DispAllErrors(henv, hdbc, hstmt)); } @@ -601,7 +601,7 @@ bool wxDbTable::getRec(UWORD fetchType) if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) { if (retcode == SQL_NO_DATA_FOUND) - return(FALSE); + return false; else return(pDb->DispAllErrors(henv, hdbc, hstmt)); } @@ -616,7 +616,7 @@ bool wxDbTable::getRec(UWORD fetchType) } // Completed successfully - return(TRUE); + return true; } // wxDbTable::getRec() @@ -634,7 +634,7 @@ bool wxDbTable::execDelete(const wxString &pSqlStmt) retcode == SQL_SUCCESS_WITH_INFO) { // Record deleted successfully - return(TRUE); + return true; } // Problem deleting record @@ -656,7 +656,7 @@ bool wxDbTable::execUpdate(const wxString &pSqlStmt) retcode == SQL_SUCCESS_WITH_INFO) { // Record updated successfully - return(TRUE); + return true; } else if (retcode == SQL_NEED_DATA) { @@ -687,7 +687,7 @@ bool wxDbTable::execUpdate(const wxString &pSqlStmt) retcode == SQL_SUCCESS_WITH_INFO) { // Record updated successfully - return(TRUE); + return true; } } @@ -706,7 +706,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri // The user may wish to select for update, but the DBMS may not be capable selectForUpdate = CanSelectForUpdate(); else - selectForUpdate = FALSE; + selectForUpdate = false; // Set the SQL SELECT string if (queryType != DB_SELECT_STATEMENT) // A select statement was not passed in, @@ -717,7 +717,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri // Make sure the cursor is closed first if (!CloseCursor(hstmt)) - return(FALSE); + return false; // Execute the SQL SELECT statement int retcode; @@ -726,7 +726,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri return(pDb->DispAllErrors(henv, hdbc, hstmt)); // Completed successfully - return(TRUE); + return true; } // wxDbTable::query() @@ -738,7 +738,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) { if (!pDb) - return FALSE; + return false; int i; wxString sqlStmt; @@ -792,7 +792,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) p += s; pDb->LogError(p.GetData()); - return(FALSE); + return false; } // Bind the member variables for field exchange between @@ -800,17 +800,17 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) if (!queryOnly) { if (!bindInsertParams()) // Inserts - return(FALSE); + return false; if (!bindUpdateParams()) // Updates - return(FALSE); + return false; } if (!bindCols(*hstmtDefault)) // Selects - return(FALSE); + return false; if (!bindCols(hstmtInternal)) // Internal use only - return(FALSE); + return false; /* * Do NOT bind the hstmtCount cursor!!! @@ -819,7 +819,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) // Build an insert statement using parameter markers if (!queryOnly && noCols > 0) { - bool needComma = FALSE; + bool needComma = false; sqlStmt.Printf(wxT("INSERT INTO %s ("), pDb->SQLTableName(tableName.c_str()).c_str()); for (i = 0; i < noCols; i++) @@ -830,9 +830,9 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) sqlStmt += wxT(","); sqlStmt += pDb->SQLColumnName(colDefs[i].ColName); // sqlStmt += colDefs[i].ColName; - needComma = TRUE; + needComma = true; } - needComma = FALSE; + needComma = false; sqlStmt += wxT(") VALUES ("); int insertableCount = 0; @@ -844,7 +844,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) if (needComma) sqlStmt += wxT(","); sqlStmt += wxT("?"); - needComma = TRUE; + needComma = true; insertableCount++; } sqlStmt += wxT(")"); @@ -856,11 +856,11 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) return(pDb->DispAllErrors(henv, hdbc, hstmtInsert)); } else - insertable = FALSE; + insertable = false; } // Completed successfully - return(TRUE); + return true; } // wxDbTable::Open() @@ -879,7 +879,7 @@ bool wxDbTable::QueryBySqlStmt(const wxString &pSqlStmt) { pDb->WriteSqlLog(pSqlStmt); - return(query(DB_SELECT_STATEMENT, FALSE, FALSE, pSqlStmt)); + return(query(DB_SELECT_STATEMENT, false, false, pSqlStmt)); } // wxDbTable::QueryBySqlStmt() @@ -908,7 +908,7 @@ bool wxDbTable::GetPrev(void) if (pDb->FwdOnlyCursors()) { wxFAIL_MSG(wxT("GetPrev()::Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return FALSE; + return false; } else return(getRec(SQL_FETCH_PRIOR)); @@ -922,7 +922,7 @@ bool wxDbTable::operator--(int) if (pDb->FwdOnlyCursors()) { wxFAIL_MSG(wxT("operator--:Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return FALSE; + return false; } else return(getRec(SQL_FETCH_PRIOR)); @@ -936,7 +936,7 @@ bool wxDbTable::GetFirst(void) if (pDb->FwdOnlyCursors()) { wxFAIL_MSG(wxT("GetFirst():Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return FALSE; + return false; } else return(getRec(SQL_FETCH_FIRST)); @@ -950,7 +950,7 @@ bool wxDbTable::GetLast(void) if (pDb->FwdOnlyCursors()) { wxFAIL_MSG(wxT("GetLast()::Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return FALSE; + return false; } else return(getRec(SQL_FETCH_LAST)); @@ -1045,13 +1045,13 @@ void wxDbTable::BuildSelectStmt(wxString &pSqlStmt, int typeOfSelect, bool disti // Was a FROM clause specified to join tables to the base table? // Available for ::Query() only!!! - bool appendFromClause = FALSE; + bool appendFromClause = false; #if wxODBC_BACKWARD_COMPATABILITY if (typeOfSelect == DB_SELECT_WHERE && from && wxStrlen(from)) - appendFromClause = TRUE; + appendFromClause = true; #else if (typeOfSelect == DB_SELECT_WHERE && from.Length()) - appendFromClause = TRUE; + appendFromClause = true; #endif // Add the column list @@ -1175,7 +1175,7 @@ void wxDbTable::BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxStrin wxString whereClause; whereClause.Empty(); - bool firstColumn = TRUE; + bool firstColumn = true; pSqlStmt.Printf(wxT("UPDATE %s SET "), pDb->SQLTableName(tableName.c_str()).c_str()); @@ -1190,7 +1190,7 @@ void wxDbTable::BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxStrin if (!firstColumn) pSqlStmt += wxT(","); else - firstColumn = FALSE; + firstColumn = false; pSqlStmt += pDb->SQLColumnName(colDefs[i].ColName); // pSqlStmt += colDefs[i].ColName; @@ -1251,7 +1251,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere, * They are not included as part of the where clause. */ { - bool moreThanOneColumn = FALSE; + bool moreThanOneColumn = false; wxString colValue; // Loop through the columns building a where clause as you go @@ -1269,7 +1269,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere, if (moreThanOneColumn) pWhereClause += wxT(" AND "); else - moreThanOneColumn = TRUE; + moreThanOneColumn = true; // Concatenate where phrase for the column wxString tStr = colDefs[colNo].ColName; @@ -1360,7 +1360,7 @@ bool wxDbTable::CloseCursor(HSTMT cursor) return(pDb->DispAllErrors(henv, hdbc, cursor)); // Completed successfully - return(TRUE); + return true; } // wxDbTable::CloseCursor() @@ -1369,7 +1369,7 @@ bool wxDbTable::CloseCursor(HSTMT cursor) bool wxDbTable::CreateTable(bool attemptDrop) { if (!pDb) - return FALSE; + return false; int i, j; wxString sqlStmt; @@ -1380,7 +1380,7 @@ bool wxDbTable::CreateTable(bool attemptDrop) // Drop table first if (attemptDrop && !DropTable()) - return FALSE; + return false; // Create the table #ifdef DBDEBUG_CONSOLE @@ -1413,7 +1413,7 @@ bool wxDbTable::CreateTable(bool attemptDrop) #endif // Build a CREATE TABLE string from the colDefs structure. - bool needComma = FALSE; + bool needComma = false; sqlStmt.Printf(wxT("CREATE TABLE %s ("), pDb->SQLTableName(tableName.c_str()).c_str()); @@ -1471,7 +1471,7 @@ bool wxDbTable::CreateTable(bool attemptDrop) } } - needComma = TRUE; + needComma = true; } // If there is a primary key defined, include it in the create statement for (i = j = 0; i < noCols; i++) @@ -1562,17 +1562,17 @@ bool wxDbTable::CreateTable(bool attemptDrop) pDb->DispAllErrors(henv, hdbc, hstmt); pDb->RollbackTrans(); CloseCursor(hstmt); - return(FALSE); + return false; } // Commit the transaction and close the cursor if (!pDb->CommitTrans()) - return(FALSE); + return false; if (!CloseCursor(hstmt)) - return(FALSE); + return false; // Database table created successfully - return(TRUE); + return true; } // wxDbTable::CreateTable() @@ -1580,7 +1580,7 @@ bool wxDbTable::CreateTable(bool attemptDrop) /********** wxDbTable::DropTable() **********/ bool wxDbTable::DropTable() { - // NOTE: This function returns TRUE if the Table does not exist, but + // NOTE: This function returns true if the Table does not exist, but // only for identified databases. Code will need to be added // below for any other databases when those databases are defined // to handle this situation consistently @@ -1614,18 +1614,18 @@ bool wxDbTable::DropTable() pDb->DispAllErrors(henv, hdbc, hstmt); pDb->RollbackTrans(); // CloseCursor(hstmt); - return(FALSE); + return false; } } } // Commit the transaction and close the cursor if (! pDb->CommitTrans()) - return(FALSE); + return false; if (! CloseCursor(hstmt)) - return(FALSE); + return false; - return(TRUE); + return true; } // wxDbTable::DropTable() @@ -1637,7 +1637,7 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol // Drop the index first if (attemptDrop && !DropIndex(idxName)) - return (FALSE); + return false; // MySQL (and possibly Sybase ASE?? - gt) require that any columns which are used as portions // of an index have the columns defined as "NOT NULL". During initial table creation though, @@ -1651,11 +1651,11 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol { wxString sqlStmt; int i; - bool ok = TRUE; + bool ok = true; for (i = 0; i < noIdxCols && ok; i++) { int j = 0; - bool found = FALSE; + bool found = false; // Find the column definition that has the ColName that matches the // index column name. We need to do this to get the DB_DATA_TYPE of // the index column, as MySQL's syntax for the ALTER column requires @@ -1663,7 +1663,7 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol while (!found && (j < this->noCols)) { if (wxStrcmp(colDefs[j].ColName,pIdxDefs[i].ColName) == 0) - found = TRUE; + found = true; if (!found) j++; } @@ -1687,14 +1687,14 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol } } else - ok = FALSE; + ok = false; } if (ok) pDb->CommitTrans(); else { pDb->RollbackTrans(); - return(FALSE); + return false; } } @@ -1737,7 +1737,7 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol sqlStmt += s; } } - + // Postgres and SQL Server 7 do not support the ASC/DESC keywords for index columns if (!((pDb->Dbms() == dbmsMS_SQL_SERVER) && (wxStrncmp(pDb->dbInf.dbmsVer,_T("07"),2)==0)) && !(pDb->Dbms() == dbmsPOSTGRES)) @@ -1769,17 +1769,17 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol pDb->DispAllErrors(henv, hdbc, hstmt); pDb->RollbackTrans(); CloseCursor(hstmt); - return(FALSE); + return false; } // Commit the transaction and close the cursor if (! pDb->CommitTrans()) - return(FALSE); + return false; if (! CloseCursor(hstmt)) - return(FALSE); + return false; // Index Created Successfully - return(TRUE); + return true; } // wxDbTable::CreateIndex() @@ -1787,7 +1787,7 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol /********** wxDbTable::DropIndex() **********/ bool wxDbTable::DropIndex(const wxString &idxName) { - // NOTE: This function returns TRUE if the Index does not exist, but + // NOTE: This function returns true if the Index does not exist, but // only for identified databases. Code will need to be added // below for any other databases when those databases are defined // to handle this situation consistently @@ -1835,18 +1835,18 @@ bool wxDbTable::DropIndex(const wxString &idxName) pDb->DispAllErrors(henv, hdbc, hstmt); pDb->RollbackTrans(); CloseCursor(hstmt); - return(FALSE); + return false; } } } // Commit the transaction and close the cursor if (! pDb->CommitTrans()) - return(FALSE); + return false; if (! CloseCursor(hstmt)) - return(FALSE); + return false; - return(TRUE); + return true; } // wxDbTable::DropIndex() @@ -1856,7 +1856,7 @@ bool wxDbTable::SetOrderByColNums(UWORD first, ... ) int colNo = first; // using 'int' to be able to look for wxDB_NO_MORE_COLUN_NUMBERS va_list argptr; - bool abort = FALSE; + bool abort = false; wxString tempStr; va_start(argptr, first); /* Initialize variable arguments. */ @@ -1868,7 +1868,7 @@ bool wxDbTable::SetOrderByColNums(UWORD first, ... ) // Valid columns are 0 thru noCols-1 if (colNo >= noCols || colNo < 0) { - abort = TRUE; + abort = true; continue; } @@ -1958,7 +1958,7 @@ bool wxDbTable::Update(void) { wxASSERT(!queryOnly); if (queryOnly) - return(FALSE); + return false; wxString sqlStmt; @@ -1982,7 +1982,7 @@ bool wxDbTable::Update(const wxString &pSqlStmt) { wxASSERT(!queryOnly); if (queryOnly) - return(FALSE); + return false; pDb->WriteSqlLog(pSqlStmt); @@ -1996,7 +1996,7 @@ bool wxDbTable::UpdateWhere(const wxString &pWhereClause) { wxASSERT(!queryOnly); if (queryOnly) - return(FALSE); + return false; wxString sqlStmt; @@ -2020,7 +2020,7 @@ bool wxDbTable::Delete(void) { wxASSERT(!queryOnly); if (queryOnly) - return(FALSE); + return false; wxString sqlStmt; sqlStmt.Empty(); @@ -2041,7 +2041,7 @@ bool wxDbTable::DeleteWhere(const wxString &pWhereClause) { wxASSERT(!queryOnly); if (queryOnly) - return(FALSE); + return false; wxString sqlStmt; sqlStmt.Empty(); @@ -2062,7 +2062,7 @@ bool wxDbTable::DeleteMatching(void) { wxASSERT(!queryOnly); if (queryOnly) - return(FALSE); + return false; wxString sqlStmt; sqlStmt.Empty(); @@ -2082,7 +2082,7 @@ bool wxDbTable::DeleteMatching(void) bool wxDbTable::IsColNull(UWORD colNo) const { /* - This logic is just not right. It would indicate TRUE + This logic is just not right. It would indicate true if a numeric field were set to a value of 0. switch(colDefs[colNo].SqlCtype) @@ -2105,11 +2105,11 @@ bool wxDbTable::IsColNull(UWORD colNo) const TIMESTAMP_STRUCT *pDt; pDt = (TIMESTAMP_STRUCT *) colDefs[colNo].PtrDataObj; if (pDt->year == 0 && pDt->month == 0 && pDt->day == 0) - return(TRUE); + return true; else - return(FALSE); + return false; default: - return(TRUE); + return true; } */ return (colDefs[colNo].Null); @@ -2120,16 +2120,16 @@ bool wxDbTable::IsColNull(UWORD colNo) const bool wxDbTable::CanSelectForUpdate(void) { if (queryOnly) - return FALSE; + return false; if (pDb->Dbms() == dbmsMY_SQL) - return FALSE; + return false; if ((pDb->Dbms() == dbmsORACLE) || (pDb->dbInf.posStmts & SQL_PS_SELECT_FOR_UPDATE)) - return(TRUE); + return true; else - return(FALSE); + return false; } // wxDbTable::CanSelectForUpdate() @@ -2138,15 +2138,15 @@ bool wxDbTable::CanSelectForUpdate(void) bool wxDbTable::CanUpdByROWID(void) { /* - * NOTE: Returning FALSE for now until this can be debugged, + * NOTE: Returning false for now until this can be debugged, * as the ROWID is not getting updated correctly */ - return FALSE; + return false; /* if (pDb->Dbms() == dbmsORACLE) - return(TRUE); + return true; else - return(FALSE); + return false; */ } // wxDbTable::CanUpdByROWID() @@ -2155,9 +2155,9 @@ bool wxDbTable::CanUpdByROWID(void) bool wxDbTable::IsCursorClosedOnCommit(void) { if (pDb->dbInf.cursorCommitBehavior == SQL_CB_PRESERVE) - return(FALSE); + return false; else - return(TRUE); + return true; } // wxDbTable::IsCursorClosedOnCommit() @@ -2234,7 +2234,7 @@ bool wxDbTable::SetQueryTimeout(UDWORD nSeconds) return(pDb->DispAllErrors(henv, hdbc, hstmtInternal)); // Completed Successfully - return(TRUE); + return true; } // wxDbTable::SetQueryTimeout() @@ -2274,8 +2274,8 @@ void wxDbTable::SetColDefs(UWORD index, const wxString &fieldName, int dataType, // Derived columns by definition would NOT be "Insertable" or "Updateable" if (derivedCol) { - colDefs[index].Updateable = FALSE; - colDefs[index].InsertAllowed = FALSE; + colDefs[index].Updateable = false; + colDefs[index].InsertAllowed = false; } else { @@ -2283,7 +2283,7 @@ void wxDbTable::SetColDefs(UWORD index, const wxString &fieldName, int dataType, colDefs[index].InsertAllowed = insAllow; } - colDefs[index].Null = FALSE; + colDefs[index].Null = false; } // wxDbTable::SetColDefs() @@ -2419,7 +2419,7 @@ ULONG wxDbTable::Count(const wxString &args) // Initialize the Count cursor if it's not already initialized if (!hstmtCount) { - hstmtCount = GetNewCursor(FALSE,FALSE); + hstmtCount = GetNewCursor(false,false); wxASSERT(hstmtCount); if (!hstmtCount) return(0); @@ -2459,7 +2459,7 @@ ULONG wxDbTable::Count(const wxString &args) /********** wxDbTable::Refresh() **********/ bool wxDbTable::Refresh(void) { - bool result = TRUE; + bool result = true; // Switch to the internal cursor so any active cursors are not corrupted HSTMT currCursor = GetCursor(); @@ -2503,10 +2503,10 @@ bool wxDbTable::Refresh(void) where = whereClause; orderBy.Empty(); if (!Query()) - result = FALSE; + result = false; if (result && !GetNext()) - result = FALSE; + result = false; // Switch back to original cursor SetCursor(&currCursor); @@ -2531,14 +2531,14 @@ bool wxDbTable::SetColNull(UWORD colNo, bool set) { colDefs[colNo].Null = set; if (set) // Blank out the values in the member variable - ClearMemberVar(colNo, FALSE); // Must call with FALSE here, or infinite recursion will happen + ClearMemberVar(colNo, false); // Must call with false here, or infinite recursion will happen setCbValueForColumn(colNo); - return(TRUE); + return true; } else - return(FALSE); + return false; } // wxDbTable::SetColNull() @@ -2557,14 +2557,14 @@ bool wxDbTable::SetColNull(const wxString &colName, bool set) { colDefs[colNo].Null = set; if (set) // Blank out the values in the member variable - ClearMemberVar(colNo,FALSE); // Must call with FALSE here, or infinite recursion will happen + ClearMemberVar(colNo,false); // Must call with false here, or infinite recursion will happen setCbValueForColumn(colNo); - return(TRUE); + return true; } else - return(FALSE); + return false; } // wxDbTable::SetColNull() @@ -2611,7 +2611,7 @@ HSTMT *wxDbTable::GetNewCursor(bool setCursor, bool bindColumns) /********** wxDbTable::DeleteCursor() **********/ bool wxDbTable::DeleteCursor(HSTMT *hstmtDel) { - bool result = TRUE; + bool result = true; if (!hstmtDel) // Cursor already deleted return(result); @@ -2624,7 +2624,7 @@ ODBC 3.0 says to use this form if (SQLFreeStmt(*hstmtDel, SQL_DROP) != SQL_SUCCESS) { pDb->DispAllErrors(henv, hdbc); - result = FALSE; + result = false; } delete hstmtDel; @@ -2641,7 +2641,7 @@ void wxDbTable::SetRowMode(const rowmode_t rowmode) { if (!m_hstmtGridQuery) { - m_hstmtGridQuery = GetNewCursor(FALSE,FALSE); + m_hstmtGridQuery = GetNewCursor(false,false); if (!bindCols(*m_hstmtGridQuery)) return; } @@ -2727,7 +2727,7 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val) { //Returns null if invalid! if (!dateval.ParseDate(val.GetString())) - SetColNull(colNo, TRUE); + SetColNull(colNo, true); } switch (colDefs[colNo].SqlCtype) @@ -2840,7 +2840,7 @@ void wxDbTable::SetKey(const GenericKey& k) { if (colDefs[i].KeyField) { - SetColNull(i, FALSE); + SetColNull(i, false); memcpy(colDefs[i].PtrDataObj, blkptr, colDefs[i].SzDataObj); blkptr += colDefs[i].SzDataObj; } diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index c6842886a1..10c928e505 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -32,7 +32,7 @@ #include -// bool wxDCBase::sm_cacheing = FALSE; +// bool wxDCBase::sm_cacheing = false; // ============================================================================ // implementation @@ -291,7 +291,7 @@ static bool wx_spline_add_point(double x, double y) point->x = (int) x; point->y = (int) y; wx_spline_point_list.Append((wxObject*)point); - return TRUE; + return true; } static void wx_spline_draw_point_array(wxDCBase *dc) @@ -571,7 +571,7 @@ void wxDCBase::DrawLabel(const wxString& text, width0 = width; if ( bitmap.Ok() ) { - DrawBitmap(bitmap, x, y, TRUE /* use mask */); + DrawBitmap(bitmap, x, y, true /* use mask */); wxCoord offset = bitmap.GetWidth() + 4; x += offset; diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 374efff5f1..b599012aa5 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -72,9 +72,9 @@ void wxDialogBase::Init() wxSizer *wxDialogBase::CreateTextSizer( const wxString& message ) { bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - + wxString text = message; - + // I admit that this is complete bogus, but it makes // message boxes work for pda screens temporarily.. int max_width = -1; @@ -83,8 +83,8 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString& message ) max_width = wxSystemSettings::GetMetric( wxSYS_SCREEN_X ) - 25; text += wxT('\n'); } - - + + wxBoxSizer *box = new wxBoxSizer( wxVERTICAL ); // get line height for empty lines @@ -103,7 +103,7 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString& message ) case wxT('\n'): if (!line.IsEmpty()) { - wxStaticText *s = new wxStaticText( this, -1, line ); + wxStaticText *s = new wxStaticText( this, wxID_ANY, line ); box->Add( s ); line = wxT(""); } @@ -125,27 +125,27 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString& message ) default: if (text[pos] == wxT(' ')) last_space = pos; - + line += message[pos]; - + if (is_pda) { int width = 0; GetTextExtent( line, &width, (int*)NULL, (int*)NULL, (int*)NULL, &font ); - + if (width > max_width) { // exception if there was no previous space if (last_space == 0) last_space = pos; - + int diff = pos-last_space; int len = line.Len(); line.Remove( len-diff, diff ); - - wxStaticText *s = new wxStaticText( this, -1, line ); + + wxStaticText *s = new wxStaticText( this, wxID_ANY, line ); box->Add( s ); - + pos = last_space; last_space = 0; line = wxT(""); @@ -157,7 +157,7 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString& message ) // remaining text behind last '\n' if (!line.IsEmpty()) { - wxStaticText *s2 = new wxStaticText( this, -1, line ); + wxStaticText *s2 = new wxStaticText( this, wxID_ANY, line ); box->Add( s2 ); } @@ -171,13 +171,13 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString& message ) wxSizer *wxDialogBase::CreateButtonSizer( long flags ) { bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - - // If we have a PDA screen, put yes/no button over + + // If we have a PDA screen, put yes/no button over // all other buttons, otherwise on the left side. wxBoxSizer *box = is_pda ? new wxBoxSizer( wxVERTICAL ) : new wxBoxSizer( wxHORIZONTAL ); - + wxBoxSizer *inner_yes_no = NULL; - + // Only create sizer containing yes/no // if it is actually required if ( (flags & wxYES_NO) != 0 ) @@ -185,7 +185,7 @@ wxSizer *wxDialogBase::CreateButtonSizer( long flags ) inner_yes_no = new wxBoxSizer( wxHORIZONTAL ); box->Add( inner_yes_no, 0, wxBOTTOM, 10 ); } - + wxBoxSizer *inner_rest = new wxBoxSizer( wxHORIZONTAL ); box->Add( inner_rest, 0, 0, 0 ); diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index 0957f4b47f..483eab6d59 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -215,7 +215,7 @@ bool wxDataObjectComposite::GetDataHere(const wxDataFormat& format, { wxDataObjectSimple *dataObj = GetObject(format); - wxCHECK_MSG( dataObj, FALSE, + wxCHECK_MSG( dataObj, false, wxT("unsupported format in wxDataObjectComposite")); return dataObj->GetDataHere(buf); @@ -227,7 +227,7 @@ bool wxDataObjectComposite::SetData(const wxDataFormat& format, { wxDataObjectSimple *dataObj = GetObject(format); - wxCHECK_MSG( dataObj, FALSE, + wxCHECK_MSG( dataObj, false, wxT("unsupported format in wxDataObjectComposite")); return dataObj->SetData(len, buf); @@ -267,8 +267,8 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const wxCharBuffer buffer = wxConvLibc.cWX2MB( GetText().c_str() ); strcpy( (char*) buf, (const char*) buffer ); } - - return TRUE; + + return true; } bool wxTextDataObject::SetData(const wxDataFormat& format, @@ -278,8 +278,8 @@ bool wxTextDataObject::SetData(const wxDataFormat& format, SetText( wxConvUTF8.cMB2WX( (const char*) buf ) ); else SetText( wxConvLibc.cMB2WX( (const char*) buf ) ); - - return TRUE; + + return true; } #elif wxUSE_UNICODE && defined(__WXMAC__) @@ -289,7 +289,7 @@ size_t wxTextDataObject::GetDataSize(const wxDataFormat& format) const if (format == wxDF_UNICODETEXT) { // host native is UTF16 - wxMBConvUTF16BE converter ; + wxMBConvUTF16BE converter ; return converter.WC2MB( NULL , GetText().c_str() , 0 ) + 2; // add space for trailing unichar 0 } else // == wxDF_TEXT @@ -304,8 +304,8 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const if (format == wxDF_UNICODETEXT) { // host native is UTF16 - wxMBConvUTF16BE converter ; - size_t len = converter.WC2MB( NULL , GetText().c_str() , 0 ) ; + wxMBConvUTF16BE converter ; + size_t len = converter.WC2MB( NULL , GetText().c_str() , 0 ) ; wxCharBuffer buffer = converter.cWX2MB( GetText().c_str() ); memcpy( (char*) buf, (const char*) buffer , len + 2); // trailing unichar 0 } @@ -314,8 +314,8 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const wxCharBuffer buffer = wxConvLibc.cWX2MB( GetText().c_str() ); strcpy( (char*) buf, (const char*) buffer ); } - - return TRUE; + + return true; } bool wxTextDataObject::SetData(const wxDataFormat& format, @@ -324,13 +324,13 @@ bool wxTextDataObject::SetData(const wxDataFormat& format, if (format == wxDF_UNICODETEXT) { // host native is UTF16 - wxMBConvUTF16BE converter ; + wxMBConvUTF16BE converter ; SetText( converter.cMB2WX( (const char*) buf ) ); } else SetText( wxConvLibc.cMB2WX( (const char*) buf ) ); - - return TRUE; + + return true; } #else @@ -344,14 +344,14 @@ bool wxTextDataObject::GetDataHere(void *buf) const { wxStrcpy((wxChar *)buf, GetText().c_str()); - return TRUE; + return true; } bool wxTextDataObject::SetData(size_t WXUNUSED(len), const void *buf) { SetText(wxString((const wxChar *)buf)); - return TRUE; + return true; } #endif @@ -447,11 +447,11 @@ bool wxCustomDataObject::GetDataHere(void *buf) const { void *data = GetData(); if ( !data ) - return FALSE; + return false; memcpy(buf, data, GetSize()); - return TRUE; + return true; } bool wxCustomDataObject::SetData(size_t size, const void *buf) @@ -460,11 +460,11 @@ bool wxCustomDataObject::SetData(size_t size, const void *buf) m_data = Alloc(size); if ( !m_data ) - return FALSE; + return false; memcpy(m_data, buf, m_size = size); - return TRUE; + return true; } // ============================================================================ diff --git a/src/common/docmdi.cpp b/src/common/docmdi.cpp index fb6a41e328..14980bf532 100644 --- a/src/common/docmdi.cpp +++ b/src/common/docmdi.cpp @@ -79,7 +79,7 @@ bool wxDocMDIParentFrame::ProcessEvent(wxEvent& event) if (!m_docManager || !m_docManager->ProcessEvent(event)) return wxEvtHandler::ProcessEvent(event); else - return TRUE; + return true; } void wxDocMDIParentFrame::OnCloseWindow(wxCloseEvent& event) @@ -131,15 +131,15 @@ bool wxDocMDIChildFrame::Create(wxDocument *doc, wxView *view, wxMDIParentFrame { if (view) view->SetFrame(this); - return TRUE; + return true; } - return FALSE; + return false; } wxDocMDIChildFrame::~wxDocMDIChildFrame(void) { - m_childView = (wxView *) NULL; + m_childView = (wxView *) NULL; } // Extend event processing to search the view's event table @@ -149,21 +149,21 @@ bool wxDocMDIChildFrame::ProcessEvent(wxEvent& event) // Break recursion loops if (ActiveEvent == &event) - return FALSE; + return false; ActiveEvent = &event; bool ret; - if ( !m_childView || ! m_childView->ProcessEvent(event) ) + if ( !m_childView || ! m_childView->ProcessEvent(event) ) { // Only hand up to the parent if it's a menu command if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event)) ret = wxEvtHandler::ProcessEvent(event); else - ret = TRUE; + ret = true; } - else - ret = TRUE; + else + ret = true; ActiveEvent = NULL; return ret; @@ -180,16 +180,16 @@ void wxDocMDIChildFrame::OnActivate(wxActivateEvent& event) void wxDocMDIChildFrame::OnCloseWindow(wxCloseEvent& event) { // Close view but don't delete the frame while doing so! - // ...since it will be deleted by wxWidgets if we return TRUE. + // ...since it will be deleted by wxWidgets if we return true. if (m_childView) { bool ans = event.CanVeto() - ? m_childView->Close(FALSE) // FALSE means don't delete associated window - : TRUE; // Must delete. + ? m_childView->Close(false) // false means don't delete associated window + : true; // Must delete. if (ans) { - m_childView->Activate(FALSE); + m_childView->Activate(false); delete m_childView; m_childView = (wxView *) NULL; m_childDocument = (wxDocument *) NULL; diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 767a07f93c..ed5f74fa68 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -133,16 +133,16 @@ static wxString FindExtension(const wxChar *path) wxDocument::wxDocument(wxDocument *parent) { - m_documentModified = FALSE; + m_documentModified = false; m_documentParent = parent; m_documentTemplate = (wxDocTemplate *) NULL; m_commandProcessor = (wxCommandProcessor*) NULL; - m_savedYet = FALSE; + m_savedYet = false; } bool wxDocument::DeleteContents() { - return TRUE; + return true; } wxDocument::~wxDocument() @@ -166,7 +166,7 @@ bool wxDocument::Close() if (OnSaveModified()) return OnCloseDocument(); else - return FALSE; + return false; } bool wxDocument::OnCloseDocument() @@ -174,8 +174,8 @@ bool wxDocument::OnCloseDocument() // Tell all views that we're about to close NotifyClosing(); DeleteContents(); - Modify(FALSE); - return TRUE; + Modify(false); + return true; } // Note that this implicitly deletes the document when the last view is @@ -191,7 +191,7 @@ bool wxDocument::DeleteAllViews() { wxView *view = (wxView *)*it; if (!view->Close()) - return FALSE; + return false; wxList::iterator next = it; ++next; @@ -203,7 +203,7 @@ bool wxDocument::DeleteAllViews() if (manager && manager->GetDocuments().Member(this)) delete this; - return TRUE; + return true; } wxView *wxDocument::GetFirstView() const @@ -221,25 +221,25 @@ wxDocManager *wxDocument::GetDocumentManager() const bool wxDocument::OnNewDocument() { if (!OnSaveModified()) - return FALSE; + return false; - if (OnCloseDocument()==FALSE) return FALSE; + if (OnCloseDocument()==false) return false; DeleteContents(); - Modify(FALSE); - SetDocumentSaved(FALSE); + Modify(false); + SetDocumentSaved(false); wxString name; GetDocumentManager()->MakeDefaultName(name); SetTitle(name); - SetFilename(name, TRUE); + SetFilename(name, true); - return TRUE; + return true; } bool wxDocument::Save() { if (!IsModified() && m_savedYet) - return TRUE; + return true; if ( m_documentFile.empty() || !m_savedYet ) return SaveAs(); @@ -251,7 +251,7 @@ bool wxDocument::SaveAs() { wxDocTemplate *docTemplate = GetDocumentTemplate(); if (!docTemplate) - return FALSE; + return false; #if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXMAC__) wxString filter = docTemplate->GetDescription() + wxT(" (") + docTemplate->GetFileFilter() + wxT(")|") + docTemplate->GetFileFilter(); @@ -265,7 +265,7 @@ bool wxDocument::SaveAs() while (node) { wxDocTemplate *t = (wxDocTemplate*) node->GetData(); - + if (t->IsVisible() && t != docTemplate && t->GetViewClassInfo() == docTemplate->GetViewClassInfo() && t->GetDocClassInfo() == docTemplate->GetDocClassInfo()) @@ -273,7 +273,7 @@ bool wxDocument::SaveAs() // add a '|' to separate this filter from the previous one if ( !filter.IsEmpty() ) filter << wxT('|'); - + filter << t->GetDescription() << wxT(" (") << t->GetFileFilter() << wxT(") |") << t->GetFileFilter(); } @@ -293,7 +293,7 @@ bool wxDocument::SaveAs() GetDocumentWindow()); if (tmp.IsEmpty()) - return FALSE; + return false; wxString fileName(tmp); wxString path, name, ext; @@ -319,7 +319,7 @@ bool wxDocument::SaveAs() // Files that were not saved correctly are not added to the FileHistory. if (!OnSaveDocument(m_documentFile)) - return FALSE; + return false; // A file that doesn't use the default extension of its document template cannot be opened // via the FileHistory, so we do not add it. @@ -332,42 +332,42 @@ bool wxDocument::SaveAs() // The user will probably not be able to open the file again, so // we could warn about the wrong file-extension here. } - return TRUE; + return true; } bool wxDocument::OnSaveDocument(const wxString& file) { if ( !file ) - return FALSE; + return false; if ( !DoSaveDocument(file) ) - return FALSE; + return false; - Modify(FALSE); + Modify(false); SetFilename(file); - SetDocumentSaved(TRUE); + SetDocumentSaved(true); #ifdef __WXMAC__ wxFileName fn(file) ; fn.MacSetDefaultTypeAndCreator() ; #endif - return TRUE; + return true; } bool wxDocument::OnOpenDocument(const wxString& file) { if (!OnSaveModified()) - return FALSE; + return false; if ( !DoOpenDocument(file) ) - return FALSE; + return false; - SetFilename(file, TRUE); - Modify(FALSE); - m_savedYet = TRUE; + SetFilename(file, true); + Modify(false); + m_savedYet = true; UpdateAllViews(); - return TRUE; + return true; } #if wxUSE_STD_IOSTREAM @@ -390,7 +390,7 @@ wxOutputStream& wxDocument::SaveObject(wxOutputStream& stream) bool wxDocument::Revert() { - return FALSE; + return false; } @@ -400,17 +400,17 @@ bool wxDocument::GetPrintableName(wxString& buf) const if (m_documentTitle != wxT("")) { buf = m_documentTitle; - return TRUE; + return true; } else if (m_documentFile != wxT("")) { buf = wxFileNameFromPath(m_documentFile); - return TRUE; + return true; } else { buf = _("unnamed"); - return TRUE; + return true; } } @@ -428,7 +428,7 @@ wxCommandProcessor *wxDocument::OnCreateCommandProcessor() return new wxCommandProcessor; } -// TRUE if safe to close +// true if safe to close bool wxDocument::OnSaveModified() { if (IsModified()) @@ -450,20 +450,20 @@ bool wxDocument::OnSaveModified() GetDocumentWindow()); if (res == wxNO) { - Modify(FALSE); - return TRUE; + Modify(false); + return true; } else if (res == wxYES) return Save(); else if (res == wxCANCEL) - return FALSE; + return false; } - return TRUE; + return true; } bool wxDocument::Draw(wxDC& WXUNUSED(context)) { - return TRUE; + return true; } bool wxDocument::AddView(wxView *view) @@ -473,22 +473,22 @@ bool wxDocument::AddView(wxView *view) m_documentViews.Append(view); OnChangedViewList(); } - return TRUE; + return true; } bool wxDocument::RemoveView(wxView *view) { (void)m_documentViews.DeleteObject(view); OnChangedViewList(); - return TRUE; + return true; } bool wxDocument::OnCreate(const wxString& WXUNUSED(path), long flags) { if (GetDocumentTemplate()->CreateView(this, flags)) - return TRUE; + return true; else - return FALSE; + return false; } // Called after a view is added or removed. @@ -563,17 +563,17 @@ bool wxDocument::DoSaveDocument(const wxString& file) (void)wxMessageBox(_("Sorry, could not open this file for saving."), msgTitle, wxOK | wxICON_EXCLAMATION, GetDocumentWindow()); // Saving error - return FALSE; + return false; } if (!SaveObject(store)) { (void)wxMessageBox(_("Sorry, could not save this file."), msgTitle, wxOK | wxICON_EXCLAMATION, GetDocumentWindow()); // Saving error - return FALSE; + return false; } - return TRUE; + return true; } bool wxDocument::DoOpenDocument(const wxString& file) @@ -594,7 +594,7 @@ bool wxDocument::DoOpenDocument(const wxString& file) { (void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION, GetDocumentWindow()); - return FALSE; + return false; } #if wxUSE_STD_IOSTREAM LoadObject(store); @@ -607,10 +607,10 @@ bool wxDocument::DoOpenDocument(const wxString& file) { (void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION, GetDocumentWindow()); - return FALSE; + return false; } - return TRUE; + return true; } @@ -627,7 +627,7 @@ wxView::wxView() wxView::~wxView() { - GetDocumentManager()->ActivateView(this, FALSE); + GetDocumentManager()->ActivateView(this, false); m_viewDocument->RemoveView(this); } @@ -637,7 +637,7 @@ bool wxView::ProcessEvent(wxEvent& event) if ( !GetDocument() || !GetDocument()->ProcessEvent(event) ) return wxEvtHandler::ProcessEvent(event); - return TRUE; + return true; } void wxView::OnActivateView(bool WXUNUSED(activate), wxView *WXUNUSED(activeView), wxView *WXUNUSED(deactiveView)) @@ -675,9 +675,9 @@ void wxView::SetDocument(wxDocument *doc) bool wxView::Close(bool deleteWindow) { if (OnClose(deleteWindow)) - return TRUE; + return true; else - return FALSE; + return false; } void wxView::Activate(bool activate) @@ -691,7 +691,7 @@ void wxView::Activate(bool activate) bool wxView::OnClose(bool WXUNUSED(deleteWindow)) { - return GetDocument() ? GetDocument()->Close() : TRUE; + return GetDocument() ? GetDocument()->Close() : true; } #if wxUSE_PRINTING_ARCHITECTURE @@ -741,7 +741,7 @@ wxDocument *wxDocTemplate::CreateDocument(const wxString& path, long flags) wxDocument *doc = DoCreateDocument(); if ( doc == NULL ) return (wxDocument *) NULL; - + if (InitDocument(doc, path, flags)) { return doc; @@ -881,9 +881,9 @@ bool wxDocManager::CloseDocument(wxDocument* doc, bool force) if (m_docs.Member(doc)) delete doc; - return TRUE; + return true; } - return FALSE; + return false; } bool wxDocManager::CloseDocuments(bool force) @@ -893,22 +893,22 @@ bool wxDocManager::CloseDocuments(bool force) { wxDocument *doc = (wxDocument *)node->GetData(); wxList::compatibility_iterator next = node->GetNext(); - + if (!CloseDocument(doc, force)) - return FALSE; + return false; // This assumes that documents are not connected in // any way, i.e. deleting one document does NOT // delete another. node = next; } - return TRUE; + return true; } bool wxDocManager::Clear(bool force) { if (!CloseDocuments(force)) - return FALSE; + return false; wxList::compatibility_iterator node = m_templates.GetFirst(); while (node) @@ -918,13 +918,13 @@ bool wxDocManager::Clear(bool force) delete templ; node = next; } - return TRUE; + return true; } bool wxDocManager::Initialize() { m_fileHistory = OnCreateFileHistory(); - return TRUE; + return true; } wxFileHistory *wxDocManager::OnCreateFileHistory() @@ -947,7 +947,7 @@ void wxDocManager::OnFileClose(wxCommandEvent& WXUNUSED(event)) void wxDocManager::OnFileCloseAll(wxCommandEvent& WXUNUSED(event)) { - CloseDocuments(FALSE); + CloseDocuments(false); } void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event)) @@ -998,7 +998,7 @@ void wxDocManager::OnPrint(wxCommandEvent& WXUNUSED(event)) if (printout) { wxPrinter printer; - printer.Print(view->GetFrame(), printout, TRUE); + printer.Print(view->GetFrame(), printout, true); delete printout; } @@ -1016,7 +1016,7 @@ void wxDocManager::OnPrintSetup(wxCommandEvent& WXUNUSED(event)) wxPrintDialogData data; wxPrintDialog printerDialog(parentWin, &data); - printerDialog.GetPrintDialogData().SetSetupDialog(TRUE); + printerDialog.GetPrintDialogData().SetSetupDialog(true); printerDialog.ShowModal(); #endif // wxUSE_PRINTING_ARCHITECTURE } @@ -1044,7 +1044,7 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event)) wxPoint(100, 100), wxSize(600, 650)); frame->Centre(wxBOTH); frame->Initialize(); - frame->Show(TRUE); + frame->Show(true); } #endif // wxUSE_PRINTING_ARCHITECTURE } @@ -1075,7 +1075,7 @@ void wxDocManager::OnRedo(wxCommandEvent& event) void wxDocManager::OnUpdateFileOpen(wxUpdateUIEvent& event) { - event.Enable( TRUE ); + event.Enable( true ); } void wxDocManager::OnUpdateFileClose(wxUpdateUIEvent& event) @@ -1092,7 +1092,7 @@ void wxDocManager::OnUpdateFileRevert(wxUpdateUIEvent& event) void wxDocManager::OnUpdateFileNew(wxUpdateUIEvent& event) { - event.Enable( TRUE ); + event.Enable( true ); } void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event) @@ -1111,7 +1111,7 @@ void wxDocManager::OnUpdateUndo(wxUpdateUIEvent& event) { wxDocument *doc = GetCurrentDocument(); if (!doc) - event.Enable(FALSE); + event.Enable(false); else if (!doc->GetCommandProcessor()) event.Skip(); else @@ -1125,7 +1125,7 @@ void wxDocManager::OnUpdateRedo(wxUpdateUIEvent& event) { wxDocument *doc = GetCurrentDocument(); if (!doc) - event.Enable(FALSE); + event.Enable(false); else if (!doc->GetCommandProcessor()) event.Skip(); else @@ -1143,7 +1143,7 @@ void wxDocManager::OnUpdatePrint(wxUpdateUIEvent& event) void wxDocManager::OnUpdatePrintSetup(wxUpdateUIEvent& event) { - event.Enable( TRUE ); + event.Enable( true ); } void wxDocManager::OnUpdatePreview(wxUpdateUIEvent& event) @@ -1171,7 +1171,7 @@ bool wxDocManager::ProcessEvent(wxEvent& event) if (view) { if (view->ProcessEvent(event)) - return TRUE; + return true; } return wxEvtHandler::ProcessEvent(event); } @@ -1213,7 +1213,7 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags) { if (docToClose) { - if (!CloseDocument(docToClose, FALSE)) + if (!CloseDocument(docToClose, false)) { delete[] templates; return NULL; @@ -1239,7 +1239,7 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags) { if (docToClose) { - if (!CloseDocument(docToClose, FALSE)) + if (!CloseDocument(docToClose, false)) { return NULL; } @@ -1287,7 +1287,7 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags) { if (docToClose) { - if (!CloseDocument(docToClose, FALSE)) + if (!CloseDocument(docToClose, false)) { return NULL; } @@ -1369,7 +1369,7 @@ void wxDocManager::DeleteTemplate(wxDocTemplate *WXUNUSED(temp), long WXUNUSED(f // Not yet implemented bool wxDocManager::FlushDoc(wxDocument *WXUNUSED(doc)) { - return FALSE; + return false; } wxDocument *wxDocManager::GetCurrentDocument() const @@ -1387,7 +1387,7 @@ bool wxDocManager::MakeDefaultName(wxString& name) name.Printf(_("unnamed%d"), m_defaultDocumentNameCounter); m_defaultDocumentNameCounter++; - return TRUE; + return true; } // Make a frame title (override this to do something different) @@ -1627,14 +1627,14 @@ wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates, if (templates[i]->IsVisible()) { int j; - bool want = TRUE; + bool want = true; for (j = 0; j < n; j++) { //filter out NOT unique documents + view combinations if ( templates[i]->m_docTypeName == data[j]->m_docTypeName && templates[i]->m_viewTypeName == data[j]->m_viewTypeName ) - want = FALSE; + want = false; } if ( want ) @@ -1709,12 +1709,12 @@ wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates, if ( templ->IsVisible() && !templ->GetViewName().empty() ) { int j; - bool want = TRUE; + bool want = true; for (j = 0; j < n; j++) { //filter out NOT unique views if ( templates[i]->m_viewTypeName == data[j]->m_viewTypeName ) - want = FALSE; + want = false; } if ( want ) @@ -1847,7 +1847,7 @@ wxDocChildFrame::~wxDocChildFrame() bool wxDocChildFrame::ProcessEvent(wxEvent& event) { if (m_childView) - m_childView->Activate(TRUE); + m_childView->Activate(true); if ( !m_childView || ! m_childView->ProcessEvent(event) ) { @@ -1855,10 +1855,10 @@ bool wxDocChildFrame::ProcessEvent(wxEvent& event) if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event)) return wxEvtHandler::ProcessEvent(event); else - return TRUE; + return true; } else - return TRUE; + return true; } void wxDocChildFrame::OnActivate(wxActivateEvent& event) @@ -1874,12 +1874,12 @@ void wxDocChildFrame::OnCloseWindow(wxCloseEvent& event) if (m_childView) { bool ans = event.CanVeto() - ? m_childView->Close(FALSE) // FALSE means don't delete associated window - : TRUE; // Must delete. + ? m_childView->Close(false) // false means don't delete associated window + : true; // Must delete. if (ans) { - m_childView->Activate(FALSE); + m_childView->Activate(false); delete m_childView; m_childView = (wxView *) NULL; m_childDocument = (wxDocument *) NULL; @@ -1959,7 +1959,7 @@ bool wxDocParentFrame::ProcessEvent(wxEvent& event) if (!m_docManager || !m_docManager->ProcessEvent(event)) return wxEvtHandler::ProcessEvent(event); else - return TRUE; + return true; } // Define the behaviour for the frame closing @@ -2018,7 +2018,7 @@ bool wxDocPrintout::OnPrintPage(int WXUNUSED(page)) { m_printoutView->OnDraw(dc); } - return TRUE; + return true; } bool wxDocPrintout::HasPage(int pageNum) @@ -2029,9 +2029,9 @@ bool wxDocPrintout::HasPage(int pageNum) bool wxDocPrintout::OnBeginDocument(int startPage, int endPage) { if (!wxPrintout::OnBeginDocument(startPage, endPage)) - return FALSE; + return false; - return TRUE; + return true; } void wxDocPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) @@ -2343,7 +2343,7 @@ bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream) { wxFFile file(filename, _T("rb")); if ( !file.IsOpened() ) - return FALSE; + return false; char buf[4096]; @@ -2352,22 +2352,22 @@ bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream) { nRead = file.Read(buf, WXSIZEOF(buf)); if ( file.Error() ) - return FALSE; + return false; stream.write(buf, nRead); if ( !stream ) - return FALSE; + return false; } while ( !file.Eof() ); - return TRUE; + return true; } bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename) { wxFFile file(filename, _T("wb")); if ( !file.IsOpened() ) - return FALSE; + return false; char buf[4096]; do @@ -2376,12 +2376,12 @@ bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename) if ( !stream.bad() ) // fail may be set on EOF, don't use operator!() { if ( !file.Write(buf, stream.gcount()) ) - return FALSE; + return false; } } while ( !stream.eof() ); - return TRUE; + return true; } #else // !wxUSE_STD_IOSTREAM @@ -2390,7 +2390,7 @@ bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream) { wxFFile file(filename, _T("rb")); if ( !file.IsOpened() ) - return FALSE; + return false; char buf[4096]; @@ -2399,22 +2399,22 @@ bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream) { nRead = file.Read(buf, WXSIZEOF(buf)); if ( file.Error() ) - return FALSE; + return false; stream.Write(buf, nRead); if ( !stream ) - return FALSE; + return false; } while ( !file.Eof() ); - return TRUE; + return true; } bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename) { wxFFile file(filename, _T("wb")); if ( !file.IsOpened() ) - return FALSE; + return false; char buf[4096]; do @@ -2423,11 +2423,11 @@ bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename) const size_t nRead = stream.LastRead(); if ( !nRead || !file.Write(buf, nRead) ) - return FALSE; + return false; } while ( !stream.Eof() ); - return TRUE; + return true; } #endif // wxUSE_STD_IOSTREAM/!wxUSE_STD_IOSTREAM diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index 32019ad7e7..95f14b9e21 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -326,7 +326,7 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const wxCHECK_MSG( IsLoaded(), NULL, _T("Can't load symbol from unloaded library") ); - bool failed = FALSE; + bool failed = false; void *symbol = 0; wxUnusedVar(symbol); @@ -383,7 +383,7 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const wxLogError(wxT("%s"), err); } #else - failed = TRUE; + failed = true; wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"), name.c_str()); #endif diff --git a/src/common/dynload.cpp b/src/common/dynload.cpp index 5bb2496dff..854d7c3049 100644 --- a/src/common/dynload.cpp +++ b/src/common/dynload.cpp @@ -60,7 +60,7 @@ public: { wxPluginLibrary::ms_classes = new wxDLImports; wxPluginManager::CreateManifest(); - return TRUE; + return true; } virtual void OnExit() @@ -123,10 +123,10 @@ bool wxPluginLibrary::UnrefLib() if ( m_linkcount == 0 || --m_linkcount == 0 ) { delete this; - return TRUE; + return true; } - return FALSE; + return false; } // ------------------------ @@ -316,7 +316,7 @@ bool wxPluginManager::UnloadLibrary(const wxString& libname) wxLogDebug(_T("Attempt to unload library '%s' which is not loaded."), libname.c_str()); - return FALSE; + return false; } wxLogTrace(_T("dll"), _T("UnloadLibrary(%s)"), realname.c_str()); @@ -324,12 +324,12 @@ bool wxPluginManager::UnloadLibrary(const wxString& libname) if ( !entry->UnrefLib() ) { // not really unloaded yet - return FALSE; + return false; } ms_manifest->erase(ms_manifest->find(realname)); - return TRUE; + return true; } // ------------------------ @@ -420,7 +420,7 @@ wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name, bool *success) wxFAIL_MSG( _T("Using a library not loaded with wxDllLoader?") ); if ( success ) - *success = FALSE; + *success = false; return NULL; } @@ -551,7 +551,7 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name) wxString libname = ConstructLibraryName(name); - bool success = FALSE; + bool success = false; wxDllType handle = wxDllLoader::LoadLibrary(libname, &success); if(success) { -- 2.45.2