From 4a142a268105845d14b117499a42117a21af3404 Mon Sep 17 00:00:00 2001 From: "shrutiv%netscape.com" Date: Fri, 5 Apr 2002 22:55:03 +0000 Subject: [PATCH] Fix for bug 4744: Ability to customize localized browser (r=smeredith) --- cck/ib/ib.cpp | 15 +++++++++------ cck/ib/wizshell.cpp | 23 +++++++++++++++++++++-- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/cck/ib/ib.cpp b/cck/ib/ib.cpp index d90c1389cc5f..c70a56e2e39b 100644 --- a/cck/ib/ib.cpp +++ b/cck/ib/ib.cpp @@ -1182,7 +1182,9 @@ int interpret(char *cmd) strcat(temp, newvalue); newvalue = temp; } - WritePrivateProfileString(section, key, newvalue, iniDstPath); + CString encodedValue = newvalue; + WritePrivateProfileString(section, key, ConvertUTF8toANSI(encodedValue), + iniDstPath); } else if (strcmp(cmdname, "replaceXPI") == 0) { @@ -1458,7 +1460,7 @@ void init_components() // Turn off components that aren't selected for (i=0; ivalue, Components[i].name) == NULL)) + if ((strstr(ConvertUTF8toANSI(w->value), Components[i].name) == NULL)) { if (!(Components[i].selected && Components[i].invisible)) Components[i].selected = FALSE; @@ -1593,8 +1595,8 @@ void AddThirdParty() { CString tpCompPath1 = GetGlobal("CustomComponentPath1"); CString tpCompPath2 = GetGlobal("CustomComponentPath2"); - CString tpComp1 = GetGlobal("CustomComponentDesc1"); - CString tpComp2 = GetGlobal("CustomComponentDesc2"); + CString tpComp1 = ConvertUTF8toANSI(GetGlobal("CustomComponentDesc1")); + CString tpComp2 = ConvertUTF8toANSI(GetGlobal("CustomComponentDesc2")); CString tpCompSize1 = GetGlobal("CustomComponentSize1"); CString tpCompSize2 = GetGlobal("CustomComponentSize2"); CString componentName; @@ -2343,9 +2345,10 @@ int StartIB(/*CString parms, WIDGET *curWidget*/) CString MozBrowser = GetBrowser(); // CreateShortcut(MozBrowser, TargetFile, "HelpLink", TargetDir, FALSE); + SetCurrentDirectory(configPath); EraseDirectory(tempPath); - _chdir(configPath); - _rmdir("Temp"); + RemoveDirectory(tempPath); + return TRUE; } diff --git a/cck/ib/wizshell.cpp b/cck/ib/wizshell.cpp index 0f22bd5d9ac1..c324fce0f27f 100644 --- a/cck/ib/wizshell.cpp +++ b/cck/ib/wizshell.cpp @@ -6,6 +6,8 @@ #include #include "comp.h" #include "ib.h" +#include +#define LATIN1_CODEPAGE 1252 extern CString rootPath;// = GetGlobal("Root"); extern CString configName;// = GetGlobal("CustomizationList"); @@ -60,11 +62,11 @@ void CreateRshell (void) rshell <