X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=boost%2Fformat%2Finternals.hpp;h=1c67006aee654730c334c15765ecda677121b128;hb=08c1e93fa36a49f49325a07fe91ff92c964c2b6c;hp=b0d874a1fb4a26020a6a3026e444c65391029c6a;hpb=bb4dd8289b351fae6b55e303f189127a394a1edd;p=platform%2Fupstream%2Fboost.git diff --git a/boost/format/internals.hpp b/boost/format/internals.hpp index b0d874a..1c67006 100644 --- a/boost/format/internals.hpp +++ b/boost/format/internals.hpp @@ -104,6 +104,15 @@ namespace detail { template void stream_format_state:: apply_on (basic_ios & os, boost::io::detail::locale_t * loc_default) const { + // If a locale is available, set it first. "os.fill(fill_);" may chrash otherwise. +#if !defined(BOOST_NO_STD_LOCALE) + if(loc_) + os.imbue(loc_.get()); + else if(loc_default) + os.imbue(*loc_default); +#else + (void) loc_default; // keep compiler quiet if we don't support locales +#endif // set the state of this stream according to our params if(width_ != -1) os.width(width_); @@ -114,14 +123,6 @@ namespace detail { os.flags(flags_); os.clear(rdstate_); os.exceptions(exceptions_); -#if !defined(BOOST_NO_STD_LOCALE) - if(loc_) - os.imbue(loc_.get()); - else if(loc_default) - os.imbue(*loc_default); -#else - (void) loc_default; // keep compiler quiet if we don't support locales -#endif } template