projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes to handling of focus changes for toplevel windows
[wxWidgets.git]
/
src
/
common
/
variant.cpp
diff --git
a/src/common/variant.cpp
b/src/common/variant.cpp
index fcff39ff5f03bf1411d3ec4b8ac87fd4a7cb4b47..689278480774da6a886ce8ab89dc31c1ec6632ea 100644
(file)
--- a/
src/common/variant.cpp
+++ b/
src/common/variant.cpp
@@
-23,6
+23,7
@@
#ifndef WX_PRECOMP
#include "wx/string.h"
#include "wx/math.h"
#ifndef WX_PRECOMP
#include "wx/string.h"
#include "wx/math.h"
+ #include "wx/crt.h"
#if wxUSE_STREAMS
#include "wx/stream.h"
#endif
#if wxUSE_STREAMS
#include "wx/stream.h"
#endif
@@
-226,7
+227,7
@@
public:
virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS
virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS
- virtual wxString GetType() const { return wxT("long"); }
;
+ virtual wxString GetType() const { return wxT("long"); }
protected:
long m_value;
protected:
long m_value;
@@
-286,7
+287,7
@@
bool wxVariantDataLong::Read(wxInputStream& str)
bool wxVariantDataLong::Read(wxString& str)
{
bool wxVariantDataLong::Read(wxString& str)
{
- m_value = wxAtol(
(const wxChar*)
str);
+ m_value = wxAtol(str);
return true;
}
return true;
}
@@
-377,7
+378,7
@@
public:
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS
- virtual wxString GetType() const { return wxT("double"); }
;
+ virtual wxString GetType() const { return wxT("double"); }
protected:
double m_value;
protected:
double m_value;
@@
-436,7
+437,7
@@
bool wxVariantDoubleData::Read(wxInputStream& str)
bool wxVariantDoubleData::Read(wxString& str)
{
bool wxVariantDoubleData::Read(wxString& str)
{
- m_value = wxAtof(
(const wxChar*)
str);
+ m_value = wxAtof(str);
return true;
}
return true;
}
@@
-517,7
+518,7
@@
public:
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
- virtual wxString GetType() const { return wxT("bool"); }
;
+ virtual wxString GetType() const { return wxT("bool"); }
protected:
bool m_value;
protected:
bool m_value;
@@
-579,7
+580,7
@@
bool wxVariantDataBool::Read(wxInputStream& str)
bool wxVariantDataBool::Read(wxString& str)
{
bool wxVariantDataBool::Read(wxString& str)
{
- m_value = (wxAtol(
(const wxChar*)
str) != 0);
+ m_value = (wxAtol(str) != 0);
return true;
}
return true;
}
@@
-658,7
+659,7
@@
public:
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
- virtual wxString GetType() const { return wxT("char"); }
;
+ virtual wxString GetType() const { return wxT("char"); }
protected:
wxChar m_value;
protected:
wxChar m_value;
@@
-793,13
+794,13
@@
public:
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
#if wxUSE_STD_IOSTREAM
- virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; }
;
+ virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; }
#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
- virtual wxString GetType() const { return wxT("string"); }
;
+ virtual wxString GetType() const { return wxT("string"); }
protected:
wxString m_value;
protected:
wxString m_value;
@@
-1066,7
+1067,7
@@
public:
virtual bool Read(wxSTD istream& str);
#endif
virtual bool Read(wxString& str);
virtual bool Read(wxSTD istream& str);
#endif
virtual bool Read(wxString& str);
- virtual wxString GetType() const { return wxT("void*"); }
;
+ virtual wxString GetType() const { return wxT("void*"); }
virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; }
protected:
virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; }
protected:
@@
-1190,7
+1191,7
@@
public:
virtual bool Read(wxSTD istream& str);
#endif
virtual bool Read(wxString& str);
virtual bool Read(wxSTD istream& str);
#endif
virtual bool Read(wxString& str);
- virtual wxString GetType() const { return wxT("datetime"); }
;
+ virtual wxString GetType() const { return wxT("datetime"); }
virtual wxVariantData* Clone() { return new wxVariantDataDateTime; }
protected:
virtual wxVariantData* Clone() { return new wxVariantDataDateTime; }
protected:
@@
-1239,7
+1240,7
@@
bool wxVariantDataDateTime::Read(wxSTD istream& WXUNUSED(str))
bool wxVariantDataDateTime::Read(wxString& str)
{
bool wxVariantDataDateTime::Read(wxString& str)
{
- if(! m_value.ParseDateTime(str))
+ if(! m_value.ParseDateTime(str
.c_str()/*FIXME-UTF8*/
))
return false;
return true;
}
return false;
return true;
}
@@
-1356,7
+1357,7
@@
public:
virtual bool Read(wxSTD istream& str);
#endif
virtual bool Read(wxString& str);
virtual bool Read(wxSTD istream& str);
#endif
virtual bool Read(wxString& str);
- virtual wxString GetType() const { return wxT("arrstring"); }
;
+ virtual wxString GetType() const { return wxT("arrstring"); }
virtual wxVariantData* Clone() { return new wxVariantDataArrayString; }
protected:
virtual wxVariantData* Clone() { return new wxVariantDataArrayString; }
protected:
@@
-1485,7
+1486,7
@@
public:
virtual bool Read(wxSTD istream& str);
#endif
virtual bool Read(wxString& str);
virtual bool Read(wxSTD istream& str);
#endif
virtual bool Read(wxString& str);
- virtual wxString GetType() const { return wxT("list"); }
;
+ virtual wxString GetType() const { return wxT("list"); }
void Clear();
void Clear();
@@
-1757,7
+1758,7
@@
bool wxVariant::Convert(long* value) const
*value = (long) (((wxVariantDataBool*)GetData())->GetValue());
#endif
else if (type == wxT("string"))
*value = (long) (((wxVariantDataBool*)GetData())->GetValue());
#endif
else if (type == wxT("string"))
- *value = wxAtol((
const wxChar*) (
(wxVariantDataString*)GetData())->GetValue());
+ *value = wxAtol(((wxVariantDataString*)GetData())->GetValue());
else
return false;
else
return false;
@@
-1804,7
+1805,7
@@
bool wxVariant::Convert(double* value) const
*value = (double) (((wxVariantDataBool*)GetData())->GetValue());
#endif
else if (type == wxT("string"))
*value = (double) (((wxVariantDataBool*)GetData())->GetValue());
#endif
else if (type == wxT("string"))
- *value = (double) wxAtof((
const wxChar*) (
(wxVariantDataString*)GetData())->GetValue());
+ *value = (double) wxAtof(((wxVariantDataString*)GetData())->GetValue());
else
return false;
else
return false;
@@
-1846,7
+1847,9
@@
bool wxVariant::Convert(wxDateTime* value) const
// Fallback to string conversion
wxString val;
return Convert(&val) &&
// Fallback to string conversion
wxString val;
return Convert(&val) &&
- (value->ParseDateTime(val) || value->ParseDate(val) || value->ParseTime(val));
+ (value->ParseDateTime(val.c_str()/*FIXME-UTF8*/) ||
+ value->ParseDate(val.c_str()/*FIXME-UTF8*/) ||
+ value->ParseTime(val.c_str()/*FIXME-UTF8*/));
}
#endif // wxUSE_DATETIME
}
#endif // wxUSE_DATETIME