When a file has already been selected, correctly prefill the filepicker with that file.
Bug 374013, r+sr=sicking, a=dbaron
--- a/layout/forms/nsFileControlFrame.cpp
+++ b/layout/forms/nsFileControlFrame.cpp
@@ -549,18 +549,19 @@ nsFileControlFrame::GetFormProperty(nsIA
{
aValue.Truncate(); // initialize out param
if (nsGkAtoms::value == aName) {
NS_ASSERTION(!mCachedState || !mTextFrame,
"If we have a cached state, we better have no mTextFrame");
if (mCachedState) {
aValue.Assign(*mCachedState);
- } else if (mTextContent) {
- nsCOMPtr<nsIFileControlElement> fileControl = do_QueryInterface(mTextContent);
+ } else {
+ nsCOMPtr<nsIFileControlElement> fileControl =
+ do_QueryInterface(mContent);
if (fileControl) {
fileControl->GetFileName(aValue);
}
}
}
return NS_OK;
}