diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-02-24 16:36:15 +0200 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-02-24 16:36:15 +0200 |
commit | df29381dc0027fd1e33cc68b2c0b22e85ad622ad (patch) | |
tree | a9bbe6f248702c3787c9103c9b90c182ca3cfc04 /indra | |
parent | 4ad0d181dbb0ac4b093d029f2eb42548af57560b (diff) | |
parent | 7bb3d971100f3d061de1b63fc13af3fdb3a5d03a (diff) |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llgroupmgr.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index ea5462a3e3..aeac3841f9 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -56,6 +56,16 @@ #include "lluictrlfactory.h" #include <boost/regex.hpp> +#if LL_MSVC +// disable boost::lexical_cast warning +#pragma warning (disable:4702) +#endif + +#include <boost/lexical_cast.hpp> + +#if LL_MSVC +#pragma warning(pop) // Restore all warnings to the previous state +#endif const U32 MAX_CACHED_GROUPS = 10; @@ -833,13 +843,13 @@ static void formatDateString(std::string &date_string) const regex expression("([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})"); if (regex_match(date_string.c_str(), result, expression)) { - std::string year = result[3]; - std::string month = result[1]; - std::string day = result[2]; + // convert matches to integers so that we can pad them with zeroes on Linux + S32 year = boost::lexical_cast<S32>(result[3]); + S32 month = boost::lexical_cast<S32>(result[1]); + S32 day = boost::lexical_cast<S32>(result[2]); // ISO 8601 date format - //date_string = llformat("%02s/%02s/%04s", month.c_str(), day.c_str(), year.c_str()); - date_string = llformat("%04s/%02s/%04s", year.c_str(), month.c_str(), day.c_str()); + date_string = llformat("%04d/%02d/%02d", year, month, day); } } |