Bug 1119423 - Fix reversed test of aMatchData->mStyle in gfxFontFamily::FindFontForChar. r=jdaggett
authorJonathan Kew <jkew@mozilla.com>
Fri, 09 Jan 2015 11:57:56 +0000
changeset 236012 a9321d31e47cc00d0550ba76f2041c0d7ca3585f
parent 236011 171a1e7209a077aa2eb54b69b9d72335fb103334
child 236013 f8466e0caae10b3bd3625354822cc8fcf1b3b61a
push id384
push usermartin.thomson@gmail.com
push dateFri, 09 Jan 2015 21:26:39 +0000
reviewersjdaggett
bugs1119423
milestone37.0a1
Bug 1119423 - Fix reversed test of aMatchData->mStyle in gfxFontFamily::FindFontForChar. r=jdaggett
gfx/thebes/gfxFontEntry.cpp
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -1456,20 +1456,20 @@ gfxFontFamily::FindFontForChar(GlobalFon
 {
     if (mFamilyCharacterMapInitialized && !TestCharacterMap(aMatchData->mCh)) {
         // none of the faces in the family support the required char,
         // so bail out immediately
         return;
     }
 
     bool needsBold;
-    gfxFontStyle normal;
-    gfxFontEntry *fe = FindFontForStyle(
-                  (aMatchData->mStyle == nullptr) ? *aMatchData->mStyle : normal,
-                  needsBold);
+    gfxFontEntry *fe =
+        FindFontForStyle(aMatchData->mStyle ? *aMatchData->mStyle
+                                            : gfxFontStyle(),
+                         needsBold);
 
     if (fe && !fe->SkipDuringSystemFallback()) {
         int32_t rank = 0;
 
         if (fe->TestCharacterMap(aMatchData->mCh)) {
             rank += RANK_MATCHED_CMAP;
             aMatchData->mCount++;
 #ifdef PR_LOGGING