fixing XP_WIN bookmarks bustage

This commit is contained in:
darin%netscape.com 2007-09-12 17:50:01 +00:00
Родитель a59ce831a1
Коммит c6027def9e
1 изменённых файлов: 5 добавлений и 7 удалений

Просмотреть файл

@ -3161,7 +3161,7 @@ nsBookmarksService::ResolveKeyword(const PRUnichar *aUserInput, char **aShortcut
#ifdef XP_WIN #ifdef XP_WIN
// *** code copied from widget/src/windows/nsClipboard.cpp // *** code copied from widget/src/windows/nsClipboard.cpp
// Determines the URL for a shortcut file // Determines the URL for a shortcut file
static void ResolveShortcut(const nsACString &aFileName, char** aOutURL) static void ResolveShortcut(const nsAFlatString &aFileName, char** aOutURL)
{ {
// IUniformResourceLocator isn't supported by VC5 (bless its little heart) // IUniformResourceLocator isn't supported by VC5 (bless its little heart)
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
@ -3174,9 +3174,8 @@ static void ResolveShortcut(const nsACString &aFileName, char** aOutURL)
IPersistFile* urlFile = nsnull; IPersistFile* urlFile = nsnull;
result = urlLink->QueryInterface(IID_IPersistFile, (void**)&urlFile); result = urlLink->QueryInterface(IID_IPersistFile, (void**)&urlFile);
if (SUCCEEDED(result) && urlFile) { if (SUCCEEDED(result) && urlFile) {
NS_ConvertUTF8toUCS2 wideFileName(aFileName);
result = urlFile->Load(wideFileName.get(), STGM_READ); result = urlFile->Load(aFileName.get(), STGM_READ);
if (SUCCEEDED(result) ) { if (SUCCEEDED(result) ) {
LPSTR lpTemp = nsnull; LPSTR lpTemp = nsnull;
@ -3231,9 +3230,8 @@ nsBookmarksService::ParseFavoritesFolder(nsIFile* aDirectory, nsIRDFResource* aP
nsCOMPtr<nsIFileURL> fileURL(do_QueryInterface(uri)); nsCOMPtr<nsIFileURL> fileURL(do_QueryInterface(uri));
fileURL->SetFile(currFile); fileURL->SetFile(currFile);
nsCAutoString leafName; nsAutoString bookmarkName;
currFile->GetLeafName(leafName); currFile->GetLeafName(bookmarkName);
NS_ConvertUTF8toUCS2 bookmarkName(leafName);
PRBool isDir = PR_FALSE; PRBool isDir = PR_FALSE;
currFile->IsDirectory(&isDir); currFile->IsDirectory(&isDir);
@ -3257,7 +3255,7 @@ nsBookmarksService::ParseFavoritesFolder(nsIFile* aDirectory, nsIRDFResource* aP
nsAutoString name(Substring(bookmarkName, 0, nsAutoString name(Substring(bookmarkName, 0,
bookmarkName.Length() - extension.Length() - 1)); bookmarkName.Length() - extension.Length() - 1));
nsCAutoString path; nsAutoString path;
currFile->GetPath(path); currFile->GetPath(path);
nsXPIDLCString url; nsXPIDLCString url;