mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 15:26:07 +00:00
make window menu convert Unicode to ACP before pass it to window API
This commit is contained in:
parent
8097761fe0
commit
8f56b423b8
@ -56,6 +56,7 @@ CPPSRCS = \
|
||||
nsLabel.cpp \
|
||||
nsToolkit.cpp \
|
||||
nsSelectionMgr.cpp \
|
||||
nsStringUtil.cpp \
|
||||
$(NULL)
|
||||
|
||||
MODULE=raptor
|
||||
@ -94,6 +95,7 @@ OBJS = \
|
||||
.\$(OBJDIR)\nsLabel.obj \
|
||||
.\$(OBJDIR)\nsToolkit.obj \
|
||||
.\$(OBJDIR)\nsSelectionMgr.obj \
|
||||
.\$(OBJDIR)\nsStringUtil.obj \
|
||||
$(NULL)
|
||||
|
||||
LINCS= \
|
||||
|
@ -360,7 +360,7 @@ NS_METHOD nsMenu::InsertItemAt(const PRUint32 aCount, nsISupports * aMenuItem)
|
||||
PRInt32 id = ((nsWindow *)win)->GetNewCmdMenuId();
|
||||
((nsMenuItem *)((nsIMenuItem *)menuItem))->SetCmdId(id);
|
||||
|
||||
char * nameStr = name.ToNewCString();
|
||||
char * nameStr = GetACPString(name);
|
||||
|
||||
MENUITEMINFO menuInfo;
|
||||
menuInfo.cbSize = sizeof(menuInfo);
|
||||
@ -380,7 +380,7 @@ NS_METHOD nsMenu::InsertItemAt(const PRUint32 aCount, nsISupports * aMenuItem)
|
||||
menu->GetLabel(name);
|
||||
//mItems->AppendElement((nsISupports *)(nsIMenu *)menu);
|
||||
|
||||
char * nameStr = name.ToNewCString();
|
||||
char * nameStr = GetACPString(name);
|
||||
|
||||
HMENU nativeMenuHandle;
|
||||
void * voidData;
|
||||
@ -476,7 +476,7 @@ NS_METHOD nsMenu::RemoveMenuListener(nsIMenuListener * aMenuListener)
|
||||
//-------------------------------------------------------------------------
|
||||
nsEventStatus nsMenu::MenuSelected(const nsMenuEvent & aMenuEvent)
|
||||
{
|
||||
char* menuLabel = mLabel.ToNewCString();
|
||||
char* menuLabel = GetACPString(mLabel);
|
||||
printf("Menu Selected %s\n", menuLabel);
|
||||
delete[] menuLabel;
|
||||
if (nsnull != mListener) {
|
||||
@ -488,7 +488,7 @@ nsEventStatus nsMenu::MenuSelected(const nsMenuEvent & aMenuEvent)
|
||||
//-------------------------------------------------------------------------
|
||||
nsEventStatus nsMenu::MenuDeselected(const nsMenuEvent & aMenuEvent)
|
||||
{
|
||||
char* menuLabel = mLabel.ToNewCString();
|
||||
char* menuLabel = GetACPString(mLabel);
|
||||
printf("Menu Deselected %s\n", menuLabel);
|
||||
delete[] menuLabel;
|
||||
if (nsnull != mListener) {
|
||||
|
@ -164,7 +164,7 @@ NS_METHOD nsMenuBar::InsertMenuAt(const PRUint32 aPos, nsIMenu *& aMenu)
|
||||
{
|
||||
nsString name;
|
||||
aMenu->GetLabel(name);
|
||||
char * nameStr = name.ToNewCString();
|
||||
char * nameStr = GetACPString(name);
|
||||
|
||||
mItems->InsertElementAt(aMenu, (PRInt32)aPos);
|
||||
NS_ADDREF(aMenu);
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#ifndef NS_STR_UTIL_H
|
||||
#define NS_STR_UTIL_H
|
||||
#include "nsString.h"
|
||||
|
||||
// nsString to temporary char[] macro
|
||||
|
||||
@ -76,4 +77,6 @@ if (! _ns_smallBufUsed) \
|
||||
delete[] aBuf;
|
||||
|
||||
|
||||
char* GetACPString(nsString&);
|
||||
|
||||
#endif // NSStringUtil
|
||||
|
Loading…
x
Reference in New Issue
Block a user