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:
kmcclusk%netscape.com
1999-02-03 22:56:50 +00:00
parent 1251e59880
commit 48eb596de2
11 changed files with 37 additions and 33 deletions

View File

@@ -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;
}
}
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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,

View File

@@ -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) {

View File

@@ -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;
}
}
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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,

View File

@@ -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)))) {

View File

@@ -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) {