bug 281781 : HandleDDENotification returns zero-extended values for WWW_GetWindowInfo patch by Masayuki Nakano, r=jshin, sr=bz, a=asa

This commit is contained in:
jshin%mailaps.org 2005-02-16 06:31:43 +00:00
Родитель 0a5491b169
Коммит 5cae14d73f
2 изменённых файлов: 12 добавлений и 4 удалений

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

@ -76,6 +76,7 @@
#include "nsIJSContextStack.h"
#include "nsIWebNavigation.h"
#include "nsIWindowMediator.h"
#include "nsNativeCharsetUtils.h"
#include <windows.h>
#include <shellapi.h>
@ -1090,12 +1091,15 @@ nsNativeAppSupportWin::HandleDDENotification( UINT uType, // transaction t
nsCAutoString outpt( NS_LITERAL_CSTRING("\"") );
// Now copy the URL converting the Unicode string
// to a single-byte ASCII string
outpt.Append( NS_LossyConvertUCS2toASCII( url ) );
nsCAutoString tmpNativeStr;
NS_CopyUnicodeToNative( url, tmpNativeStr );
outpt.Append( tmpNativeStr );
// Add the "," used to separate the URL and the page
// title
outpt.Append( NS_LITERAL_CSTRING("\",\"") );
// Now copy the current page title to the return string
outpt.Append( NS_LossyConvertUCS2toASCII( title.get() ));
NS_CopyUnicodeToNative( title, tmpNativeStr );
outpt.Append( tmpNativeStr );
// Fill out the return string with the remainin ",""
outpt.Append( NS_LITERAL_CSTRING( "\",\"\"" ));

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

@ -72,6 +72,7 @@
#include "nsIObserverService.h"
#include "nsXPCOM.h"
#include "nsXPFEComponentsCID.h"
#include "nsNativeCharsetUtils.h"
struct JSContext;
@ -1511,12 +1512,15 @@ nsNativeAppSupportWin::HandleDDENotification( UINT uType, // transaction t
nsCAutoString outpt( NS_LITERAL_CSTRING("\"") );
// Now copy the URL converting the Unicode string
// to a single-byte ASCII string
outpt.Append( NS_LossyConvertUTF16toASCII( url ) );
nsCAutoString tmpNativeStr;
NS_CopyUnicodeToNative( url, tmpNativeStr );
outpt.Append( tmpNativeStr );
// Add the "," used to separate the URL and the page
// title
outpt.Append( NS_LITERAL_CSTRING("\",\"") );
// Now copy the current page title to the return string
outpt.Append( NS_LossyConvertUTF16toASCII( title ));
NS_CopyUnicodeToNative( title, tmpNativeStr );
outpt.Append( tmpNativeStr );
// Fill out the return string with the remainin ",""
outpt.Append( NS_LITERAL_CSTRING( "\",\"\"" ));