mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
Bug 174055, part 8: change GetLanguage to return a raw nsIAtom*.
This commit is contained in:
parent
d856f0c057
commit
d9ffdcb05b
@ -268,14 +268,6 @@ nsFontMetrics::SpaceWidth()
|
||||
return CEIL_TO_TWIPS(GetMetrics().spaceWidth);
|
||||
}
|
||||
|
||||
already_AddRefed<nsIAtom>
|
||||
nsFontMetrics::GetLanguage()
|
||||
{
|
||||
nsIAtom* result = mLanguage.get();
|
||||
NS_IF_ADDREF(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsFontMetrics::GetMaxStringLength()
|
||||
{
|
||||
|
@ -197,7 +197,7 @@ public:
|
||||
/**
|
||||
* Returns the language associated with these metrics
|
||||
*/
|
||||
already_AddRefed<nsIAtom> GetLanguage();
|
||||
nsIAtom* Language() { return mLanguage; }
|
||||
|
||||
PRInt32 GetMaxStringLength();
|
||||
|
||||
|
@ -150,18 +150,16 @@ nsFontCache::GetMetricsFor(const nsFont& aFont, nsIAtom* aLanguage,
|
||||
PRInt32 n = mFontMetrics.Length() - 1;
|
||||
for (PRInt32 i = n; i >= 0; --i) {
|
||||
fm = mFontMetrics[i];
|
||||
if (fm->Font().Equals(aFont) && fm->GetUserFontSet() == aUserFontSet) {
|
||||
nsCOMPtr<nsIAtom> language = fm->GetLanguage();
|
||||
if (aLanguage == language.get()) {
|
||||
if (i != n) {
|
||||
// promote it to the end of the cache
|
||||
mFontMetrics.RemoveElementAt(i);
|
||||
mFontMetrics.AppendElement(fm);
|
||||
}
|
||||
fm->GetThebesFontGroup()->UpdateFontList();
|
||||
NS_ADDREF(aMetrics = fm);
|
||||
return NS_OK;
|
||||
if (fm->Font().Equals(aFont) && fm->GetUserFontSet() == aUserFontSet &&
|
||||
fm->Language() == aLanguage) {
|
||||
if (i != n) {
|
||||
// promote it to the end of the cache
|
||||
mFontMetrics.RemoveElementAt(i);
|
||||
mFontMetrics.AppendElement(fm);
|
||||
}
|
||||
fm->GetThebesFontGroup()->UpdateFontList();
|
||||
NS_ADDREF(aMetrics = fm);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user