Skip to content

Commit

Permalink
Backed out changeset 5a2ea27885f0 (bug 1850738) for causing build bus…
Browse files Browse the repository at this point in the history
…tages on gfxUserFontSet.cpp. CLOSED TREE

DONTBUILD
  • Loading branch information
CosminSabou committed Aug 31, 2023
1 parent 7a02656 commit afc5b41
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions gfx/thebes/gfxUserFontSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,6 @@ class MOZ_STACK_CLASS gfxOTSMessageContext : public gfxOTSContext {
virtual void Message(int level, const char* format,
...) MSGFUNC_FMT_ATTR override {
va_list va;

// Special-case glyph bounding box warnings: collect all bad glyph IDs,
// so we can issue a single message at the end.
if (level > 0 && strstr(format, "bbox was incorrect")) {
// Extract the glyph ID from the message: it follows the last space in
// the message string.
const char* lastSpace = rindex(format, ' ');
if (lastSpace) {
int gid = atoi(lastSpace + 1);
mBadBBoxGlyphs.AppendElement(gid);
}
return;
}

va_start(va, format);

nsCString msg;
Expand All @@ -169,23 +155,12 @@ class MOZ_STACK_CLASS gfxOTSMessageContext : public gfxOTSContext {
}

nsTArray<gfxUserFontEntry::OTSMessage>&& TakeMessages() {
if (!mBadBBoxGlyphs.IsEmpty()) {
nsAutoCString msg("Glyph bbox was incorrect (glyph ids");
for (const auto gid : mBadBBoxGlyphs) {
msg.Append(" ");
msg.AppendInt(gid);
}
msg.Append(")");
mMessages.AppendElement(gfxUserFontEntry::OTSMessage{msg, 1});
mBadBBoxGlyphs.Clear();
}
return std::move(mMessages);
}

private:
nsTHashSet<nsCString> mWarningsIssued;
nsTArray<gfxUserFontEntry::OTSMessage> mMessages;
nsTArray<uint16_t> mBadBBoxGlyphs;
};

// Call the OTS library to sanitize an sfnt before attempting to use it.
Expand Down

0 comments on commit afc5b41

Please sign in to comment.