Small C++11 tidy-up.
[libsub.git] / src / subrip_reader.cc
index beb81e1c41db1cbaefbbd358a574161128f412a2..8ba7c7ddc51f08f2434541d3d07d9fc6fffd129b 100644 (file)
@@ -37,7 +37,6 @@
 
 using std::string;
 using std::vector;
-using std::list;
 using std::cout;
 using std::hex;
 using boost::lexical_cast;
@@ -74,7 +73,7 @@ SubripReader::read (function<optional<string> ()> get_line)
        rs.vertical_position.reference = TOP_OF_SUBTITLE;
 
        while (true) {
-               optional<string> line = get_line ();
+               auto line = get_line ();
                if (!line) {
                        break;
                }
@@ -198,7 +197,7 @@ SubripReader::convert_line (string t, RawSubtitle& p)
 
        string tag;
 
-       list<Colour> colours;
+       vector<Colour> colours;
        colours.push_back (Colour (1, 1, 1));
 
        /* XXX: missing <font> support */
@@ -237,7 +236,7 @@ SubripReader::convert_line (string t, RawSubtitle& p)
                                        p.underline = false;
                                } else if (boost::starts_with (tag, "font")) {
                                        maybe_content (p);
-                                       boost::regex re (".*color=\"#([[:xdigit:]]+)\"");
+                                       boost::regex re (".*color=\"?#([[:xdigit:]]+)\"?");
                                        boost::smatch match;
                                        if (boost::regex_search (tag, match, re) && string (match[1]).size() == 6) {
                                                p.colour = Colour::from_rgb_hex (match[1]);