Renamed GetSize(PRInt32* aSize) to GetSizeFromContent to remove conflict with
nsFrame GetSize(nsSize& aSize). Added check for null mWidget in nsFormControlFrame::HandleEvent git-svn-id: svn://10.0.0.236/trunk@19590 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -556,8 +556,8 @@ nsFormControlFrame::GetMaxLength(PRInt32* aSize)
|
||||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFormControlFrame::GetSize(PRInt32* aSize) const
|
||||
nsresult
|
||||
nsFormControlFrame::GetSizeFromContent(PRInt32* aSize) const
|
||||
{
|
||||
*aSize = -1;
|
||||
nsresult result = NS_CONTENT_ATTR_NOT_THERE;
|
||||
@@ -649,15 +649,17 @@ NS_METHOD nsFormControlFrame::HandleEvent(nsIPresContext& aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// make sure that the widget in the event is this input
|
||||
// XXX if there is no view, it could be an image button. Unfortunately,
|
||||
// every image button will get every event.
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
if (view) {
|
||||
if (mWidget != aEvent->widget) {
|
||||
aEventStatus = nsEventStatus_eIgnore;
|
||||
return NS_OK;
|
||||
if (nsnull != mWidget) {
|
||||
// make sure that the widget in the event is this input
|
||||
// XXX if there is no view, it could be an image button. Unfortunately,
|
||||
// every image button will get every event.
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
if (view) {
|
||||
if (mWidget != aEvent->widget) {
|
||||
aEventStatus = nsEventStatus_eIgnore;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
float aPixToTwip,
|
||||
nscoord aInnerWidth,
|
||||
nscoord aCharWidth) const;
|
||||
NS_IMETHOD GetSize(PRInt32* aSize) const;
|
||||
virtual nsresult GetSizeFromContent(PRInt32* aSize) const;
|
||||
NS_IMETHOD GetMaxLength(PRInt32* aSize);
|
||||
|
||||
virtual void SetClickPoint(nscoord aX, nscoord aY);
|
||||
|
||||
@@ -806,8 +806,8 @@ nsListControlFrame::GetMaxLength(PRInt32* aSize)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsListControlFrame::GetSize(PRInt32* aSize) const
|
||||
nsresult
|
||||
nsListControlFrame::GetSizeFromContent(PRInt32* aSize) const
|
||||
{
|
||||
*aSize = -1;
|
||||
nsresult result = NS_CONTENT_ATTR_NOT_THERE;
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
PRInt32 aNumChars, nsSize& aSize,
|
||||
nsIRenderingContext *aRendContext);
|
||||
#endif
|
||||
NS_IMETHOD GetSize(PRInt32* aSize) const;
|
||||
virtual nsresult GetSizeFromContent(PRInt32* aSize) const;
|
||||
NS_IMETHOD GetMaxLength(PRInt32* aSize);
|
||||
|
||||
static void GetScrollBarDimensions(nsIPresContext& aPresContext,
|
||||
|
||||
@@ -246,7 +246,7 @@ nsTextControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
GetType(&type);
|
||||
if ((NS_FORM_INPUT_TEXT == type) || (NS_FORM_INPUT_PASSWORD == type)) {
|
||||
PRInt32 width;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE != GetSize(&width)) {
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE != GetSizeFromContent(&width)) {
|
||||
width = 20;
|
||||
}
|
||||
//if (eCompatibility_NavQuirks == mode) {
|
||||
|
||||
@@ -556,8 +556,8 @@ nsFormControlFrame::GetMaxLength(PRInt32* aSize)
|
||||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFormControlFrame::GetSize(PRInt32* aSize) const
|
||||
nsresult
|
||||
nsFormControlFrame::GetSizeFromContent(PRInt32* aSize) const
|
||||
{
|
||||
*aSize = -1;
|
||||
nsresult result = NS_CONTENT_ATTR_NOT_THERE;
|
||||
@@ -649,15 +649,17 @@ NS_METHOD nsFormControlFrame::HandleEvent(nsIPresContext& aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// make sure that the widget in the event is this input
|
||||
// XXX if there is no view, it could be an image button. Unfortunately,
|
||||
// every image button will get every event.
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
if (view) {
|
||||
if (mWidget != aEvent->widget) {
|
||||
aEventStatus = nsEventStatus_eIgnore;
|
||||
return NS_OK;
|
||||
if (nsnull != mWidget) {
|
||||
// make sure that the widget in the event is this input
|
||||
// XXX if there is no view, it could be an image button. Unfortunately,
|
||||
// every image button will get every event.
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
if (view) {
|
||||
if (mWidget != aEvent->widget) {
|
||||
aEventStatus = nsEventStatus_eIgnore;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
float aPixToTwip,
|
||||
nscoord aInnerWidth,
|
||||
nscoord aCharWidth) const;
|
||||
NS_IMETHOD GetSize(PRInt32* aSize) const;
|
||||
virtual nsresult GetSizeFromContent(PRInt32* aSize) const;
|
||||
NS_IMETHOD GetMaxLength(PRInt32* aSize);
|
||||
|
||||
virtual void SetClickPoint(nscoord aX, nscoord aY);
|
||||
|
||||
@@ -806,8 +806,8 @@ nsListControlFrame::GetMaxLength(PRInt32* aSize)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsListControlFrame::GetSize(PRInt32* aSize) const
|
||||
nsresult
|
||||
nsListControlFrame::GetSizeFromContent(PRInt32* aSize) const
|
||||
{
|
||||
*aSize = -1;
|
||||
nsresult result = NS_CONTENT_ATTR_NOT_THERE;
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
PRInt32 aNumChars, nsSize& aSize,
|
||||
nsIRenderingContext *aRendContext);
|
||||
#endif
|
||||
NS_IMETHOD GetSize(PRInt32* aSize) const;
|
||||
virtual nsresult GetSizeFromContent(PRInt32* aSize) const;
|
||||
NS_IMETHOD GetMaxLength(PRInt32* aSize);
|
||||
|
||||
static void GetScrollBarDimensions(nsIPresContext& aPresContext,
|
||||
|
||||
@@ -339,7 +339,7 @@ nsSelectControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
|
||||
// here it is determined whether we are a combo box
|
||||
PRInt32 sizeAttr;
|
||||
GetSize(&sizeAttr);
|
||||
GetSizeFromContent(&sizeAttr);
|
||||
PRBool multiple;
|
||||
if (!GetMultiple(&multiple) &&
|
||||
((1 >= sizeAttr) || ((ATTR_NOTSET == sizeAttr) && (1 >= mNumRows)))) {
|
||||
|
||||
@@ -246,7 +246,7 @@ nsTextControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
GetType(&type);
|
||||
if ((NS_FORM_INPUT_TEXT == type) || (NS_FORM_INPUT_PASSWORD == type)) {
|
||||
PRInt32 width;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE != GetSize(&width)) {
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE != GetSizeFromContent(&width)) {
|
||||
width = 20;
|
||||
}
|
||||
//if (eCompatibility_NavQuirks == mode) {
|
||||
|
||||
Reference in New Issue
Block a user