mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Supplementary patch to bug 66868 to use attribute AString unicodePath; r=mkaply sr=mscott
This commit is contained in:
parent
97ad17c191
commit
903d0c79bf
@ -992,7 +992,7 @@ function getFormElementValue(formElement) {
|
||||
formElement.getAttribute("datatype") == "nsIFileSpec") {
|
||||
if (formElement.value) {
|
||||
var filespec = Components.classes["@mozilla.org/filespec;1"].createInstance(Components.interfaces.nsIFileSpec);
|
||||
filespec.setUnicodePath(formElement.value);
|
||||
filespec.unicodePath = formElement.value;
|
||||
return filespec;
|
||||
}
|
||||
return null;
|
||||
@ -1065,7 +1065,7 @@ function setFormElementValue(formElement, value) {
|
||||
if (value) {
|
||||
var filespec = value.QueryInterface(Components.interfaces.nsIFileSpec);
|
||||
try {
|
||||
formElement.value = filespec.getUnicodePath();
|
||||
formElement.value = filespec.unicodePath;
|
||||
} catch (ex) {
|
||||
dump("Still need to fix uninitialized filespec problem!\n");
|
||||
}
|
||||
|
@ -213,29 +213,22 @@ NS_IMETHODIMP nsFileSpecImpl::SetNativePath(const char * aNativePath)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsFileSpecImpl::GetUnicodePath(PRUnichar * *aUnicodePath)
|
||||
NS_IMETHODIMP nsFileSpecImpl::GetUnicodePath(nsAString & aUnicodePath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
TEST_OUT_PTR(aUnicodePath)
|
||||
nsAutoString unicode;
|
||||
nsCAutoString native;
|
||||
native = mFileSpec.GetNativePathCString();
|
||||
NS_CopyNativeToUnicode(native, unicode);
|
||||
*aUnicodePath = nsCRT::strdup(unicode.get());
|
||||
if (!*aUnicodePath)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_CopyNativeToUnicode(native, aUnicodePath);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsFileSpecImpl::SetUnicodePath(const PRUnichar * aUnicodePath)
|
||||
NS_IMETHODIMP nsFileSpecImpl::SetUnicodePath(const nsAString & aUnicodePath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsAutoString unicode;
|
||||
nsCAutoString native;
|
||||
|
||||
unicode = aUnicodePath;
|
||||
NS_CopyUnicodeToNative(unicode, native);
|
||||
NS_CopyUnicodeToNative(aUnicodePath, native);
|
||||
mFileSpec = native.get();
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -154,8 +154,7 @@ interface nsIFileSpec : nsISupports
|
||||
void seek(in long offset);
|
||||
long tell();
|
||||
void endLine();
|
||||
wstring getUnicodePath();
|
||||
void setUnicodePath(in wstring aUnicodePath);
|
||||
attribute AString unicodePath;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user