diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-24 15:05:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-24 15:05:19 +0100 |
| commit | 81312913ad26aaee12eeabd3f27a537806c97049 (patch) | |
| tree | 8a58899a4df44bc88f85d52707152934cc0ccb51 /src/subtitle_asset.cc | |
| parent | 094117316524f12fc82adbdf721778eed04e66f6 (diff) | |
Fix various SNAFUs with Font ID handling.
Diffstat (limited to 'src/subtitle_asset.cc')
| -rw-r--r-- | src/subtitle_asset.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index 367c3455..c0ffb75a 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -30,6 +30,7 @@ #include <libxml++/nodes/element.h> #include <boost/algorithm/string.hpp> #include <boost/shared_array.hpp> +#include <boost/foreach.hpp> #include <fstream> using std::string; @@ -308,18 +309,12 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* root, int time_code_rate, strin } } -void -SubtitleAsset::add_font_data (string id, boost::filesystem::path file) -{ - _fonts[id] = FileData (file); -} - map<string, Data> -SubtitleAsset::fonts () const +SubtitleAsset::fonts_with_load_ids () const { map<string, Data> out; - for (map<string, FileData>::const_iterator i = _fonts.begin(); i != _fonts.end(); ++i) { - out[i->first] = i->second; + BOOST_FOREACH (Font const & i, _fonts) { + out[i.load_id] = i.data; } return out; } |
