r=pedemont, sr=blizzard
OS/2 only - convert filter names to platform specific charset
This commit is contained in:
mkaply%us.ibm.com 2002-04-24 04:13:38 +00:00
parent 9873e0c36d
commit 8d094526f0

View File

@ -37,6 +37,7 @@
#include "nsIURL.h"
#include "nsIFileURL.h"
#include "nsIStringBundle.h"
#include "nsModule.h"
/* Item structure */
typedef struct _MyData
@ -160,7 +161,16 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
for (i = 0; i < mTitles.Count(); i++)
{
const nsString& typeWide = *mTitles[i];
apszTypeList[i] = ToNewCString(typeWide);
PRInt32 l = (typeWide.Length()+2)*2;
char *filterBuffer = (char*) nsMemory::Alloc(l);
int len = gWidgetModuleData->WideCharToMultiByte(0,
typeWide.get(),
typeWide.Length(),
filterBuffer,
l);
filterBuffer[len] = NULL;
filterBuffer[len+1] = NULL;
apszTypeList[i] = filterBuffer;
}
apszTypeList[i] = 0;
filedlg.papszITypeList = (PAPSZ)apszTypeList;