зеркало из https://github.com/mozilla/pjs.git
changed signature of GetFont b=905 r=dcone
This commit is contained in:
Родитель
d2ec787548
Коммит
7335d90bfb
|
@ -277,8 +277,8 @@ nsComboboxControlFrame::GetFormContent(nsIContent*& aContent) const
|
|||
|
||||
//--------------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsComboboxControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsComboboxControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
|
|
|
@ -119,7 +119,7 @@ public:
|
|||
virtual PRBool GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
|
||||
nsString* aValues, nsString* aNames);
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
virtual nscoord GetVerticalBorderWidth(float aPixToTwip) const;
|
||||
virtual nscoord GetHorizontalBorderWidth(float aPixToTwip) const;
|
||||
|
|
|
@ -100,7 +100,7 @@ public:
|
|||
void ScrollIntoView(nsIPresContext* aPresContext);
|
||||
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
virtual nscoord GetVerticalInsidePadding(nsIPresContext* aPresContext,
|
||||
|
|
|
@ -364,7 +364,7 @@ nsFormControlFrame::ScrollIntoView(nsIPresContext* aPresContext)
|
|||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
presShell->ScrollFrameIntoView(this,
|
||||
NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE);
|
||||
NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -559,11 +559,10 @@ nsFormControlFrame::GetFormContent(nsIContent*& aContent) const
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFormControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsFormControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
return nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -192,7 +192,7 @@ public:
|
|||
virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; }
|
||||
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
|
||||
|
|
|
@ -684,8 +684,8 @@ nsHTMLButtonControlFrame::GetSkipSides() const
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLButtonControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsHTMLButtonControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
|
|
|
@ -121,7 +121,7 @@ public:
|
|||
void ScrollIntoView(nsIPresContext* aPresContext);
|
||||
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
virtual nscoord GetVerticalInsidePadding(nsIPresContext* aPresContext,
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
void SetFocus(PRBool aOn, PRBool aRepaint);
|
||||
void ScrollIntoView(nsIPresContext* aPresContext);
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
virtual nscoord GetVerticalInsidePadding(nsIPresContext* aPresContext,
|
||||
|
@ -455,11 +455,10 @@ nsImageControlFrame::MouseClicked(nsIPresContext* aPresContext)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsImageControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
return nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -622,8 +622,8 @@ nsListControlFrame::GetFormContent(nsIContent*& aContent) const
|
|||
|
||||
//---------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsListControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsListControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
|
||||
NS_IMETHOD GetMultiple(PRBool* aResult, nsIDOMHTMLSelectElement* aSelect = nsnull);
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
|
||||
virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE);
|
||||
|
|
|
@ -277,8 +277,8 @@ nsComboboxControlFrame::GetFormContent(nsIContent*& aContent) const
|
|||
|
||||
//--------------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsComboboxControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsComboboxControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
|
|
|
@ -119,7 +119,7 @@ public:
|
|||
virtual PRBool GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
|
||||
nsString* aValues, nsString* aNames);
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
virtual nscoord GetVerticalBorderWidth(float aPixToTwip) const;
|
||||
virtual nscoord GetHorizontalBorderWidth(float aPixToTwip) const;
|
||||
|
|
|
@ -100,7 +100,7 @@ public:
|
|||
void ScrollIntoView(nsIPresContext* aPresContext);
|
||||
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
virtual nscoord GetVerticalInsidePadding(nsIPresContext* aPresContext,
|
||||
|
|
|
@ -364,7 +364,7 @@ nsFormControlFrame::ScrollIntoView(nsIPresContext* aPresContext)
|
|||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
presShell->ScrollFrameIntoView(this,
|
||||
NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE);
|
||||
NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -559,11 +559,10 @@ nsFormControlFrame::GetFormContent(nsIContent*& aContent) const
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFormControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsFormControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
return nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -192,7 +192,7 @@ public:
|
|||
virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; }
|
||||
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
|
||||
|
|
|
@ -650,8 +650,8 @@ nsGfxListControlFrame::GetFormContent(nsIContent*& aContent) const
|
|||
|
||||
//---------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsGfxListControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsGfxListControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
|
||||
NS_IMETHOD GetMultiple(PRBool* aResult, nsIDOMHTMLSelectElement* aSelect = nsnull);
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
|
||||
virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE);
|
||||
|
|
|
@ -684,8 +684,8 @@ nsHTMLButtonControlFrame::GetSkipSides() const
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLButtonControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsHTMLButtonControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
|
|
|
@ -121,7 +121,7 @@ public:
|
|||
void ScrollIntoView(nsIPresContext* aPresContext);
|
||||
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
virtual nscoord GetVerticalInsidePadding(nsIPresContext* aPresContext,
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
void SetFocus(PRBool aOn, PRBool aRepaint);
|
||||
void ScrollIntoView(nsIPresContext* aPresContext);
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
virtual nscoord GetVerticalInsidePadding(nsIPresContext* aPresContext,
|
||||
|
@ -455,11 +455,10 @@ nsImageControlFrame::MouseClicked(nsIPresContext* aPresContext)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsImageControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
return nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -622,8 +622,8 @@ nsListControlFrame::GetFormContent(nsIContent*& aContent) const
|
|||
|
||||
//---------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsListControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont)
|
||||
nsListControlFrame::GetFont(nsIPresContext* aPresContext,
|
||||
const nsFont*& aFont)
|
||||
{
|
||||
nsFormControlHelper::GetFont(this, aPresContext, mStyleContext, aFont);
|
||||
return NS_OK;
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
|
||||
NS_IMETHOD GetMultiple(PRBool* aResult, nsIDOMHTMLSelectElement* aSelect = nsnull);
|
||||
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
||||
nsFont& aFont);
|
||||
const nsFont*& aFont);
|
||||
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
||||
|
||||
virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE);
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#include "nsNativeButtonControlFrame.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsFormFrame.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIButton.h"
|
||||
|
||||
static NS_DEFINE_IID(kIButtonIID, NS_IBUTTON_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsNativeButtonControlFrame* it = new (aPresShell) nsNativeButtonControlFrame;
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeButtonControlFrame::AttributeChanged(nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
PRInt32 aHint)
|
||||
{
|
||||
nsresult result = NS_OK;
|
||||
if (mWidget) {
|
||||
if (nsHTMLAtoms::value == aAttribute) {
|
||||
nsIButton* button = nsnull;
|
||||
result = mWidget->QueryInterface(kIButtonIID, (void**)&button);
|
||||
if ((NS_SUCCEEDED(result)) && (nsnull != button)) {
|
||||
nsString value;
|
||||
/*XXXnsresult result = */GetValue(&value);
|
||||
button->SetLabel(value);
|
||||
NS_RELEASE(button);
|
||||
if (aHint != NS_STYLE_HINT_REFLOW)
|
||||
nsFormFrame::StyleChangeReflow(aPresContext, this);
|
||||
}
|
||||
} else if (nsHTMLAtoms::size == aAttribute &&
|
||||
aHint != NS_STYLE_HINT_REFLOW) {
|
||||
nsFormFrame::StyleChangeReflow(aPresContext, this);
|
||||
}
|
||||
// Allow the base class to handle common attributes supported
|
||||
// by all form elements...
|
||||
else {
|
||||
result = Inherited::AttributeChanged(aPresContext, aChild, aNameSpaceID, aAttribute, aHint);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeButtonControlFrame::PostCreateWidget(nsIPresContext* aPresContext, nscoord& aWidth, nscoord& aHeight)
|
||||
{
|
||||
nsIButton* button = nsnull;
|
||||
if (mWidget && (NS_OK == mWidget->QueryInterface(kIButtonIID,(void**)&button))) {
|
||||
nsFont font(aPresContext->GetDefaultFixedFontDeprecated());
|
||||
GetFont(aPresContext, font);
|
||||
mWidget->SetFont(font);
|
||||
SetColors(aPresContext);
|
||||
|
||||
nsAutoString value;
|
||||
nsresult result = GetValue(&value);
|
||||
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE != result) {
|
||||
GetDefaultLabel(value);
|
||||
}
|
||||
button->SetLabel(value);
|
||||
NS_RELEASE(button);
|
||||
|
||||
mWidget->Enable(!nsFormFrame::GetDisabled(this));
|
||||
}
|
||||
}
|
||||
|
|
@ -610,9 +610,11 @@ nsNativeSelectControlFrame::PostCreateWidget(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
mWidget->Enable(!nsFormFrame::GetDisabled(this));
|
||||
nsFont font(aPresContext->GetDefaultFixedFontDeprecated());
|
||||
GetFont(aPresContext, font);
|
||||
mWidget->SetFont(font);
|
||||
const nsFont * font;
|
||||
nsresult res = GetFont(aPresContext, font);
|
||||
if (NS_SUCCEEDED(res) && font != nsnull) {
|
||||
mWidget->SetFont(*font);
|
||||
}
|
||||
SetColors(aPresContext);
|
||||
|
||||
// add the options
|
||||
|
@ -932,10 +934,12 @@ nsNativeSelectControlFrame::PaintSelectControl(nsIPresContext* aPresContext,
|
|||
|
||||
aRenderingContext.SetColor(NS_RGB(0,0,0));
|
||||
|
||||
nsFont font(aPresContext->GetDefaultFixedFontDeprecated());
|
||||
GetFont(aPresContext, font);
|
||||
|
||||
aRenderingContext.SetFont(font);
|
||||
const nsFont * font = nsnull;
|
||||
nsresult res = GetFont(aPresContext, font);
|
||||
if (NS_SUCCEEDED(res) && font != nsnull) {
|
||||
mWidget->SetFont(*font);
|
||||
aRenderingContext.SetFont(*font);
|
||||
}
|
||||
|
||||
//nscoord textWidth;
|
||||
nscoord textHeight;
|
||||
|
@ -943,7 +947,9 @@ nsNativeSelectControlFrame::PaintSelectControl(nsIPresContext* aPresContext,
|
|||
|
||||
// Calculate the height of the text
|
||||
nsIFontMetrics* metrics;
|
||||
context->GetMetricsFor(font, metrics);
|
||||
if (font != nsnull) {
|
||||
context->GetMetricsFor(*font, metrics);
|
||||
}
|
||||
metrics->GetHeight(textHeight);
|
||||
|
||||
// Calculate the width of the scrollbar
|
||||
|
|
|
@ -249,9 +249,10 @@ nsNativeTextControlFrame::PostCreateWidget(nsIPresContext* aPresContext,
|
|||
PRInt32 type;
|
||||
GetType(&type);
|
||||
|
||||
nsFont font(aPresContext->GetDefaultFixedFontDeprecated());
|
||||
GetFont(aPresContext, font);
|
||||
mWidget->SetFont(font);
|
||||
const nsFont * font = nsnull;
|
||||
if (NS_SUCCEEDED(GetFont(aPresContext, font))) {
|
||||
mWidget->SetFont(*font);
|
||||
}
|
||||
SetColors(aPresContext);
|
||||
|
||||
PRUint32 ignore;
|
||||
|
@ -406,10 +407,13 @@ nsNativeTextControlFrame::PaintTextControl(nsIPresContext* aPresContext,
|
|||
|
||||
aRenderingContext.SetColor(NS_RGB(0,0,0));
|
||||
|
||||
nsFont font(aPresContext->GetDefaultFixedFontDeprecated());
|
||||
GetFont(aPresContext, font);
|
||||
const nsFont * font = nsnull;
|
||||
nsresult res = GetFont(aPresContext, font);
|
||||
if (NS_SUCCEEDED(res) && font != nsnull) {
|
||||
mWidget->SetFont(*font);
|
||||
aRenderingContext.SetFont(*font);
|
||||
}
|
||||
|
||||
aRenderingContext.SetFont(font);
|
||||
|
||||
nscoord textWidth;
|
||||
nscoord textHeight;
|
||||
|
@ -417,7 +421,9 @@ nsNativeTextControlFrame::PaintTextControl(nsIPresContext* aPresContext,
|
|||
aRenderingContext.GetWidth(aText, textWidth);
|
||||
|
||||
nsIFontMetrics* metrics;
|
||||
context->GetMetricsFor(font, metrics);
|
||||
if (font != nsnull) {
|
||||
context->GetMetricsFor(*font, metrics);
|
||||
}
|
||||
metrics->GetHeight(textHeight);
|
||||
|
||||
PRInt32 type;
|
||||
|
|
|
@ -553,9 +553,11 @@ nsSelectControlFrame::PostCreateWidget(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
mWidget->Enable(!nsFormFrame::GetDisabled(this));
|
||||
nsFont font(aPresContext->GetDefaultFixedFontDeprecated());
|
||||
GetFont(aPresContext, font);
|
||||
mWidget->SetFont(font);
|
||||
const nsFont * font = nsnull;
|
||||
nsresult res = GetFont(aPresContext, font);
|
||||
if (NS_SUCCEEDED(res) && font != nsnull) {
|
||||
mWidget->SetFont(font);
|
||||
}
|
||||
SetColors(aPresContext);
|
||||
|
||||
// add the options
|
||||
|
@ -874,10 +876,12 @@ nsSelectControlFrame::PaintSelectControl(nsIPresContext* aPresContext,
|
|||
|
||||
aRenderingContext.SetColor(NS_RGB(0,0,0));
|
||||
|
||||
nsFont font(aPresContext->GetDefaultFixedFontDeprecated());
|
||||
GetFont(aPresContext, font);
|
||||
const nsFont * font = nsnull;
|
||||
nsresult res = GetFont(aPresContext, font);
|
||||
if (NS_SUCCEEDED(res) && font != nsnull) {
|
||||
aRenderingContext.SetFont(font);
|
||||
}
|
||||
|
||||
aRenderingContext.SetFont(font);
|
||||
|
||||
//nscoord textWidth;
|
||||
nscoord textHeight;
|
||||
|
|
Загрузка…
Ссылка в новой задаче