From 732822b53ea288a33d370048eca6f119fbe612bb Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 12 May 2006 08:08:45 +0000 Subject: Merged changes from glibmm-2-10 branch. --- glib/src/date.ccg | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'glib/src/date.ccg') diff --git a/glib/src/date.ccg b/glib/src/date.ccg index e70a0e26..b59810ab 100644 --- a/glib/src/date.ccg +++ b/glib/src/date.ccg @@ -280,7 +280,13 @@ Glib::ustring Date::format_string(const Glib::ustring& format) const struct tm tm_data; g_date_to_struct_tm(&gobject_, &tm_data); + #ifdef GLIBMM_EXCEPTIONS_ENABLED const std::string locale_format = locale_from_utf8(format); + #else + std::auto_ptr error; //TODO: Check it? + const std::string locale_format = locale_from_utf8(format, error); + #endif //GLIBMM_EXCEPTIONS_ENABLED + gsize bufsize = std::max(2 * locale_format.size(), 128); do @@ -295,7 +301,12 @@ Glib::ustring Date::format_string(const Glib::ustring& format) const if(len != 0 || buf.get()[0] == '\0') { g_assert(len < bufsize); + #ifdef GLIBMM_EXCEPTIONS_ENABLED return locale_to_utf8(std::string(buf.get(), len)); + #else + std::auto_ptr error; //TODO: Check it? + return locale_to_utf8(std::string(buf.get(), len), error); + #endif //GLIBMM_EXCEPTIONS_ENABLED } } while((bufsize *= 2) <= 65536); -- cgit v1.2.1