From c2ad65492410eb40de5fea037a39c7a1a0693a43 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 23 Aug 2014 23:36:06 +0100 Subject: [PATCH] Fix some errant stringstreams. --- src/lib/dcpomatic_time.h | 3 ++- src/lib/image.cc | 1 - src/lib/safe_stringstream.h | 5 +++++ src/lib/subrip_content.cc | 1 - src/lib/subtitle_content.cc | 4 ++-- src/lib/update.cc | 1 - 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib/dcpomatic_time.h b/src/lib/dcpomatic_time.h index 4c7ea4ba5..55476d5b5 100644 --- a/src/lib/dcpomatic_time.h +++ b/src/lib/dcpomatic_time.h @@ -26,6 +26,7 @@ #include #include #include "frame_rate_change.h" +#include "safe_stringstream.h" class dcpomatic_round_up_test; @@ -86,7 +87,7 @@ public: int f; split (r, h, m, s, f); - std::ostringstream o; + SafeStringStream o; o.width (2); o.fill ('0'); o << std::setw(2) << std::setfill('0') << h << ":" diff --git a/src/lib/image.cc b/src/lib/image.cc index 680c063f1..2eb2dbe28 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -41,7 +41,6 @@ using std::min; using std::cout; using std::cerr; using std::list; -using std::stringstream; using boost::shared_ptr; using dcp::Size; diff --git a/src/lib/safe_stringstream.h b/src/lib/safe_stringstream.h index e455de964..0ffcb6224 100644 --- a/src/lib/safe_stringstream.h +++ b/src/lib/safe_stringstream.h @@ -84,6 +84,11 @@ public: _stream.width (w); } + void fill (int f) + { + _stream.fill (f); + } + void precision (int p) { _stream.precision (p); diff --git a/src/lib/subrip_content.cc b/src/lib/subrip_content.cc index c60b05d50..14cb50b86 100644 --- a/src/lib/subrip_content.cc +++ b/src/lib/subrip_content.cc @@ -25,7 +25,6 @@ #include "i18n.h" -using std::stringstream; using std::string; using std::cout; using dcp::raw_convert; diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc index 3415ae613..24b4694e8 100644 --- a/src/lib/subtitle_content.cc +++ b/src/lib/subtitle_content.cc @@ -22,11 +22,11 @@ #include "subtitle_content.h" #include "util.h" #include "exceptions.h" +#include "safe_stringstream.h" #include "i18n.h" using std::string; -using std::stringstream; using std::vector; using std::cout; using boost::shared_ptr; @@ -160,7 +160,7 @@ SubtitleContent::set_subtitle_scale (double s) string SubtitleContent::identifier () const { - stringstream s; + SafeStringStream s; s << Content::identifier() << "_" << raw_convert (subtitle_scale()) << "_" << raw_convert (subtitle_x_offset()) diff --git a/src/lib/update.cc b/src/lib/update.cc index 0146df484..c50022091 100644 --- a/src/lib/update.cc +++ b/src/lib/update.cc @@ -32,7 +32,6 @@ using std::cout; using std::min; using std::string; -using std::stringstream; using dcp::raw_convert; /** Singleton instance */ -- 2.30.2