Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1:/tmp/cvs-serv820/src/classes
Modified Files:
MessageView.cpp PathFinder.cpp Profile.cpp Sequence.cpp
XFace.cpp
Log Message:
unicode fixes
Index: MessageView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MessageView.cpp,v
retrieving revision 1.139
retrieving revision 1.140
diff -b -u -2 -r1.139 -r1.140
--- MessageView.cpp 11 Oct 2003 17:02:37 -0000 1.139
+++ MessageView.cpp 11 Oct 2003 20:23:48 -0000 1.140
@@ -1366,5 +1366,5 @@
{
XFace *xface = new XFace;
- xface->CreateFromXFace(xfaceString.c_str());
+ xface->CreateFromXFace(wxConvertWX2MB(xfaceString));
char **xfaceXpm;
Index: PathFinder.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/PathFinder.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -b -u -2 -r1.22 -r1.23
--- PathFinder.cpp 11 Oct 2003 17:02:37 -0000 1.22
+++ PathFinder.cpp 11 Oct 2003 20:23:48 -0000 1.23
@@ -48,5 +48,5 @@
{
wxChar *work = new wxChar[ipathlist.length()+1];
- wxChar *found;
+ wxChar *found, *save_ptr;
String tmp;
String subdirList = _T("");
@@ -54,5 +54,5 @@
MOcheck();
wxStrcpy(work,ipathlist.c_str());
- found = wxStrtok(work, PATHFINDER_DELIMITER);
+ found = wxStrtok(work, PATHFINDER_DELIMITER, &save_ptr);
while(found)
@@ -77,5 +77,5 @@
}
}
- found = wxStrtok(NULL, PATHFINDER_DELIMITER);
+ found = wxStrtok(NULL, PATHFINDER_DELIMITER, &save_ptr);
}
delete[] work;
@@ -96,5 +96,5 @@
{
work = *(*i) + DIR_SEPARATOR + filename;
- result = access(work.c_str(),mode);
+ result = wxAccess(work.c_str(),mode);
if(result == 0)
{
@@ -105,5 +105,5 @@
if(found)
*found = false;
- return "";
+ return _T("");
}
@@ -120,5 +120,5 @@
{
work = *(*i) + DIR_SEPARATOR + filename;
- result = access(work.c_str(),mode);
+ result = wxAccess(work.c_str(),mode);
if(result == 0 && IsFile(work))
{
@@ -129,5 +129,5 @@
if(found)
*found = false;
- return "";
+ return _T("");
}
@@ -144,5 +144,5 @@
{
work = *(*i) + DIR_SEPARATOR + filename;
- result = access(work.c_str(),mode);
+ result = wxAccess(work.c_str(),mode);
if(result == 0 && IsDir(work))
{
@@ -153,5 +153,5 @@
if(found)
*found = false;
- return "";
+ return _T("");
}
@@ -168,5 +168,5 @@
{
work = *(*i) + DIR_SEPARATOR + filename;
- result = access(work.c_str(),mode);
+ result = wxAccess(work.c_str(),mode);
if(result == 0 && IsFile(work) && IsDir(*(*i)))
{
@@ -177,5 +177,5 @@
if(found)
*found = false;
- return "";
+ return _T("");
}
Index: Profile.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/Profile.cpp,v
retrieving revision 1.154
retrieving revision 1.155
diff -b -u -2 -r1.154 -r1.155
--- Profile.cpp 7 Oct 2003 23:43:13 -0000 1.154
+++ Profile.cpp 11 Oct 2003 20:23:48 -0000 1.155
@@ -65,9 +65,9 @@
/// a name for the empty profile, like this it is invalid for wxConfig, so it
/// will never conflict with a real profile name
-#define PROFILE_EMPTY_NAME "EMPTYPROFILE?(*[]{}"
+#define PROFILE_EMPTY_NAME _T("EMPTYPROFILE?(*[]{}")
/** Name for the subgroup level used for suspended profiles. Must
never appear as part of a profile path name. */
-#define SUSPEND_PATH "__suspended__"
+#define SUSPEND_PATH _T("__suspended__")
/// flags for readEntry
@@ -436,5 +436,5 @@
/// Read a character entry.
String readEntry(const String & key,
- const String & defaultvalue = (const char *)NULL,
+ const String & defaultvalue = (const wxChar *)NULL,
ReadResult * found = NULL) const;
/// Read an integer value.
@@ -524,5 +524,5 @@
~ProfileImpl();
- virtual const char * GetProfileSection(void) const
+ virtual const wxChar * GetProfileSection(void) const
{
return M_PROFILE_CONFIG_SECTION;
@@ -592,5 +592,5 @@
{ return new Identity(name); }
- virtual const char * GetProfileSection(void) const
+ virtual const wxChar * GetProfileSection(void) const
{
return M_IDENTITY_CONFIG_SECTION;
@@ -626,5 +626,5 @@
{ return new FilterProfile(name); }
- virtual const char * GetProfileSection(void) const
+ virtual const wxChar * GetProfileSection(void) const
{
return M_FILTERS_CONFIG_SECTION;
@@ -1176,6 +1176,6 @@
{
ASSERT(classname.Length() == 0 || // only relative paths allowed
- (classname[0u] != '.' && classname[0u] != '/'));
- String newName = "Modules/" + classname;
+ (classname[0u] != '.' && classname[0u] != _T('/')));
+ String newName = _T("Modules/") + classname;
Profile *p = ProfileImpl::CreateProfile(newName, parent);
@@ -1203,5 +1203,5 @@
gs_allConfigSources = new AllConfigSources(filename);
- Profile *p = ProfileImpl::CreateProfile("",NULL);
+ Profile *p = ProfileImpl::CreateProfile(_T(""),NULL);
EnforcePolicy(p);
return p;
@@ -1270,5 +1270,5 @@
String
Profile::readEntry(const String& key,
- const char *defaultvalue,
+ const wxChar *defaultvalue,
ReadResult *found) const
{
@@ -1301,8 +1301,8 @@
m_ProfileName = ( Parent && Parent->GetName().Length())
- ? ( Parent->GetName() + '/' )
+ ? ( Parent->GetName() + _T('/') )
: String(GetRootPath());
if(iName.Length())
- m_ProfileName << '/' << iName;
+ m_ProfileName << _T('/') << iName;
m_Suspended = 0;
m_Identity = NULL;
@@ -1327,5 +1327,5 @@
ProfileImpl::GetParent(void) const
{
- return CreateProfile(GetName().BeforeLast('/'), NULL);
+ return CreateProfile(GetName().BeforeLast(_T('/')), NULL);
}
@@ -1436,5 +1436,5 @@
PCHECK();
- return m_Identity ? m_Identity->GetName() : String("");
+ return m_Identity ? m_Identity->GetName() : String(_T(""));
}
@@ -1741,10 +1741,10 @@
String path;
- path << key << '/';
+ path << key << _T('/');
size_t nCount = astr.Count();
String strkey;
for ( size_t n = 0; n < nCount; n++ ) {
- strkey.Printf("%lu", (unsigned long)n);
+ strkey.Printf(_T("%lu"), (unsigned long)n);
conf->Write(path + strkey, astr[n]);
}
@@ -1757,13 +1757,13 @@
String path;
- path << key << '/';
+ path << key << _T('/');
String strkey, strVal;
for ( size_t n = 0; ; n++ ) {
- strkey.Printf("%lu", (unsigned long)n);
+ strkey.Printf(_T("%lu"), (unsigned long)n);
if ( !conf->HasEntry(path+strkey) )
break;
- strVal = conf->Read(path+strkey, "");
+ strVal = conf->Read(path+strkey, _T(""));
astr.Add(strVal);
}
@@ -1800,5 +1800,5 @@
// the list of characters which are allowed in the profile names (all other
// non alphanumeric chars are not)
- static const char *aValidChars = "_-."; // NOT '/' and '\\'!
+ static const wxChar *aValidChars = _T("_-."); // NOT '/' and '\\'!
String filteredName;
@@ -1807,6 +1807,6 @@
for ( size_t n = 0; n < len; n++ )
{
- char ch = profileName[n];
- if ( isalnum(ch) || strchr(aValidChars, ch) )
+ wxChar ch = profileName[n];
+ if ( isalnum(ch) || wxStrchr(aValidChars, ch) )
{
filteredName << ch;
@@ -1815,5 +1815,5 @@
{
// replace it -- hopefully the name will stay unique (FIXME)
- filteredName << '_';
+ filteredName << _T('_');
}
}
@@ -1850,5 +1850,5 @@
if ( GetName().StartsWith(GetProfilePath(), &folderName) )
{
- const char *p = folderName.c_str();
+ const wxChar *p = folderName.c_str();
if ( *p )
Index: Sequence.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/Sequence.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -b -u -2 -r1.7 -r1.8
--- Sequence.cpp 18 Sep 2003 16:30:50 -0000 1.7
+++ Sequence.cpp 11 Oct 2003 20:23:48 -0000 1.8
@@ -275,5 +275,5 @@
String GetSequenceString(const UIdArray *messages)
{
- CHECK( messages, "", _T("NULL messages array in GetSequenceString") );
+ CHECK( messages, _T(""), _T("NULL messages array in GetSequenceString") );
Sequence seq;
Index: XFace.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/XFace.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -b -u -2 -r1.29 -r1.30
--- XFace.cpp 18 Sep 2003 16:30:50 -0000 1.29
+++ XFace.cpp 11 Oct 2003 20:23:48 -0000 1.30
@@ -75,5 +75,5 @@
}
//convert it:
- String out = strutil_enforceCRLF(xface);
+ String out = strutil_enforceCRLF(wxConvertMB2WX(xface));
delete [] xface;
xface = strutil_strdup(out);
@@ -116,12 +116,12 @@
{
strncpy(buffer,token+4,8);
- tstr = buffer;
+ tstr = wxConvertMB2WX(buffer);
strutil_tolower(tstr);
- if(tstr == "#000000" || tstr == "gray0")
+ if(tstr == _T("#000000") || tstr == _T("gray0"))
zero = token[0];
- else if(tstr == "#ffffff"
- || tstr >= "gray100"
- || tstr >= "white")
+ else if(tstr == _T("#ffffff")
+ || tstr >= _T("gray100")
+ || tstr >= _T("white"))
one = token[0];
}
@@ -150,8 +150,8 @@
value = value ^ 0xffff;
sprintf(buffer,"0x%04lX", value);
- dataString += buffer;
- dataString += ',';
+ dataString += wxConvertMB2WX(buffer);
+ dataString += _T(',');
}
- dataString += '\n';
+ dataString += _T('\n');
token = strsep(&ptr, "\n\r");
if(l < 47 && ! token)
@@ -162,5 +162,5 @@
}
delete [] buf;
- return CreateFromData(dataString);
+ return CreateFromData(wxConvertWX2MB(dataString));
#endif
}
@@ -209,7 +209,7 @@
{
PathFinder pf(READ_APPCONFIG(MP_ICONPATH), true);
- pf.AddPaths(mApplication->GetLocalDir()+"/icons", true);
- pf.AddPaths(mApplication->GetGlobalDir()+"/icons", true);
- String name = pf.FindFile("xface.xpm", &success);
+ pf.AddPaths(mApplication->GetLocalDir() + DIR_SEPARATOR + _T("icons"), true);
+ pf.AddPaths(mApplication->GetGlobalDir() + DIR_SEPARATOR + _T("icons"), true);
+ String name = pf.FindFile(_T("xface.xpm"), &success);
if(success)
img = wxIconManager::LoadImage(name, &success);
@@ -244,9 +244,9 @@
}
value = value ^ 0xffff;
- tmp.Printf("0x%04lX", (unsigned long)value);
+ tmp.Printf(_T("0x%04lX"), (unsigned long)value);
dataString += tmp;
- dataString += ',';
+ dataString += _T(',');
}
- dataString += '\n';
+ dataString += _T('\n');
}
return dataString;
@@ -255,9 +255,9 @@
bool
-XFace::CreateFromFile(const char *filename)
+XFace::CreateFromFile(const wxChar *filename)
{
wxImage img = GetXFaceImg(filename );
String datastring = ConvertImgToXFaceData(img);
- return CreateFromData(datastring);
+ return CreateFromData(wxConvertWX2MB(datastring));
}
@@ -278,5 +278,5 @@
delete [] data;
- char
+ wxChar
buffer[20];
int
@@ -304,7 +304,7 @@
sprintf(buffer,"0x%04lX", value);
dataString += buffer;
- dataString += ',';
+ dataString += _T(',');
}
- dataString += '\n';
+ dataString += _T('\n');
}
return CreateFromData(dataString);
@@ -336,5 +336,5 @@
return false;
}
- String out = strutil_enforceCRLF(xface);
+ String out = strutil_enforceCRLF(wxConvertMB2WX(xface));
delete [] xface;
xface = strutil_strdup(out);
@@ -358,7 +358,7 @@
ptr = buf;
- xpm = "";
+ xpm = _T("");
xpm +=
- "/* XPM */\n"
+ _T("/* XPM */\n"
"static char *xface[] = {\n"
"/* width height num_colors chars_per_pixel */\n"
@@ -366,5 +366,5 @@
"/* colors */\n"
"\"# c #000000\",\n"
- "\". c #ffffff\",\n";
+ "\". c #ffffff\",\n");
for(l = 0; l < 48; l++)
{
@@ -383,35 +383,35 @@
{
case '0':
- xpm += "...."; break;
+ xpm += _T("...."); break;
case '1':
- xpm += "...#"; break;
+ xpm += _T("...#"); break;
case '2':
- xpm += "..#."; break;
+ xpm += _T("..#."); break;
case '3':
- xpm += "..##"; break;
+ xpm += _T("..##"); break;
case '4':
- xpm += ".#.."; break;
+ xpm += _T(".#.."); break;
case '5':
- xpm += ".#.#"; break;
+ xpm += _T(".#.#"); break;
case '6':
- xpm += ".##."; break;
+ xpm += _T(".##."); break;
case '7':
- xpm += ".###"; break;
+ xpm += _T(".###"); break;
case '8':
- xpm += "#..."; break;
+ xpm += _T("#..."); break;
case '9':
- xpm += "#..#"; break;
+ xpm += _T("#..#"); break;
case 'a': case 'A':
- xpm += "#.#."; break;
+ xpm += _T("#.#."); break;
case 'b': case 'B':
- xpm += "#.##"; break;
+ xpm += _T("#.##"); break;
case 'c': case 'C':
- xpm += "##.."; break;
+ xpm += _T("##.."); break;
case 'd': case 'D':
- xpm += "##.#"; break;
+ xpm += _T("##.#"); break;
case 'e': case 'E':
- xpm += "###."; break;
+ xpm += _T("###."); break;
case 'f': case 'F':
- xpm += "####"; break;
+ xpm += _T("####"); break;
default:
break;
@@ -421,9 +421,9 @@
}
}
- xpm += '"';
+ xpm += _T('"');
if(l < 47)
- xpm += ",\n";
+ xpm += _T(",\n");
else
- xpm += "\n};\n";
+ xpm += _T("\n};\n");
}
return true;
@@ -456,5 +456,5 @@
for(l = 0; l < 48; l++)
{
- tmp = "";
+ tmp = _T("");
for(c = 0; c < 3; c++)
{
@@ -470,35 +470,35 @@
{
case '0':
- tmp += "...."; break;
+ tmp += _T("...."); break;
case '1':
- tmp += "...#"; break;
+ tmp += _T("...#"); break;
case '2':
- tmp += "..#."; break;
+ tmp += _T("..#."); break;
case '3':
- tmp += "..##"; break;
+ tmp += _T("..##"); break;
case '4':
- tmp += ".#.."; break;
+ tmp += _T(".#.."); break;
case '5':
- tmp += ".#.#"; break;
+ tmp += _T(".#.#"); break;
case '6':
- tmp += ".##."; break;
+ tmp += _T(".##."); break;
case '7':
- tmp += ".###"; break;
+ tmp += _T(".###"); break;
case '8':
- tmp += "#..."; break;
+ tmp += _T("#..."); break;
case '9':
- tmp += "#..#"; break;
+ tmp += _T("#..#"); break;
case 'a': case 'A':
- tmp += "#.#."; break;
+ tmp += _T("#.#."); break;
case 'b': case 'B':
- tmp += "#.##"; break;
+ tmp += _T("#.##"); break;
case 'c': case 'C':
- tmp += "##.."; break;
+ tmp += _T("##.."); break;
case 'd': case 'D':
- tmp += "##.#"; break;
+ tmp += _T("##.#"); break;
case 'e': case 'E':
- tmp += "###."; break;
+ tmp += _T("###."); break;
case 'f': case 'F':
- tmp += "####"; break;
+ tmp += _T("####"); break;
default:
break;
@@ -520,7 +520,7 @@
{
if(xface)
- return xface;
+ return wxConvertMB2WX(xface);
else
- return "";
+ return _T("");
}
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates