projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't link with media lib with USE_MEDIA==0.
[wxWidgets.git]
/
src
/
common
/
variant.cpp
diff --git
a/src/common/variant.cpp
b/src/common/variant.cpp
index ae13b2a4337403e6bc84607db6743d7d2a3b84d2..2c540d3f3c12d9d9194e051c46f72683861c2331 100644
(file)
--- a/
src/common/variant.cpp
+++ b/
src/common/variant.cpp
@@
-9,10
+9,6
@@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// 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"
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
@@
-40,6
+36,7
@@
using namespace std ;
#include "wx/string.h"
#include "wx/tokenzr.h"
#include "wx/string.h"
#include "wx/tokenzr.h"
+#include "wx/math.h"
#include "wx/variant.h"
#include "wx/variant.h"
@@
-59,7
+56,7
@@
public:
wxVariantDataList(const wxList& list);
~wxVariantDataList();
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);
void SetValue(const wxList& value) ;
virtual void Copy(wxVariantData& data);
@@
-458,7
+455,7
@@
bool wxVariantDataReal::Eq(wxVariantData& data) const
wxVariantDataReal& otherData = (wxVariantDataReal&) data;
wxVariantDataReal& otherData = (wxVariantDataReal&) data;
- return
(otherData.m_value ==
m_value);
+ return
wxIsSameDouble(otherData.m_value,
m_value);
}
#if wxUSE_STD_IOSTREAM
}
#if wxUSE_STD_IOSTREAM
@@
-473,7
+470,7
@@
bool wxVariantDataReal::Write(wxSTD ostream& str) const
bool wxVariantDataReal::Write(wxString& str) const
{
bool wxVariantDataReal::Write(wxString& str) const
{
- str.Printf(wxT("%.
4f
"), m_value);
+ str.Printf(wxT("%.
14g
"), m_value);
return true;
}
return true;
}
@@
-709,7
+706,7
@@
bool wxVariantDataChar::Read(wxInputStream& str)
bool wxVariantDataChar::Read(wxString& str)
{
bool wxVariantDataChar::Read(wxString& str)
{
- m_value = str.ToAscii()[
0u
];
+ m_value = str.ToAscii()[
size_t(0)
];
return true;
}
return true;
}
@@
-878,7
+875,7
@@
bool wxVariantDataVoidPtr::Write(wxSTD ostream& str) const
bool wxVariantDataVoidPtr::Write(wxString& str) const
{
bool wxVariantDataVoidPtr::Write(wxString& str) const
{
- str.Printf(wxT("%
ld"), (long)
m_value);
+ str.Printf(wxT("%
p"),
m_value);
return true;
}
return true;
}
@@
-982,7
+979,7
@@
bool wxVariantDataWxObjectPtr::Write(wxSTD ostream& str) const
bool wxVariantDataWxObjectPtr::Write(wxString& str) const
{
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;
}
return true;
}
@@
-1395,8
+1392,8
@@
bool wxVariant::operator== (double value) const
double thisValue;
if (!Convert(&thisValue))
return false;
double thisValue;
if (!Convert(&thisValue))
return false;
- else
-
return (value ==
thisValue);
+
+
return wxIsSameDouble(value,
thisValue);
}
bool wxVariant::operator!= (double value) const
}
bool wxVariant::operator!= (double value) const
@@
-1938,7
+1935,7
@@
wxStringList& wxVariant::GetStringList() const
void wxVariant::NullList()
{
SetData(new wxVariantDataList());
void wxVariant::NullList()
{
SetData(new wxVariantDataList());
-}
;
+}
// Append to list
void wxVariant::Append(const wxVariant& value)
// Append to list
void wxVariant::Append(const wxVariant& value)
@@
-2038,9
+2035,9
@@
bool wxVariant::Convert(bool* value) const
{
wxString val(((wxVariantDataString*)GetData())->GetValue());
val.MakeLower();
{
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;
*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;
*value = false;
else
return false;