diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-26 01:37:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-26 01:37:00 +0100 |
| commit | 0a1b4c69c23d6e4838707fe74f3a55aa7b6c8649 (patch) | |
| tree | c40c3e9f8ac8157797d5527db8d836a90eb4dc23 /src | |
| parent | 2739fd197482fbc355de60907ca07cb614051e40 (diff) | |
| parent | d848eed414a5d5c8bc35a3ec843f01e8b609f60d (diff) | |
Merge branch '1.0' of git.carlh.net:git/libsub into 1.0
Diffstat (limited to 'src')
| -rw-r--r-- | src/ssa_reader.cc | 6 | ||||
| -rw-r--r-- | src/util.cc | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ssa_reader.cc b/src/ssa_reader.cc index 05c908e..630eb29 100644 --- a/src/ssa_reader.cc +++ b/src/ssa_reader.cc @@ -61,6 +61,7 @@ public: , primary_colour (255, 255, 255) , bold (false) , italic (false) + , underline (false) , vertical_reference (BOTTOM_OF_SCREEN) , vertical_margin (0) {} @@ -70,6 +71,7 @@ public: , primary_colour (255, 255, 255) , bold (false) , italic (false) + , underline (false) , vertical_reference (BOTTOM_OF_SCREEN) , vertical_margin (0) { @@ -99,6 +101,8 @@ public: bold = style[i] == "-1"; } else if (keys[i] == "Italic") { italic = style[i] == "-1"; + } else if (keys[i] == "Underline") { + underline = style[i] == "-1"; } else if (keys[i] == "BorderStyle") { if (style[i] == "1") { effect = SHADOW; @@ -130,6 +134,7 @@ public: optional<Colour> back_colour; bool bold; bool italic; + bool underline; optional<Effect> effect; VerticalReference vertical_reference; int vertical_margin; @@ -389,6 +394,7 @@ SSAReader::read (function<optional<string> ()> get_line) sub.effect_colour = style.back_colour; sub.bold = style.bold; sub.italic = style.italic; + sub.underline = style.underline; sub.effect = style.effect; sub.vertical_position.reference = style.vertical_reference; sub.vertical_position.proportional = float(style.vertical_margin) / play_res_y; diff --git a/src/util.cc b/src/util.cc index a165126..66490c1 100644 --- a/src/util.cc +++ b/src/util.cc @@ -20,6 +20,7 @@ #include "util.h" #include <string> #include <sstream> +#include <iostream> #include <cstdio> using std::string; @@ -45,12 +46,12 @@ sub::empty_or_white_space (string s) optional<string> sub::get_line_stringstream (stringstream* str) { - string s; - getline (*str, s); if (!str->good ()) { return optional<string> (); } + string s; + getline (*str, s); return s; } |
