| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Sets the entry in the font map for the given script. If family is the empty | 59 // Sets the entry in the font map for the given script. If family is the empty |
| 60 // string, removes the entry instead. | 60 // string, removes the entry instead. |
| 61 void GenericFontFamilySettings::setGenericFontFamilyMap( | 61 void GenericFontFamilySettings::setGenericFontFamilyMap( |
| 62 ScriptFontFamilyMap& fontMap, | 62 ScriptFontFamilyMap& fontMap, |
| 63 const AtomicString& family, | 63 const AtomicString& family, |
| 64 UScriptCode script) { | 64 UScriptCode script) { |
| 65 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script)); | 65 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script)); |
| 66 if (family.isEmpty()) { | 66 if (family.isEmpty()) { |
| 67 if (it == fontMap.end()) | 67 if (it == fontMap.end()) |
| 68 return; | 68 return; |
| 69 fontMap.remove(it); | 69 fontMap.erase(it); |
| 70 } else if (it != fontMap.end() && it->value == family) { | 70 } else if (it != fontMap.end() && it->value == family) { |
| 71 return; | 71 return; |
| 72 } else { | 72 } else { |
| 73 fontMap.set(static_cast<int>(script), family); | 73 fontMap.set(static_cast<int>(script), family); |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 const AtomicString& GenericFontFamilySettings::genericFontFamilyForScript( | 77 const AtomicString& GenericFontFamilySettings::genericFontFamilyForScript( |
| 78 const ScriptFontFamilyMap& fontMap, | 78 const ScriptFontFamilyMap& fontMap, |
| 79 UScriptCode script) const { | 79 UScriptCode script) const { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 m_standardFontFamilyMap.clear(); | 183 m_standardFontFamilyMap.clear(); |
| 184 m_serifFontFamilyMap.clear(); | 184 m_serifFontFamilyMap.clear(); |
| 185 m_fixedFontFamilyMap.clear(); | 185 m_fixedFontFamilyMap.clear(); |
| 186 m_sansSerifFontFamilyMap.clear(); | 186 m_sansSerifFontFamilyMap.clear(); |
| 187 m_cursiveFontFamilyMap.clear(); | 187 m_cursiveFontFamilyMap.clear(); |
| 188 m_fantasyFontFamilyMap.clear(); | 188 m_fantasyFontFamilyMap.clear(); |
| 189 m_pictographFontFamilyMap.clear(); | 189 m_pictographFontFamilyMap.clear(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace blink | 192 } // namespace blink |
| OLD | NEW |