ecere: Added ChangeChars(); eda/ers: ; Avoiding bad filenames
authorJerome St-Louis <jerome@ecere.com>
Wed, 2 Jul 2014 06:30:10 +0000 (02:30 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 2 Jul 2014 06:30:10 +0000 (02:30 -0400)
- Also fixed warnings in WSMS config

ecere/src/com/String.ec
ecere/src/gfx/drivers/LFBDisplayDriver.ec
ecere/src/gui/drivers/Win32Interface.ec
ecere/src/sys/JSON.ec
eda/libeda/src/ers.ec

index a43c7af..d7b7258 100644 (file)
@@ -1003,6 +1003,13 @@ public void ChangeCh(char * string, char ch1, char ch2)
       if(string[c] == ch1) string[c] = ch2;
 }
 
+public void ChangeChars(char * string, const char * chars, char alt)
+{
+   int c;
+   for(c=0; string[c]; c++)
+      if(strchr(chars, string[c])) string[c] = alt;
+}
+
 public void RepeatCh(char * string, int count, char ch)
 {
    int c;
index 119d7c9..4185e47 100644 (file)
@@ -873,8 +873,10 @@ static int CALLBACK MyFontProc(ENUMLOGFONTEX * font, NEWTEXTMETRICEX *lpntme, in
 }
 #endif
 
+#if !defined(ECERE_NOTRUETYPE)
 static int utf16BufferSize = 0;
 static uint16 * utf16 = null;
+#endif
 
 public class LFBDisplayDriver : DisplayDriver
 {
index 4547399..a7be975 100644 (file)
@@ -113,7 +113,9 @@ static const uint16 className[] = L"Ecere Application";
 static HINSTANCE hInstance;
 
 static DEVMODE devMode;
+#ifndef ECERE_NODINPUT
 static HWND acquiredWindow = null;
+#endif
 static HCURSOR systemCursors[SystemCursor];
 static bool fullScreenMode;
 static int desktopX = 0, desktopY = 0, desktopW = 0, desktopH = 0;
@@ -1494,7 +1496,6 @@ class Win32Interface : Interface
 
    void SetRootWindowColor(Window window)
    {
-      DWORD style = GetWindowLong(window.windowHandle, GWL_EXSTYLE);
       if(window.alphaBlend && window.display.pixelFormat == pixelFormat888)
       {
          /*if(A(window.background) == 255)
@@ -1505,6 +1506,7 @@ class Win32Interface : Interface
          else*/
          {
 #ifndef ECERE_NOBLENDING
+            DWORD style = GetWindowLong(window.windowHandle, GWL_EXSTYLE);
             if((style & WS_EX_LAYERED) != WS_EX_LAYERED)
                SetWindowLong(window.windowHandle, GWL_EXSTYLE, style | WS_EX_LAYERED);
 #endif
index b472f2a..5388f9b 100644 (file)
@@ -20,7 +20,7 @@ public enum JSONResult { syntaxError, success, typeMismatch, noItem };
 
 public enum SetBool : uint
 {
-   unset, false, true /*; // Syntax error! */
+   unset, false, true;
 
    /*public property bool     // NOT WORKING!
    {
index 90db95a..878925f 100644 (file)
@@ -649,6 +649,7 @@ public class CSVReport : ReportDestination
    {
       char filePath[MAX_LOCATION];
       strcpy(filePath, report.title);
+      ChangeChars(filePath, "/\\:*?\"|<>", '_');
       strcat(filePath, ".csv");
       saveTo.master = master;
       saveTo.filePath = filePath;