Ongoing deCOMtamination. r+sr=dbaron

git-svn-id: svn://10.0.0.236/trunk@144465 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu
2003-07-04 12:50:32 +00:00
parent 5b7157f73d
commit ca3b83ccdf
22 changed files with 348 additions and 818 deletions

View File

@@ -224,8 +224,7 @@ nsFileControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
{
// Fix for Bug 6133
if (mTextFrame) {
nsCOMPtr<nsIContent> content;
mTextFrame->GetContent(getter_AddRefs(content));
nsIContent* content = mTextFrame->GetContent();
if (content) {
content->SetFocus(mPresContext);
}
@@ -266,10 +265,9 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
nsresult result;
// Get parent nsIDOMWindowInternal object.
nsCOMPtr<nsIContent> content;
result = GetContent(getter_AddRefs(content));
nsIContent* content = GetContent();
if (!content)
return NS_FAILED(result) ? result : NS_ERROR_FAILURE;
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDocument> doc;
result = content->GetDocument(getter_AddRefs(doc));
@@ -378,14 +376,12 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext* aPresContext,
nsIFrame * child;
FirstChild(aPresContext, nsnull, &child);
while (child == mTextFrame) {
child->GetNextSibling(&child);
if (child == mTextFrame) {
child = child->GetNextSibling();
}
if (child != nsnull) {
nsRect buttonRect;
nsRect txtRect;
mTextFrame->GetRect(txtRect);
child->GetRect(buttonRect);
if (child) {
nsRect buttonRect = child->GetRect();
nsRect txtRect = mTextFrame->GetRect();
// check to see if we must reflow just the area frame again
// in order for the text field to be the correct height
@@ -410,7 +406,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext* aPresContext,
// now adjust the frame positions
txtRect.y = aReflowState.mComputedBorderPadding.top;
txtRect.height = aDesiredSize.height;
mTextFrame->SetRect(aPresContext, txtRect);
mTextFrame->SetRect(txtRect);
}
}
@@ -420,11 +416,11 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext* aPresContext,
// and we must make sure the text field is the correct height
if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
buttonRect.x = aReflowState.mComputedBorderPadding.left;
child->SetRect(aPresContext, buttonRect);
child->SetRect(buttonRect);
txtRect.x = aDesiredSize.width - txtRect.width + aReflowState.mComputedBorderPadding.left;
txtRect.y = aReflowState.mComputedBorderPadding.top;
txtRect.height = aDesiredSize.height;
mTextFrame->SetRect(aPresContext, txtRect);
mTextFrame->SetRect(txtRect);
}
}
@@ -458,11 +454,10 @@ nsFileControlFrame::GetTextControlFrame(nsIPresContext* aPresContext, nsIFrame*
while (childFrame) {
// see if the child is a text control
nsCOMPtr<nsIContent> content;
nsresult res = childFrame->GetContent(getter_AddRefs(content));
if (NS_SUCCEEDED(res) && content) {
nsIContent* content = childFrame->GetContent();
if (content) {
nsCOMPtr<nsIAtom> atom;
res = content->GetTag(getter_AddRefs(atom));
nsresult res = content->GetTag(getter_AddRefs(atom));
if (NS_SUCCEEDED(res) && atom) {
if (atom.get() == nsHTMLAtoms::input) {
@@ -482,8 +477,7 @@ nsFileControlFrame::GetTextControlFrame(nsIPresContext* aPresContext, nsIFrame*
if (frame)
result = frame;
res = childFrame->GetNextSibling(&childFrame);
NS_ASSERTION(res == NS_OK,"failed to get next child");
childFrame = childFrame->GetNextSibling();
}
return result;
@@ -579,12 +573,9 @@ nsFileControlFrame::GetFrameName(nsAString& aResult) const
NS_IMETHODIMP
nsFileControlFrame::GetFormContent(nsIContent*& aContent) const
{
nsIContent* content;
nsresult rv;
rv = GetContent(&content);
aContent = content;
return rv;
aContent = GetContent();
NS_IF_ADDREF(aContent);
return NS_OK;
}
NS_IMETHODIMP