From f291b097d5f42aa47b4f62f5fbfa45f273716a6e Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Thu, 7 Oct 1999 21:37:02 +0000 Subject: [PATCH] Removed code where standard mode was incorrectly subtracting border size r=kmcclusk git-svn-id: svn://10.0.0.236/trunk@50145 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsTextControlFrame.cpp | 16 ++-------------- .../layout/html/forms/src/nsTextControlFrame.cpp | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index c7328684966..6ffc4c5d969 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -176,9 +176,8 @@ nsTextControlFrame::GetHorizontalInsidePadding(nsIPresContext& aPresContext, } else { padding = (nscoord)(aCharWidth * padTextField); } -#ifdef DEBUG_rods - printf("Padding - %d %5.2f %d\n", aCharWidth, padTextField, padding); -#endif + + nscoord min = NSIntPixelsToTwips(padMinText, aPixToTwip); if (padding > min && (1 == shouldUsePadMinText)) { return padding; @@ -291,17 +290,6 @@ nsTextControlFrame::GetDesiredSize(nsIPresContext* aPresContext, } } - if (eCompatibility_Standard == mode) { - nsCOMPtr lookAndFeel; - if (NS_SUCCEEDED(aPresContext->GetLookAndFeel(getter_AddRefs(lookAndFeel)))) { - PRInt32 borderSize; - lookAndFeel->GetMetric(nsILookAndFeel::eMetric_TextFieldBorder, borderSize); - nscoord borderTwips = NSIntPixelsToTwips(borderSize, p2t); - desiredSize.width -= borderTwips*2; - desiredSize.height -= borderTwips*2; - } - } - aDesiredLayoutSize.width = desiredSize.width; aDesiredLayoutSize.height = desiredSize.height; aDesiredLayoutSize.ascent = aDesiredLayoutSize.height; diff --git a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp index c7328684966..6ffc4c5d969 100644 --- a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp @@ -176,9 +176,8 @@ nsTextControlFrame::GetHorizontalInsidePadding(nsIPresContext& aPresContext, } else { padding = (nscoord)(aCharWidth * padTextField); } -#ifdef DEBUG_rods - printf("Padding - %d %5.2f %d\n", aCharWidth, padTextField, padding); -#endif + + nscoord min = NSIntPixelsToTwips(padMinText, aPixToTwip); if (padding > min && (1 == shouldUsePadMinText)) { return padding; @@ -291,17 +290,6 @@ nsTextControlFrame::GetDesiredSize(nsIPresContext* aPresContext, } } - if (eCompatibility_Standard == mode) { - nsCOMPtr lookAndFeel; - if (NS_SUCCEEDED(aPresContext->GetLookAndFeel(getter_AddRefs(lookAndFeel)))) { - PRInt32 borderSize; - lookAndFeel->GetMetric(nsILookAndFeel::eMetric_TextFieldBorder, borderSize); - nscoord borderTwips = NSIntPixelsToTwips(borderSize, p2t); - desiredSize.width -= borderTwips*2; - desiredSize.height -= borderTwips*2; - } - } - aDesiredLayoutSize.width = desiredSize.width; aDesiredLayoutSize.height = desiredSize.height; aDesiredLayoutSize.ascent = aDesiredLayoutSize.height;