Last Comment Bug 757871 - FT2FontEntry spews unwanted warnings when (optional) font tables are absent
: FT2FontEntry spews unwanted warnings when (optional) font tables are absent
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics: Text (show other bugs)
: unspecified
: All Android
: -- normal (vote)
: mozilla15
Assigned To: Jonathan Kew (:jfkthame)
:
: Milan Sreckovic [:milan]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-23 09:17 PDT by Jonathan Kew (:jfkthame)
Modified: 2012-05-24 09:17 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch, don't use NS_ENSURE_TRUE for normal control flow (1.38 KB, patch)
2012-05-23 09:17 PDT, Jonathan Kew (:jfkthame)
jd.bugzilla: review+
Details | Diff | Splinter Review

Description Jonathan Kew (:jfkthame) 2012-05-23 09:17:05 PDT
Created attachment 626477 [details] [diff] [review]
patch, don't use NS_ENSURE_TRUE for normal control flow

FT2FontEntry::GetFontTable uses NS_ENSURE_TRUE to return a failure code if the requested table is not present (so FT_Load_Sfnt_Table failed). However, it's perfectly normal for shaping code to request optional tables (such as 'kern' or the OpenType Layout tables); their absence is not an error or anomaly that deserves a warning message.

So we should use a simple "if (...) return NS_ERROR_FAILURE" instead of NS_ENSURE_TRUE here, to avoid spamming the console with these warnings.
Comment 1 John Daggett (:jtd) 2012-05-23 09:25:01 PDT
Comment on attachment 626477 [details] [diff] [review]
patch, don't use NS_ENSURE_TRUE for normal control flow

This is fine but I don't think the comment is needed.
Comment 2 Jonathan Kew (:jfkthame) 2012-05-24 01:21:27 PDT
OK, pushed without added comment.
https://hg.mozilla.org/integration/mozilla-inbound/rev/1865549541b7
Comment 3 Ed Morley [:emorley] 2012-05-24 09:17:46 PDT
https://hg.mozilla.org/mozilla-central/rev/1865549541b7

Note You need to log in before you can comment on or make changes to this bug.