// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "variant.h"
-#endif
-
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#include "wx/string.h"
#include "wx/tokenzr.h"
+#include "wx/math.h"
#include "wx/variant.h"
wxVariantDataList(const wxList& list);
~wxVariantDataList();
- wxList& GetValue() const { return (wxList&) m_value; }
+ wxList& GetValue() { return m_value; }
void SetValue(const wxList& value) ;
virtual void Copy(wxVariantData& data);
wxVariantDataReal& otherData = (wxVariantDataReal&) data;
- return (otherData.m_value == m_value);
+ return wxIsSameDouble(otherData.m_value, m_value);
}
#if wxUSE_STD_IOSTREAM
bool wxVariantDataVoidPtr::Write(wxString& str) const
{
- str.Printf(wxT("%ld"), (long) m_value);
+ str.Printf(wxT("%p"), m_value);
return true;
}
bool wxVariantDataWxObjectPtr::Write(wxString& str) const
{
- str.Printf(wxT("%s(%ld)"), GetType().c_str(), (long) m_value);
+ str.Printf(wxT("%s(%p)"), GetType().c_str(), m_value);
return true;
}
double thisValue;
if (!Convert(&thisValue))
return false;
- else
- return (value == thisValue);
+
+ return wxIsSameDouble(value, thisValue);
}
bool wxVariant::operator!= (double value) const
void wxVariant::NullList()
{
SetData(new wxVariantDataList());
-};
+}
// Append to list
void wxVariant::Append(const wxVariant& value)
{
wxString val(((wxVariantDataString*)GetData())->GetValue());
val.MakeLower();
- if (val == wxT("true") || val == wxT("yes"))
+ if (val == wxT("true") || val == wxT("yes") || val == wxT('1') )
*value = true;
- else if (val == wxT("false") || val == wxT("no"))
+ else if (val == wxT("false") || val == wxT("no") || val == wxT('0') )
*value = false;
else
return false;