summaryrefslogtreecommitdiff
path: root/src/parse/subtitle.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-11 23:59:19 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-11 23:59:19 +0100
commit4de8f0118e1baf31cf4c859881dfbf39014b566f (patch)
tree91be88947914d05ff942cbefff6c71eab187cc3c /src/parse/subtitle.cc
parent3390da35584709ea0626ec1fefd3bf5d797bcc00 (diff)
Use raw_convert instead of boost::lexical_cast as it seems
that lexical_cast will sometimes use a thousands separator (i.e. it will convert 1234 to a string 1,234). It appears not to be possible safely to turn this off (you have to set the global locale). Instead, raw_convert uses a stringstream which you can imbue() with std::locale::classic() to turn off the locale-specific behaviour.
Diffstat (limited to 'src/parse/subtitle.cc')
-rw-r--r--src/parse/subtitle.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parse/subtitle.cc b/src/parse/subtitle.cc
index 914be677..a4b0410a 100644
--- a/src/parse/subtitle.cc
+++ b/src/parse/subtitle.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
#include "subtitle.h"
+#include "../raw_convert.h"
#include "../types.h"
using std::string;
@@ -114,7 +115,7 @@ Subtitle::fade_time (shared_ptr<const cxml::Node> node, string name)
} else if (u.find (":") != string::npos) {
t = Time (u);
} else {
- t = Time (0, 0, 0, lexical_cast<int> (u));
+ t = Time (0, 0, 0, raw_convert<int> (u));
}
if (t > Time (0, 0, 8, 0)) {