Fixing bug 240723. Cleaning up nsIFilePicker a bit, no more nsIDOMWindowInternal, and use our string classes and not raw strings. r=caillon@gmail.com, sr=bzbarsky@mit.edu
git-svn-id: svn://10.0.0.236/trunk@155308 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -272,9 +272,8 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
|
||||
if (!doc)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIDOMWindowInternal> parentWindow = do_QueryInterface(doc->GetScriptGlobalObject());
|
||||
if (!parentWindow)
|
||||
return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIDOMWindow> parentWindow =
|
||||
do_QueryInterface(doc->GetScriptGlobalObject());
|
||||
|
||||
// Get Loc title
|
||||
nsString title;
|
||||
@@ -285,7 +284,7 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
|
||||
if (!filePicker)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
result = filePicker->Init(parentWindow, title.get(), nsIFilePicker::modeOpen);
|
||||
result = filePicker->Init(parentWindow, title, nsIFilePicker::modeOpen);
|
||||
if (NS_FAILED(result))
|
||||
return result;
|
||||
|
||||
@@ -303,7 +302,7 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
|
||||
nsAutoString leafName;
|
||||
currentFile->GetLeafName(leafName);
|
||||
if (!leafName.IsEmpty()) {
|
||||
filePicker->SetDefaultString(leafName.get());
|
||||
filePicker->SetDefaultString(leafName);
|
||||
}
|
||||
|
||||
// set directory
|
||||
|
||||
Reference in New Issue
Block a user