From ee646f474323be80390311b1bf88b8636c3d7f2e Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Wed, 2 Jul 2014 02:30:10 -0400 Subject: [PATCH] ecere: Added ChangeChars(); eda/ers: ; Avoiding bad filenames - Also fixed warnings in WSMS config --- ecere/src/com/String.ec | 7 +++++++ ecere/src/gfx/drivers/LFBDisplayDriver.ec | 2 ++ ecere/src/gui/drivers/Win32Interface.ec | 4 +++- ecere/src/sys/JSON.ec | 2 +- eda/libeda/src/ers.ec | 1 + 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ecere/src/com/String.ec b/ecere/src/com/String.ec index a43c7af..d7b7258 100644 --- a/ecere/src/com/String.ec +++ b/ecere/src/com/String.ec @@ -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; diff --git a/ecere/src/gfx/drivers/LFBDisplayDriver.ec b/ecere/src/gfx/drivers/LFBDisplayDriver.ec index 119d7c9..4185e47 100644 --- a/ecere/src/gfx/drivers/LFBDisplayDriver.ec +++ b/ecere/src/gfx/drivers/LFBDisplayDriver.ec @@ -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 { diff --git a/ecere/src/gui/drivers/Win32Interface.ec b/ecere/src/gui/drivers/Win32Interface.ec index 4547399..a7be975 100644 --- a/ecere/src/gui/drivers/Win32Interface.ec +++ b/ecere/src/gui/drivers/Win32Interface.ec @@ -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 diff --git a/ecere/src/sys/JSON.ec b/ecere/src/sys/JSON.ec index b472f2a..5388f9b 100644 --- a/ecere/src/sys/JSON.ec +++ b/ecere/src/sys/JSON.ec @@ -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! { diff --git a/eda/libeda/src/ers.ec b/eda/libeda/src/ers.ec index 90db95a..878925f 100644 --- a/eda/libeda/src/ers.ec +++ b/eda/libeda/src/ers.ec @@ -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; -- 1.8.3.1