X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e02afc7a273702ca567431b209415b7bd2b290d0..0ed9a934caaaf8bc3a88a239bed84eefa6a06df2:/src/common/variant.cpp diff --git a/src/common/variant.cpp b/src/common/variant.cpp index 2612f8db24..48a709bd5f 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -6,7 +6,7 @@ // Created: 10/09/98 // RCS-ID: $Id$ // Copyright: (c) -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -17,16 +17,13 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_IOSTREAMH # include #else # include -# ifdef _MSC_VER - using namespace std; -# endif #endif #include "wx/stream.h" @@ -460,6 +457,7 @@ bool wxVariantDataReal::Read(wxString& str) return TRUE; } +#ifdef HAVE_BOOL /* * wxVariantDataBool */ @@ -550,6 +548,7 @@ bool wxVariantDataBool::Read(wxString& str) m_value = (atol((const char*) str) != 0); return TRUE; } +#endif // HAVE_BOOL /* * wxVariantDataChar @@ -994,11 +993,13 @@ wxVariant::wxVariant(long val, const wxString& name) m_name = name; } +#ifdef HAVE_BOOL wxVariant::wxVariant(bool val, const wxString& name) { m_data = new wxVariantDataBool(val); m_name = name; } +#endif wxVariant::wxVariant(char val, const wxString& name) { @@ -1208,6 +1209,7 @@ void wxVariant::operator= (char value) } } +#ifdef HAVE_BOOL bool wxVariant::operator== (bool value) const { bool thisValue; @@ -1235,6 +1237,7 @@ void wxVariant::operator= (bool value) m_data = new wxVariantDataBool(value); } } +#endif // HAVE_BOOL bool wxVariant::operator== (const wxString& value) const { @@ -1683,8 +1686,10 @@ bool wxVariant::Convert(long* value) const *value = (long) (((wxVariantDataReal*)GetData())->GetValue()); else if (type == "long") *value = ((wxVariantDataLong*)GetData())->GetValue(); +#ifdef HAVE_BOOL else if (type == "bool") *value = (long) (((wxVariantDataBool*)GetData())->GetValue()); +#endif else if (type == "string") *value = atol((const char*) ((wxVariantDataString*)GetData())->GetValue()); else @@ -1700,8 +1705,10 @@ bool wxVariant::Convert(bool* value) const *value = ((int) (((wxVariantDataReal*)GetData())->GetValue()) != 0); else if (type == "long") *value = (((wxVariantDataLong*)GetData())->GetValue() != 0); +#ifdef HAVE_BOOL else if (type == "bool") *value = ((wxVariantDataBool*)GetData())->GetValue(); +#endif else if (type == "string") { wxString val(((wxVariantDataString*)GetData())->GetValue()); @@ -1726,8 +1733,10 @@ bool wxVariant::Convert(double* value) const *value = ((wxVariantDataReal*)GetData())->GetValue(); else if (type == "long") *value = (double) (((wxVariantDataLong*)GetData())->GetValue()); +#ifdef HAVE_BOOL else if (type == "bool") *value = (double) (((wxVariantDataBool*)GetData())->GetValue()); +#endif else if (type == "string") *value = (double) atof((const char*) ((wxVariantDataString*)GetData())->GetValue()); else @@ -1743,8 +1752,10 @@ bool wxVariant::Convert(char* value) const *value = ((wxVariantDataChar*)GetData())->GetValue(); else if (type == "long") *value = (char) (((wxVariantDataLong*)GetData())->GetValue()); +#ifdef HAVE_BOOL else if (type == "bool") *value = (char) (((wxVariantDataBool*)GetData())->GetValue()); +#endif else return FALSE;