When a file has already been selected, correctly prefill the filepicker with that file. Bug 374013, r+sr=sicking, a=dbaron
authorbzbarsky@mit.edu
Tue, 14 Aug 2007 11:42:10 -0700
changeset 4633 aa2839cd1a782439f283ab6f554a6a6a7eaeacb8
parent 4632 a50754a328c4d252f127899e29b7b568a7e20244
child 4634 2d672cdfda149d4d34cf4e9c14ac94cbc9e69047
push idunknown
push userunknown
push dateunknown
reviewersdbaron
bugs374013
milestone1.9a8pre
When a file has already been selected, correctly prefill the filepicker with that file. Bug 374013, r+sr=sicking, a=dbaron
layout/forms/nsFileControlFrame.cpp
--- 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;
 }