diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index c88dd51ec2d..6c928db8724 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -624,30 +624,6 @@ nsComboboxControlFrame::GetDropdownFrame() } -nsresult -nsComboboxControlFrame::GetScreenHeight(nsIPresContext* aPresContext, - nscoord& aHeight) -{ - aHeight = 0; - nsIDeviceContext* context; - aPresContext->GetDeviceContext( &context ); - if ( nsnull != context ) - { - PRInt32 height; - PRInt32 width; - context->GetDeviceSurfaceDimensions(width, height); - float devUnits; - context->GetDevUnitsToAppUnits(devUnits); - aHeight = NSToIntRound(float( height) / devUnits ); - NS_RELEASE( context ); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - -int counter = 0; - nsresult nsComboboxControlFrame::PositionDropdown(nsIPresContext* aPresContext, nscoord aHeight, @@ -676,7 +652,7 @@ nsComboboxControlFrame::PositionDropdown(nsIPresContext* aPresContext, dropdownFrame->GetRect(dropdownRect); nscoord screenHeightInPixels = 0; - if (NS_SUCCEEDED(GetScreenHeight(aPresContext, screenHeightInPixels))) { + if (NS_SUCCEEDED(nsFormControlFrame::GetScreenHeight(aPresContext, screenHeightInPixels))) { // Get the height of the dropdown list in pixels. float t2p; aPresContext->GetTwipsToPixels(&t2p); diff --git a/mozilla/layout/forms/nsComboboxControlFrame.h b/mozilla/layout/forms/nsComboboxControlFrame.h index 69f4edfc955..22e92eaf37f 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.h +++ b/mozilla/layout/forms/nsComboboxControlFrame.h @@ -200,7 +200,6 @@ protected: nscoord aAvailableWidth, nscoord aAvailableHeight); - nsresult GetScreenHeight(nsIPresContext* aPresContext, nscoord& aHeight); public: nsresult PositionDropdown(nsIPresContext* aPresContext, nscoord aHeight, diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index c88dd51ec2d..6c928db8724 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -624,30 +624,6 @@ nsComboboxControlFrame::GetDropdownFrame() } -nsresult -nsComboboxControlFrame::GetScreenHeight(nsIPresContext* aPresContext, - nscoord& aHeight) -{ - aHeight = 0; - nsIDeviceContext* context; - aPresContext->GetDeviceContext( &context ); - if ( nsnull != context ) - { - PRInt32 height; - PRInt32 width; - context->GetDeviceSurfaceDimensions(width, height); - float devUnits; - context->GetDevUnitsToAppUnits(devUnits); - aHeight = NSToIntRound(float( height) / devUnits ); - NS_RELEASE( context ); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - -int counter = 0; - nsresult nsComboboxControlFrame::PositionDropdown(nsIPresContext* aPresContext, nscoord aHeight, @@ -676,7 +652,7 @@ nsComboboxControlFrame::PositionDropdown(nsIPresContext* aPresContext, dropdownFrame->GetRect(dropdownRect); nscoord screenHeightInPixels = 0; - if (NS_SUCCEEDED(GetScreenHeight(aPresContext, screenHeightInPixels))) { + if (NS_SUCCEEDED(nsFormControlFrame::GetScreenHeight(aPresContext, screenHeightInPixels))) { // Get the height of the dropdown list in pixels. float t2p; aPresContext->GetTwipsToPixels(&t2p); diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.h b/mozilla/layout/html/forms/src/nsComboboxControlFrame.h index 69f4edfc955..22e92eaf37f 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.h +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.h @@ -200,7 +200,6 @@ protected: nscoord aAvailableWidth, nscoord aAvailableHeight); - nsresult GetScreenHeight(nsIPresContext* aPresContext, nscoord& aHeight); public: nsresult PositionDropdown(nsIPresContext* aPresContext, nscoord aHeight,