|
From: <ma...@us...> - 2003-11-23 18:55:11
|
Update of /cvsroot/sharedaemon/ui-wx/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28874/src
Modified Files:
wxInterface.cpp Images.cpp
Log Message:
Fixed two endless loops on win32 due to different path separator.
Index: wxInterface.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- wxInterface.cpp 21 Nov 2003 11:05:55 -0000 1.5
+++ wxInterface.cpp 23 Nov 2003 18:55:08 -0000 1.6
@@ -109,6 +109,7 @@
*/
void wxInterface::Localize() {
wxString curlang, path;
+ wxChar sep;
/**
* Get application binary path from argv[0] and remove the binary file-
@@ -117,7 +118,12 @@
* resources.
*/
path = wxTheApp->argv[0];
- while (path.Last() != *wxT("/")) {
+ #if defined(__WXMSW__)
+ sep = '\\';
+ #else
+ sep = '/';
+ #endif
+ while ((path.Last() != sep) && (path.Length()>1)) {
path.RemoveLast();
}
Index: Images.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Images.cpp 23 Nov 2003 15:53:17 -0000 1.16
+++ Images.cpp 23 Nov 2003 18:55:08 -0000 1.17
@@ -39,6 +39,7 @@
*/
void CImages::LoadImages() {
wxString path, apppath;
+ wxChar sep;
/**
* We get the application binary path from argv[0], remove the binary
@@ -47,7 +48,12 @@
* prevent us from accessing resources.
*/
apppath = wxTheApp->argv[0];
- while (apppath.Last() != *wxT("/")) {
+ #if defined(__WXMSW__)
+ sep = '\\';
+ #else
+ sep = '/';
+ #endif
+ while ((apppath.Last() != sep) && (apppath.Length()>1)) {
apppath.RemoveLast();
}
@@ -149,7 +155,7 @@
/* Temporary bitmap for measuring text lengths. 100 pixels should be enuff. */
tmp = wxBitmap(100, 100);
mdc.SelectObject(tmp);
- for (uint i=0;i<btntxt.GetCount();i++) {
+ for (unsigned int i=0;i<btntxt.GetCount();i++) {
mdc.GetTextExtent(btntxt.Item(i), &x, &y);
if (x > width) {
width = x;
|