Ejemplo n.º 1
0
BOOL CPageGeneral::OnInitDialog()
{
	CPropertyPage::OnInitDialog();

	m_humanFormat= GetOptions()->IsHumanFormat();
	m_listGrid= GetOptions()->IsListGrid();
	m_listStripes= GetOptions()->IsListStripes();
	m_listFullRowSelection= GetOptions()->IsListFullRowSelection();

	m_followMountPoints= GetOptions()->IsFollowMountPoints();
	m_followJunctionPoints= GetOptions()->IsFollowJunctionPoints();
	m_useWdsLocale= GetOptions()->IsUseWdsLocale();

	CVolumeApi va;
	if (!va.IsSupported())
	{
		m_followMountPoints= false;	// Otherwise we would see pacman only.
		m_ctlFollowMountPoints.ShowWindow(SW_HIDE); // Ignorance is bliss.
		// The same for junction points
		m_followJunctionPoints = false;	// Otherwise we would see pacman only.
		m_ctlFollowJunctionPoints.ShowWindow(SW_HIDE); // Ignorance is bliss.
	}

	int k= m_combo.AddString(GetLocaleLanguage(GetApp()->GetBuiltInLanguage()));
	m_combo.SetItemData(k, GetApp()->GetBuiltInLanguage());

	CArray<LANGID, LANGID> langid;
	GetApp()->GetAvailableResourceDllLangids(langid);
	int i;
	for (i=0; i < langid.GetSize(); i++)
	{
		k= m_combo.AddString(GetLocaleLanguage(langid[i]));
		m_combo.SetItemData(k, langid[i]);
	}

	m_originalLanguage= 0;
	for (i=0; i < m_combo.GetCount(); i++)
	{
		if (m_combo.GetItemData(i) == CLanguageOptions::GetLanguage())
		{
			m_combo.SetCurSel(i);
			m_originalLanguage= i;
			break;
		}
	}

	UpdateData(false);
	return TRUE;
}
NS_IMETHODIMP nsThebesDeviceContext::GetMetricsFor(const nsFont& aFont,
                                                   gfxUserFontSet* aUserFontSet,
                                                   nsIFontMetrics*& aMetrics)
{
    if (nsnull == mFontCache) {
        nsresult rv = CreateFontCache();
        if (NS_FAILED(rv)) {
            aMetrics = nsnull;
            return rv;
        }
        // XXX temporary fix for performance problem -- erik
        GetLocaleLanguage();
    }
    return mFontCache->GetMetricsFor(aFont, mLocaleLanguage, aUserFontSet,
                                     aMetrics);
}
NS_IMETHODIMP nsThebesDeviceContext::GetMetricsFor(const nsFont& aFont,
  nsIAtom* aLanguage, gfxUserFontSet* aUserFontSet, nsIFontMetrics*& aMetrics)
{
    if (nsnull == mFontCache) {
        nsresult rv = CreateFontCache();
        if (NS_FAILED(rv)) {
            aMetrics = nsnull;
            return rv;
        }
        // XXX temporary fix for performance problem -- erik
        GetLocaleLanguage();
    }

    // XXX figure out why aLanguage is NULL sometimes
    //      -> see nsPageFrame.cpp:511
    if (!aLanguage) {
        aLanguage = mLocaleLanguage;
    }

    return mFontCache->GetMetricsFor(aFont, aLanguage, aUserFontSet, aMetrics);
}