diff options
Diffstat (limited to 'plugins/NewStory/src/utils.cpp')
-rw-r--r-- | plugins/NewStory/src/utils.cpp | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/plugins/NewStory/src/utils.cpp b/plugins/NewStory/src/utils.cpp index 96e7525e19..eb6b405d35 100644 --- a/plugins/NewStory/src/utils.cpp +++ b/plugins/NewStory/src/utils.cpp @@ -9,11 +9,11 @@ DWORD toggleBit(DWORD dw, DWORD bit) bool CheckFilter(TCHAR *buf, TCHAR *filter) { -// MessageBox(0, buf, filter, MB_OK); + // MessageBox(0, buf, filter, MB_OK); int l1 = lstrlen(buf); int l2 = lstrlen(filter); - for (int i = 0; i < l1-l2+1; i++) - if (CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, buf+i, l2, filter, l2) == CSTR_EQUAL) + for (int i = 0; i < l1 - l2 + 1; i++) + if (CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, buf + i, l2, filter, l2) == CSTR_EQUAL) return true; return false; } @@ -22,17 +22,17 @@ void CopyText(HWND hwnd, TCHAR *text) { OpenClipboard(hwnd); EmptyClipboard(); - HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(text)+1)); + HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(text) + 1)); TCHAR *s = (TCHAR *)GlobalLock(hMem); lstrcpy(s, text); GlobalUnlock(hMem); #ifdef UNICODE - SetClipboardData(CF_UNICODETEXT, hMem); + SetClipboardData(CF_UNICODETEXT, hMem); #else - SetClipboardData(CF_TEXT, hMem); + SetClipboardData(CF_TEXT, hMem); #endif CloseClipboard(); -// GlobalFree(hMem); + // GlobalFree(hMem); } /*void ExportHistory(HANDLE hContact, char *fnTemplate, char *fn, HWND hwndHistory) @@ -211,17 +211,16 @@ void CopyText(HWND hwnd, TCHAR *text) char *appendString(char *s1, char *s2) { - if (s1) - { + if (s1) { int l1 = lstrlenA(s1); int l2 = lstrlenA(s2); - char *buf = (char *)malloc(l1+l2+1); - _snprintf(buf, l1+l2+1, "%s%s", s1, s2); + char *buf = (char *)malloc(l1 + l2 + 1); + _snprintf(buf, l1 + l2 + 1, "%s%s", s1, s2); free(s1); return buf; - } else - { - char *buf = (char *)malloc(lstrlenA(s2)+1); + } + else { + char *buf = (char *)malloc(lstrlenA(s2) + 1); lstrcpyA(buf, s2); return buf; } @@ -229,18 +228,17 @@ char *appendString(char *s1, char *s2) WCHAR *appendString(WCHAR *s1, WCHAR *s2) { - if (s1) - { + if (s1) { int l1 = lstrlenW(s1); int l2 = lstrlenW(s2); - WCHAR *buf = (WCHAR *)malloc(sizeof(WCHAR)*(l1+l2+1)); - _snwprintf(buf, l1+l2+1, L"%s%s", s1, s2); + WCHAR *buf = (WCHAR *)malloc(sizeof(WCHAR)*(l1 + l2 + 1)); + _snwprintf(buf, l1 + l2 + 1, L"%s%s", s1, s2); free(s1); return buf; - } else - { - WCHAR *buf = (WCHAR *)malloc(sizeof(WCHAR)*(lstrlenW(s2)+1)); + } + else { + WCHAR *buf = (WCHAR *)malloc(sizeof(WCHAR)*(lstrlenW(s2) + 1)); lstrcpyW(buf, s2); return buf; } -}
\ No newline at end of file +} |