Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: third_party/ots/src/name.cc

Issue 1487543005: Update OTS to revision 99a3b7f (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/ots/src/metrics.cc ('k') | third_party/ots/src/ots.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/name.cc
diff --git a/third_party/ots/src/name.cc b/third_party/ots/src/name.cc
index a0dd1eaf5d510e8753394d1b279f210e19a7c02c..e55be75371a686d4c60681b53aef1a2dbb355e97 100644
--- a/third_party/ots/src/name.cc
+++ b/third_party/ots/src/name.cc
@@ -79,7 +79,6 @@ bool ots_name_parse(Font *font, const uint8_t* data, size_t length) {
const char* string_base = reinterpret_cast<const char*>(data) +
string_offset;
- NameRecord prev_record;
bool sort_required = false;
// Read all the names, discarding any with invalid IDs,
@@ -149,13 +148,12 @@ bool ots_name_parse(Font *font, const uint8_t* data, size_t length) {
}
}
- if ((i > 0) && !(prev_record < rec)) {
+ if (!name->names.empty() && !(name->names.back() < rec)) {
OTS_WARNING("name records are not sorted.");
sort_required = true;
}
name->names.push_back(rec);
- prev_record = rec;
}
if (format == 1) {
@@ -210,7 +208,7 @@ bool ots_name_parse(Font *font, const uint8_t* data, size_t length) {
bool mac_name[kStdNameCount] = { 0 };
bool win_name[kStdNameCount] = { 0 };
for (std::vector<NameRecord>::iterator name_iter = name->names.begin();
- name_iter != name->names.end(); name_iter++) {
+ name_iter != name->names.end(); ++name_iter) {
const uint16_t id = name_iter->name_id;
if (id >= kStdNameCount || kStdNames[id] == NULL) {
continue;
@@ -279,7 +277,7 @@ bool ots_name_serialise(OTSStream* out, Font *font) {
std::string string_data;
for (std::vector<NameRecord>::const_iterator name_iter = name->names.begin();
- name_iter != name->names.end(); name_iter++) {
+ name_iter != name->names.end(); ++name_iter) {
const NameRecord& rec = *name_iter;
if (string_data.size() + rec.text.size() >
std::numeric_limits<uint16_t>::max() ||
@@ -300,7 +298,7 @@ bool ots_name_serialise(OTSStream* out, Font *font) {
}
for (std::vector<std::string>::const_iterator tag_iter =
name->lang_tags.begin();
- tag_iter != name->lang_tags.end(); tag_iter++) {
+ tag_iter != name->lang_tags.end(); ++tag_iter) {
if (string_data.size() + tag_iter->size() >
std::numeric_limits<uint16_t>::max() ||
!out->WriteU16(static_cast<uint16_t>(tag_iter->size())) ||
« no previous file with comments | « third_party/ots/src/metrics.cc ('k') | third_party/ots/src/ots.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698