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
parent 1bc071b87a
commit c75d55c0dc
2 changed files with 12 additions and 4 deletions

View File

@ -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( "\",\"\"" ));

View File

@ -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( "\",\"\"" ));