summaryrefslogtreecommitdiff
path: root/glib/src/date.ccg
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@src.gnome.org>2006-05-12 08:08:45 +0000
committerMurray Cumming <murrayc@src.gnome.org>2006-05-12 08:08:45 +0000
commit732822b53ea288a33d370048eca6f119fbe612bb (patch)
tree8db5098505211c14693338c71001707313531097 /glib/src/date.ccg
parent10d607afe1ade71a232f05b2d398693a4a26b964 (diff)
downloadglibmm-732822b53ea288a33d370048eca6f119fbe612bb.tar.gz
Merged changes from glibmm-2-10 branch.
Diffstat (limited to 'glib/src/date.ccg')
-rw-r--r--glib/src/date.ccg11
1 files changed, 11 insertions, 0 deletions
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<Glib::Error> error; //TODO: Check it?
+ const std::string locale_format = locale_from_utf8(format, error);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+
gsize bufsize = std::max<gsize>(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<Glib::Error> error; //TODO: Check it?
+ return locale_to_utf8(std::string(buf.get(), len), error);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
}
while((bufsize *= 2) <= 65536);