summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-10 16:26:46 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-10 16:26:46 +0000
commitc4a4d10f023ced1fdab492f1b92d0aa0a39ebc3b (patch)
treed6761e915e20477e99a6f96f72d43f8f335f2693 /plugins
parent6881b6b3e2dec0c4675b4c0b2bf6aff29fa860ed (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@5635 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/Msg_Export/res/resource.rc9
-rwxr-xr-xplugins/Msg_Export/src/FileViewer.cpp497
-rwxr-xr-xplugins/Msg_Export/src/FileViewer.h8
-rwxr-xr-xplugins/Msg_Export/src/options.cpp298
-rwxr-xr-xplugins/Msg_Export/src/options.h4
-rwxr-xr-xplugins/Msg_Export/src/utils.cpp242
-rwxr-xr-xplugins/Msg_Export/src/utils.h22
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp8
8 files changed, 503 insertions, 585 deletions
diff --git a/plugins/Msg_Export/res/resource.rc b/plugins/Msg_Export/res/resource.rc
index eac39d6b06..4906ee6ab6 100755
--- a/plugins/Msg_Export/res/resource.rc
+++ b/plugins/Msg_Export/res/resource.rc
@@ -24,18 +24,18 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
// TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"..\\src\\resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include <winres.h>\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -96,7 +96,7 @@ STYLE DS_SETFONT | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_
CAPTION "History file for %s (%s format %s)"
FONT 8, "MS Sans Serif"
BEGIN
- CONTROL "",IDC_RICHEDIT,"RICHEDIT",TCS_HOTTRACK | TCS_VERTICAL | TCS_BUTTONS | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,6,7,333,224
+ CONTROL "",IDC_RICHEDIT,"RichEdit20W",TCS_HOTTRACK | TCS_VERTICAL | TCS_BUTTONS | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,6,7,333,224
PUSHBUTTON "&Find...",IDC_FV_FIND,46,238,50,14
PUSHBUTTON "&External",IDC_FV_EXTERNAL,142,238,50,14
DEFPUSHBUTTON "&Close",IDOK,246,238,50,14
@@ -228,4 +228,3 @@ END
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp
index 23398db07f..ac6580d9b6 100755
--- a/plugins/Msg_Export/src/FileViewer.cpp
+++ b/plugins/Msg_Export/src/FileViewer.cpp
@@ -18,7 +18,7 @@
#include "Glob.h"
-static UINT UM_FIND_CMD = RegisterWindowMessage( FINDMSGSTRING );
+static UINT UM_FIND_CMD = RegisterWindowMessage( FINDMSGSTRING);
#define ID_FV_FONT 0x0010
#define ID_FV_COLOR 0x0020
@@ -117,8 +117,8 @@ class CLHistoryDlg
{
hFindDlg = NULL;
acFindStr[0] = 0;
- ZeroMemory( &fr, sizeof( fr ));
- fr.lStructSize = sizeof( fr );
+ ZeroMemory(&fr, sizeof( fr ));
+ fr.lStructSize = sizeof( fr);
fr.hInstance = hInstance;
fr.Flags = FR_NOUPDOWN|FR_HIDEUPDOWN;//|FR_MATCHCASE|FR_WHOLEWORD;
// FR_DOWN|FR_FINDNEXT|FR_NOMATCHCASE;
@@ -155,7 +155,7 @@ class CLStreamRTFInfo
int nNickLen;
static int nOptimalReadLen;
- int nWriteHeader( char *pszTarget, int nLen );
+ int nWriteHeader( char *pszTarget, int nLen);
public:
bool bUtf8File;
CLStreamRTFInfo( HANDLE hFile )
@@ -168,7 +168,7 @@ class CLStreamRTFInfo
bUtf8File = false;
nNickLen = 0;
}
- int nLoadFileStream( LPBYTE pbBuff, LONG cb );
+ int nLoadFileStream(LPBYTE pbBuff, LONG cb);
};
int CLStreamRTFInfo::nOptimalReadLen = 3300;
@@ -207,11 +207,11 @@ int CLStreamRTFInfo::nWriteHeader( char *pszTarget, int nLen )
if (nSrcLen > nLen )
{
- MessageBox( NULL, TranslateT("Failed to write to the RichEdit the buffer was to small."), MSG_BOX_TITEL, MB_OK );
+ MessageBox(NULL, TranslateT("Failed to write to the RichEdit the buffer was to small."), MSG_BOX_TITEL, MB_OK);
return 0; // target buffer to small
}
- memcpy( pszTarget, szRtfHeader, nSrcLen );
+ memcpy( pszTarget, szRtfHeader, nSrcLen);
bHeaderWriten = true;
return nSrcLen;
}
@@ -233,14 +233,14 @@ const char szRtfEnd[] = "\r\n\\par }\r\n\0";
// Developer : KN
/////////////////////////////////////////////////////////////////////
-int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
+int CLStreamRTFInfo::nLoadFileStream(LPBYTE pbBuff, LONG cb)
{
if (bTailWriten )
return 0;
if (nOptimalReadLen < 500 )
{
- MessageBox( NULL, TranslateT("Error: Optimal buffer size decrecied to a to low size !!"), MSG_BOX_TITEL, MB_OK );
+ MessageBox(NULL, TranslateT("Error: Optimal buffer size decrecied to a to low size !!"), MSG_BOX_TITEL, MB_OK);
return 0;
}
@@ -256,15 +256,15 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
{
if (dwRead >= 3 )
{
- bUtf8File = bIsUtf8Header( abBuf );
+ bUtf8File = bIsUtf8Header( abBuf);
if (bUtf8File )
n = 3;
}
- dwCurrent += nWriteHeader( (char*)pbBuff, cb );
+ dwCurrent += nWriteHeader( (char*)pbBuff, cb);
tstring sMyNick = NickFromHandle(0);
- nNickLen = WideCharToMultiByte(bUtf8File ? CP_UTF8 : CP_ACP, 0, sMyNick.c_str(), (int)sMyNick.length(), szMyNick, sizeof( szMyNick ), NULL, NULL );
+ nNickLen = WideCharToMultiByte(bUtf8File ? CP_UTF8 : CP_ACP, 0, sMyNick.c_str(), (int)sMyNick.length(), szMyNick, sizeof( szMyNick ), NULL, NULL);
}
else
{
@@ -278,7 +278,7 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
// we shut only get here if we need to change color !!
bLastColorMyNick = !bLastColorMyNick;
// change color
- memcpy( &pbBuff[dwCurrent], bLastColorMyNick ? "\\cf1 " : "\\cf2 ", 5 );
+ memcpy(&pbBuff[dwCurrent], bLastColorMyNick ? "\\cf1 " : "\\cf2 ", 5);
}
bCheckFirstForNick = false;
}
@@ -286,7 +286,7 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
bool bIsFileEnd = dwRead < dwToRead;
- for( ; n < dwRead ; n++ )
+ for (; n < dwRead ; n++ )
{
// worst case is a file ending with \n or a unicode letter. resulting in a big unicode string
// here we need szNewLine and szRtfEnd. the 10 is a small safty margin.
@@ -297,13 +297,13 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
// and rewinde file
// we will adjust the optima buffer size
nOptimalReadLen -= 50;
- SetFilePointer( hFile, n - dwRead, NULL, FILE_CURRENT );
+ SetFilePointer( hFile, n - dwRead, NULL, FILE_CURRENT);
return dwCurrent;
}
if (abBuf[n] == '\n' )
{
- memcpy( &pbBuff[dwCurrent], szNewLine, sizeof( szNewLine )-1 );
+ memcpy(&pbBuff[dwCurrent], szNewLine, sizeof( szNewLine )-1);
dwCurrent += sizeof( szNewLine )-1;
if (n + 1 >= dwRead )
@@ -330,8 +330,8 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
LONG lExtraRead = (n+1) - dwRead;
if (lExtraRead >= 0 )
- MessageBox( NULL, TranslateT("Internal error !! (lExtraRead >= 0)"), MSG_BOX_TITEL, MB_OK );
- SetFilePointer( hFile, lExtraRead, NULL, FILE_CURRENT );
+ MessageBox(NULL, TranslateT("Internal error !! (lExtraRead >= 0)"), MSG_BOX_TITEL, MB_OK);
+ SetFilePointer( hFile, lExtraRead, NULL, FILE_CURRENT);
bCheckFirstForNick = true;
return dwCurrent;
}
@@ -352,7 +352,7 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
else
{
// the data we need is here just compare
- if (( ( memcmp( &abBuf[n+1], szMyNick, nNickLen) == 0) ||
+ if (( ( memcmp(&abBuf[n+1], szMyNick, nNickLen) == 0) ||
( abBuf[n+1] == '<' && abBuf[n+2] == '<')
) == bLastColorMyNick )
continue;
@@ -361,7 +361,7 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
bLastColorMyNick = !bLastColorMyNick;
// change color
- memcpy( &pbBuff[dwCurrent], bLastColorMyNick ? "\\cf1 " : "\\cf2 ", 5 );
+ memcpy(&pbBuff[dwCurrent], bLastColorMyNick ? "\\cf1 " : "\\cf2 ", 5);
dwCurrent += 5;
continue;
}
@@ -372,12 +372,12 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
else if (bUtf8File && (abBuf[n] & 0x80))
{
int nValue;
- int nLen = __utf8_get_char( (const char *)&abBuf[n], &nValue );
+ int nLen = __utf8_get_char( (const char *)&abBuf[n], &nValue);
if(nLen+n>dwRead) {
SetFilePointer(hFile,n-dwRead,NULL,FILE_CURRENT);
break;
}
- dwCurrent += sprintf( (char*)&pbBuff[dwCurrent], "\\u%d?", nValue ); //!!!!!!!!!
+ dwCurrent += sprintf( (char*)&pbBuff[dwCurrent], "\\u%d?", nValue); //!!!!!!!!!
//continue;
/* // Then we have an extended char in the UTF8 file.
// we need to convert this to UCS-2 and then to \uN in the RTF
@@ -388,7 +388,7 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
if (MultiByteToWideChar( CP_UTF8, 0, (char*)&abBuf[n], nUtf8Len, szWstr, 2) == 1 )
{
if ((int)(szWstr[0]) != nValue )
- __utf8_get_char( (const char *)&abBuf[n], &nValue );
+ __utf8_get_char( (const char *)&abBuf[n], &nValue);
// dwCurrent += sprintf( (char*)&pbBuff[dwCurrent], "\\u%d?", (int)(szWstr[0]));
// n += nUtf8Len - 1;
@@ -402,11 +402,11 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
if (bIsFileEnd )
{// write end
- memcpy( &pbBuff[dwCurrent], szRtfEnd, sizeof( szRtfEnd )-1 );
+ memcpy(&pbBuff[dwCurrent], szRtfEnd, sizeof( szRtfEnd )-1);
dwCurrent += sizeof( szRtfEnd )-1;
bTailWriten = true;
}
- //memcpy( pbBuff, abBuf, dwRead );
+ //memcpy( pbBuff, abBuf, dwRead);
return dwCurrent;
}
@@ -426,7 +426,7 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff, LONG cb )
void Initialize()
{
- InitializeCriticalSection( &csHistoryList );
+ InitializeCriticalSection(&csHistoryList);
}
/////////////////////////////////////////////////////////////////////
@@ -444,7 +444,7 @@ void Initialize()
void Uninitilize()
{
- DeleteCriticalSection( &csHistoryList );
+ DeleteCriticalSection(&csHistoryList);
}
/////////////////////////////////////////////////////////////////////
@@ -462,18 +462,18 @@ void Uninitilize()
void UpdateFileViews( const TCHAR *pszFile )
{
- EnterCriticalSection( &csHistoryList );
+ EnterCriticalSection(&csHistoryList);
list< CLHistoryDlg* >::const_iterator iterator;
- for( iterator = clHistoryDlgList.begin() ; iterator != clHistoryDlgList.end() ; ++iterator )
+ for (iterator = clHistoryDlgList.begin() ; iterator != clHistoryDlgList.end() ; ++iterator )
{
CLHistoryDlg* pcl = (*iterator);
if (pcl->sPath == pszFile )
{
- PostMessage( pcl->hWnd, WM_RELOAD_FILE, 0, 0 );
+ PostMessage( pcl->hWnd, WM_RELOAD_FILE, 0, 0);
}
}
- LeaveCriticalSection( &csHistoryList );
+ LeaveCriticalSection(&csHistoryList);
}
/////////////////////////////////////////////////////////////////////
@@ -491,7 +491,7 @@ void UpdateFileViews( const TCHAR *pszFile )
bool bOpenExternaly( HANDLE hContact )
{
- tstring sPath = GetFilePathFromUser( hContact );
+ tstring sPath = GetFilePathFromUser( hContact);
if (sFileViewerPrg.empty())
{
@@ -514,7 +514,7 @@ bool bOpenExternaly( HANDLE hContact )
sStartupInfo.lpTitle = (TCHAR*)sFileViewerPrg.c_str();
PROCESS_INFORMATION stProcesses = {0};
- if ( !CreateProcess( NULL,
+ if ( !CreateProcess(NULL,
(TCHAR*)sTmp.c_str(),
NULL,
NULL,
@@ -602,7 +602,7 @@ DWORD CALLBACK RichEditStreamLoadFile(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb
DWORD CALLBACK RichEditRTFStreamLoadFile(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
- *pcb = ((CLStreamRTFInfo *)dwCookie)->nLoadFileStream( pbBuff, cb );
+ *pcb = ((CLStreamRTFInfo *)dwCookie)->nLoadFileStream(pbBuff, cb);
if (*pcb )
return NOERROR;
return (DWORD)E_FAIL;
@@ -610,7 +610,7 @@ DWORD CALLBACK RichEditRTFStreamLoadFile(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
DWORD CALLBACK RichEditStreamSaveFile(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
- WriteFile((HANDLE)dwCookie, pbBuff, cb, (DWORD*)pcb, (LPOVERLAPPED)NULL);
+ WriteFile((HANDLE)dwCookie, pbBuff, cb, (DWORD*)pcb, (LPOVERLAPPED)NULL);
return *pcb != cb;
}
@@ -649,15 +649,15 @@ bool bLoadFile( HWND hwndDlg, CLHistoryDlg * pclDlg )
{
DWORD dwStart = GetTickCount();
- HWND hRichEdit = GetDlgItem( hwndDlg, IDC_RICHEDIT);
+ HWND hRichEdit = GetDlgItem(hwndDlg, IDC_RICHEDIT);
if (!hRichEdit) {
- MessageBox( hwndDlg, TranslateT("Failed to get handle to RichEdit!"), MSG_BOX_TITEL, MB_OK );
+ MessageBox(hwndDlg, TranslateT("Failed to get handle to RichEdit!"), MSG_BOX_TITEL, MB_OK);
return false;
}
HANDLE hFile = CreateFile( pclDlg->sPath.c_str(), GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
int nDBCount = db_event_count(pclDlg->hContact);
TCHAR szTmp[1500];
@@ -668,51 +668,35 @@ bool bLoadFile( HWND hwndDlg, CLHistoryDlg * pclDlg )
mir_sntprintf(szTmp, 1499, TranslateT("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events"), pclDlg->sPath.c_str(), nDBCount);
SETTEXTEX stText = {0};
- stText.codepage = CP_ACP;
- SendMessage( hRichEdit, EM_SETTEXTEX, (WPARAM) &stText, (LPARAM) szTmp );
+ stText.codepage = 1200;
+ SendMessage(hRichEdit, EM_SETTEXTEX, (WPARAM) &stText, (LPARAM)szTmp);
return false;
}
POINT ptOldPos;
- SendMessage( hRichEdit, EM_GETSCROLLPOS, 0, (LPARAM) &ptOldPos );
+ SendMessage( hRichEdit, EM_GETSCROLLPOS, 0, (LPARAM)&ptOldPos);
bool bScrollToBottom = true;
if (pclDlg->bFirstLoad )
pclDlg->bFirstLoad = false;
else {
SCROLLINFO sScrollInfo = { 0 };
- sScrollInfo.cbSize = sizeof( SCROLLINFO );
+ sScrollInfo.cbSize = sizeof( SCROLLINFO);
sScrollInfo.fMask = SIF_POS | SIF_RANGE | SIF_PAGE;
if (GetScrollInfo( hRichEdit,SB_VERT,&sScrollInfo))
bScrollToBottom = sScrollInfo.nPos + (int)sScrollInfo.nPage + 50 > sScrollInfo.nMax;
}
- HMENU hSysMenu = GetSystemMenu( hwndDlg, FALSE );
+ HMENU hSysMenu = GetSystemMenu(hwndDlg, FALSE);
bool bUseSyntaxHL = (GetMenuState( hSysMenu , ID_FV_SYNTAX_HL, MF_BYCOMMAND) & MF_CHECKED)!=0;
-/*
- DWORD dwSize = GetFileSize( hFile, NULL );
- dwCurPos = 0;
- pabFileData = new BYTE[ dwSize ];
- ReadFile( hFile, pabFileData, dwSize , &dwDataRead, (LPOVERLAPPED)NULL);
-*/
-
-
- // SendMessage( hRichEdit, EM_SETBKGNDCOLOR, 0, RGB( 0, 0, 128));
- // SendMessage( hRichEdit, EM_SETTEXTMODE, TM_RICHTEXT,0);
-
- // DWORD dw = SendMessage( hRichEdit, EM_GETLIMITTEXT, NULL, NULL);
-
EDITSTREAM eds;
eds.dwError = 0;
- if (bUseSyntaxHL ) {
- SendMessage( hRichEdit, // handle to destination window
- EM_EXLIMITTEXT, // message to send
- 0, // not used; must be zero
- 0x7FFFFFFF );
+ if (bUseSyntaxHL) {
+ SendMessage(hRichEdit, EM_EXLIMITTEXT, 0, 0x7FFFFFFF);
- CLStreamRTFInfo clInfo( hFile );
+ CLStreamRTFInfo clInfo( hFile);
eds.dwCookie = (DWORD)&clInfo;
eds.pfnCallback = RichEditRTFStreamLoadFile;
@@ -720,32 +704,29 @@ bool bLoadFile( HWND hwndDlg, CLHistoryDlg * pclDlg )
pclDlg->bUtf8File = clInfo.bUtf8File;
}
else {
- eds.dwCookie = (DWORD )hFile;
+ eds.dwCookie = (DWORD)hFile;
eds.pfnCallback = RichEditStreamLoadFile;
SendMessage(hRichEdit, EM_STREAMIN, (WPARAM)SF_TEXT, (LPARAM)&eds);
}
-
- CloseHandle( hFile );
- //delete [] pabFileData;
+ CloseHandle(hFile);
TCHAR szTmp[100];
mir_sntprintf(szTmp, 99, _T("File open time %d\n"), GetTickCount() - dwStart);
- OutputDebugString( szTmp );
+ OutputDebugString(szTmp);
GETTEXTLENGTHEX sData = { 0 };
sData.flags = GTL_NUMCHARS;
sData.flags = GTL_DEFAULT;
- DWORD dwDataRead = (DWORD)SendMessage( hRichEdit, EM_GETTEXTLENGTHEX, (WPARAM)&sData, 0 );
- SendMessage( hRichEdit, EM_SETSEL, dwDataRead - 1, dwDataRead - 1 );
+ DWORD dwDataRead = (DWORD)SendMessage( hRichEdit, EM_GETTEXTLENGTHEX, (WPARAM)&sData, 0);
+ SendMessage(hRichEdit, EM_SETSEL, dwDataRead - 1, dwDataRead - 1);
if ( !bScrollToBottom )
- SendMessage( hRichEdit, EM_SETSCROLLPOS, 0, (LPARAM) &ptOldPos );
+ SendMessage(hRichEdit, EM_SETSCROLLPOS, 0, (LPARAM)&ptOldPos);
mir_sntprintf(szTmp, 99, TranslateT("With scroll to bottom %d\n"), GetTickCount() - dwStart);
- OutputDebugString( szTmp );
-
+ OutputDebugString(szTmp);
return true;
}
@@ -765,7 +746,7 @@ bool bLoadFile( HWND hwndDlg, CLHistoryDlg * pclDlg )
bool bAdvancedCopy(HWND hwnd)
{
CHARRANGE sSelectRange;
- SendMessage( hwnd, EM_EXGETSEL, 0, (LPARAM)&sSelectRange );
+ SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sSelectRange);
int nSelLenght = sSelectRange.cpMax - sSelectRange.cpMin + 1; // +1 for null termination
if (nSelLenght > 1 )
{
@@ -774,25 +755,22 @@ bool bAdvancedCopy(HWND hwnd)
TCHAR *pszSrcBuf = new TCHAR[ nSelLenght];
pszSrcBuf[0] = 0;
- SendMessage( hwnd, EM_GETSELTEXT, 0, (LPARAM)pszSrcBuf );
+ SendMessage(hwnd, EM_GETSELTEXT, 0, (LPARAM)pszSrcBuf);
- HANDLE hDecMem = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE, nSelLenght );
+ HANDLE hDecMem = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE, nSelLenght);
TCHAR *pszCurDec = (TCHAR*)GlobalLock(hDecMem);
bool bInSpaces = false;
- for( TCHAR *pszCur = pszSrcBuf ; pszCur[0] ; pszCur++ )
- {
- if (bInSpaces )
- {
+ for (TCHAR *pszCur = pszSrcBuf ; pszCur[0] ; pszCur++) {
+ if (bInSpaces) {
if (pszCur[0] == ' ' )
continue;
bInSpaces = false;
}
if (pszCur[0] == '\n' )
- {
bInSpaces = true;
- }
+
pszCurDec[0] = pszCur[0];
pszCurDec++;
}
@@ -825,72 +803,57 @@ bool bAdvancedCopy(HWND hwnd)
LRESULT CALLBACK EditSubclassProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- CLHistoryDlg * pclDlg = (CLHistoryDlg *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- switch( msg )
- {
- case WM_CONTEXTMENU:
+ CLHistoryDlg *pclDlg = (CLHistoryDlg*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ switch(msg) {
+ case WM_CONTEXTMENU:
{
- HMENU nMenu = LoadMenu( hInstance, MAKEINTRESOURCE( IDR_FV_EDIT));
- HMENU nSubMenu = GetSubMenu( nMenu, 0 );
- POINT pt;
- pt.x=(short)LOWORD(lParam);
- pt.y=(short)HIWORD(lParam);
+ HMENU nMenu = LoadMenu(hInstance, MAKEINTRESOURCE( IDR_FV_EDIT));
+ HMENU nSubMenu = GetSubMenu(nMenu, 0);
+ POINT pt = { (short)LOWORD(lParam), (short)HIWORD(lParam) };
- if(pt.x==-1 && pt.y==-1)
- {
+ if(pt.x == -1 && pt.y == -1) {
DWORD dwStart,dwEnd;
- SendMessage( hwnd, EM_GETSEL, (WPARAM)&dwStart, (LPARAM)&dwEnd );
+ SendMessage( hwnd, EM_GETSEL, (WPARAM)&dwStart, (LPARAM)&dwEnd);
SendMessage( hwnd, EM_POSFROMCHAR, (WPARAM)&pt, (LPARAM)dwEnd);
- ClientToScreen( hwnd, &pt );
+ ClientToScreen(hwnd, &pt);
}
- TrackPopupMenu( nSubMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, 0 );
+ TrackPopupMenu( nSubMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, 0);
- DestroyMenu( nSubMenu );
- DestroyMenu( nMenu );
+ DestroyMenu( nSubMenu);
+ DestroyMenu( nMenu);
return TRUE;
}
- case WM_GETDLGCODE:
- {
- return DLGC_WANTARROWS;
- }
- case WM_COPY:
- { // not working for "CTRL + C"
- if (bAdvancedCopy( hwnd))
+ case WM_GETDLGCODE:
+ return DLGC_WANTARROWS;
+
+ case WM_COPY:
+ // not working for "CTRL + C"
+ if (bAdvancedCopy(hwnd))
+ return TRUE;
+ break;
+
+ case WM_KEYDOWN:
+ if ((wParam == VK_INSERT || wParam == 'C') && (GetKeyState(VK_CONTROL) & 0x80))
+ if (bAdvancedCopy(hwnd))
return TRUE;
- break;
- }
- case WM_KEYDOWN:
- {
- if ((wParam == VK_INSERT || wParam == 'C') && (GetKeyState(VK_CONTROL) & 0x80))
- {
- if (bAdvancedCopy( hwnd))
- return TRUE;
- }
- break;
- }
- case WM_COMMAND:
- {
- switch (LOWORD(wParam))
- {
- case ID_EDIT_COPY:
- {
- SendMessage( hwnd, WM_COPY, 0, 0 );
- return TRUE;
- }
- }
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case ID_EDIT_COPY:
+ SendMessage(hwnd, WM_COPY, 0, 0);
+ return TRUE;
}
}
- if (msg == UM_FIND_CMD )
- {
- FINDREPLACE *fr = (FINDREPLACE *)lParam;
- if (fr->Flags & FR_DIALOGTERM )
- {
+
+ if (msg == UM_FIND_CMD) {
+ FINDREPLACE *fr = (FINDREPLACE*)lParam;
+ if (fr->Flags & FR_DIALOGTERM ) {
pclDlg->hFindDlg = NULL;
return 0;
}
- if (fr->Flags & FR_FINDNEXT)
- {
+ if (fr->Flags & FR_FINDNEXT) {
FINDTEXT ft = { 0 };
ft.lpstrText = fr->lpstrFindWhat;
@@ -901,9 +864,8 @@ LRESULT CALLBACK EditSubclassProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
if(res == -1) {
ft.chrg.cpMin = 0;
res = (int)SendMessage(hwnd, EM_FINDTEXTW, (WPARAM)fr->Flags,(LPARAM)&ft);
- if(res == -1)
- {
- MessageBox( hwnd, TranslateT("Search string was not found !"), MSG_BOX_TITEL, MB_OK );
+ if(res == -1) {
+ MessageBox(hwnd, TranslateT("Search string was not found !"), MSG_BOX_TITEL, MB_OK);
return 0;
}
}
@@ -932,41 +894,37 @@ LRESULT CALLBACK EditSubclassProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
void SetWindowsCtrls( HWND hwndDlg )
{
RECT rNewSize;
- GetClientRect( hwndDlg, &rNewSize );
-
- RECT rCurSize;
+ GetClientRect(hwndDlg, &rNewSize);
const int nSpacing = 12;
+ HWND hButton = GetDlgItem(hwndDlg, IDOK);
-
- HWND hButton = GetDlgItem( hwndDlg, IDOK );
- GetWindowRect( hButton, &rCurSize );
+ RECT rCurSize;
+ GetWindowRect(hButton, &rCurSize);
int nButtonHeight = rCurSize.bottom - rCurSize.top;
- SetWindowPos( GetDlgItem( hwndDlg, IDC_RICHEDIT ), 0,
+ SetWindowPos(GetDlgItem(hwndDlg, IDC_RICHEDIT ), 0,
nSpacing, nSpacing,
rNewSize.right - (nSpacing * 2),
rNewSize.bottom - ( nSpacing * 3 + nButtonHeight ),
- SWP_NOZORDER );
-
+ SWP_NOZORDER);
int nButtonWidth = rCurSize.right - rCurSize.left;
int nButtonSpace = (rNewSize.right - ( 3 * nButtonWidth )) / 4;
- int nButtonTop = rNewSize.bottom - ( nSpacing + nButtonHeight );
+ int nButtonTop = rNewSize.bottom - ( nSpacing + nButtonHeight);
int nCurLeft = nButtonSpace;
- SetWindowPos( GetDlgItem( hwndDlg, IDC_FV_FIND ), 0,
- nCurLeft, nButtonTop, 0, 0, SWP_NOZORDER | SWP_NOSIZE );
+ SetWindowPos(GetDlgItem(hwndDlg, IDC_FV_FIND ), 0,
+ nCurLeft, nButtonTop, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
nCurLeft += nButtonSpace + nButtonWidth;
- SetWindowPos( GetDlgItem( hwndDlg, IDC_FV_EXTERNAL ), 0,
- nCurLeft, nButtonTop, 0, 0, SWP_NOZORDER | SWP_NOSIZE );
+ SetWindowPos(GetDlgItem(hwndDlg, IDC_FV_EXTERNAL ), 0,
+ nCurLeft, nButtonTop, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
nCurLeft += nButtonSpace + nButtonWidth;
- SetWindowPos( hButton, 0,
- nCurLeft, nButtonTop, 0, 0, SWP_NOZORDER | SWP_NOSIZE );
+ SetWindowPos(hButton, 0, nCurLeft, nButtonTop, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
}
@@ -988,16 +946,15 @@ void SetWindowsCtrls( HWND hwndDlg )
void SetRichEditFont(HWND hRichEdit, bool bUseSyntaxHL )
{
CHARFORMAT ncf = { 0 };
- ncf.cbSize = sizeof( CHARFORMAT );
+ ncf.cbSize = sizeof(CHARFORMAT);
ncf.dwMask = CFM_BOLD | CFM_FACE | CFM_ITALIC | CFM_SIZE | CFM_UNDERLINE;
- ncf.dwEffects = db_get_dw( NULL, MODULE, szFileViewDB "TEffects", 0 );
- ncf.yHeight = db_get_dw( NULL, MODULE, szFileViewDB "THeight", 165 );
- _tcscpy( ncf.szFaceName , _DBGetString( NULL, MODULE, szFileViewDB "TFace", _T("Courier New")).c_str());
+ ncf.dwEffects = db_get_dw(NULL, MODULE, szFileViewDB "TEffects", 0);
+ ncf.yHeight = db_get_dw(NULL, MODULE, szFileViewDB "THeight", 165);
+ _tcscpy(ncf.szFaceName , _DBGetString(NULL, MODULE, szFileViewDB "TFace", _T("Courier New")).c_str());
- if ( !bUseSyntaxHL )
- {
+ if (!bUseSyntaxHL) {
ncf.dwMask |= CFM_COLOR;
- ncf.crTextColor = db_get_dw( NULL, MODULE, szFileViewDB "TColor", 0 );
+ ncf.crTextColor = db_get_dw(NULL, MODULE, szFileViewDB "TColor", 0);
}
SendMessage(hRichEdit, EM_SETCHARFORMAT, (WPARAM)SCF_ALL, (LPARAM)&ncf);
@@ -1025,86 +982,75 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
switch (msg) {
case WM_INITDIALOG:
- {
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,lParam);
- CLHistoryDlg * pclDlg = (CLHistoryDlg *)lParam;
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG,
- (LPARAM)LoadIcon( hInstance, MAKEINTRESOURCE(IDI_EXPORT_MESSAGE)));
-
- HWND hRichEdit = GetDlgItem( hwndDlg, IDC_RICHEDIT );
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+ pclDlg = (CLHistoryDlg *)lParam;
+
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(hInstance, MAKEINTRESOURCE(IDI_EXPORT_MESSAGE)));
+ {
+ HWND hRichEdit = GetDlgItem(hwndDlg, IDC_RICHEDIT);
mir_subclassWindow(hRichEdit, EditSubclassProc);
+ SetWindowLongPtr(hRichEdit, GWLP_USERDATA, (WPARAM)pclDlg);
+ SendMessage(hRichEdit, EM_SETEVENTMASK, 0, ENM_LINK);
+ SendMessage(hRichEdit, EM_AUTOURLDETECT, TRUE, 0);
- SetWindowLongPtr( hRichEdit, GWLP_USERDATA, (LONG) pclDlg );
-
- SendMessage( hRichEdit, EM_SETEVENTMASK , 0 , ENM_LINK);
- SendMessage( hRichEdit, EM_AUTOURLDETECT, TRUE, 0 );
-
- HMENU hSysMenu = GetSystemMenu( hwndDlg, FALSE );
+ HMENU hSysMenu = GetSystemMenu(hwndDlg, FALSE);
+ InsertMenu(hSysMenu, 0, MF_SEPARATOR | MF_BYPOSITION, 0, 0);
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_SAVE_AS_RTF, LPGENT("Save as RTF"));
+ InsertMenu(hSysMenu, 0, MF_SEPARATOR | MF_BYPOSITION, 0, 0);
- InsertMenu( hSysMenu, 0, MF_SEPARATOR | MF_BYPOSITION, 0, 0 );
- InsertMenu( hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_SAVE_AS_RTF, LPGENT("Save as RTF"));
+ BYTE bUseCC = (BYTE)db_get_b(NULL, MODULE, szFileViewDB "UseCC", 0);
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | ( bUseCC ? MF_CHECKED : 0 ), ID_FV_COLOR, LPGENT("Color..."));
- InsertMenu( hSysMenu, 0, MF_SEPARATOR | MF_BYPOSITION, 0, 0 );
+ if (bUseCC)
+ SendMessage( hRichEdit, EM_SETBKGNDCOLOR, 0, db_get_dw(NULL, MODULE, szFileViewDB "CustomC", RGB(255,255,255)));
- BYTE bUseCC = (BYTE)db_get_b( NULL, MODULE, szFileViewDB "UseCC", 0 );
- InsertMenu( hSysMenu, 0, MF_STRING | MF_BYPOSITION | ( bUseCC ? MF_CHECKED : 0 ), ID_FV_COLOR, LPGENT("Color..."));
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_FONT, LPGENT("Font..."));
- if (bUseCC )
- SendMessage( hRichEdit, EM_SETBKGNDCOLOR, 0,
- db_get_dw( NULL, MODULE, szFileViewDB "CustomC", RGB(255,255,255)));
+ bool bUseSyntaxHL = db_get_b(NULL, MODULE, szFileViewDB "UseSyntaxHL", 1) != 0;
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | ( bUseSyntaxHL ? MF_CHECKED : 0 ), ID_FV_SYNTAX_HL, LPGENT("Syntax highlight"));
- InsertMenu( hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_FONT, LPGENT("Font..."));
-
- bool bUseSyntaxHL = db_get_b( NULL, MODULE, szFileViewDB "UseSyntaxHL", 1 )!=0;
- InsertMenu( hSysMenu, 0, MF_STRING | MF_BYPOSITION | ( bUseSyntaxHL ? MF_CHECKED : 0 ), ID_FV_SYNTAX_HL, LPGENT("Syntax highlight"));
-
- SetRichEditFont( hRichEdit, bUseSyntaxHL );
+ SetRichEditFont(hRichEdit, bUseSyntaxHL);
TranslateDialogDefault(hwndDlg);
Utils_RestoreWindowPosition(hwndDlg,pclDlg->hContact,MODULE,szFileViewDB);
- pclDlg->sPath = GetFilePathFromUser( pclDlg->hContact );
+ pclDlg->sPath = GetFilePathFromUser( pclDlg->hContact);
- SetWindowsCtrls( hwndDlg );
+ SetWindowsCtrls(hwndDlg);
+ bLoadFile(hwndDlg, pclDlg);
- bLoadFile(hwndDlg, pclDlg );
+ TCHAR szFormat[200];
+ TCHAR szTitle[200];
+ if (GetWindowText(hwndDlg, szFormat, sizeof( szFormat))) {
+ const TCHAR *pszNick = NickFromHandle( pclDlg->hContact);
+ tstring sPath = pclDlg->sPath;
+ string::size_type n = sPath.find_last_of( '\\');
+ if (n != sPath.npos )
+ sPath.erase( 0, n + 1);
- { // set Title
- TCHAR szFormat[200];
- TCHAR szTitle[200];
- if (GetWindowText( hwndDlg, szFormat, sizeof( szFormat)) )
- {
- const TCHAR *pszNick = NickFromHandle( pclDlg->hContact );
- tstring sPath = pclDlg->sPath;
- string::size_type n = sPath.find_last_of( '\\' );
- if (n != sPath.npos )
- sPath.erase( 0, n + 1 );
-
- if (mir_sntprintf(szTitle, SIZEOF(szTitle), szFormat, pszNick, sPath.c_str(), (pclDlg->bUtf8File ? _T("UTF8"):_T("ANSI"))) > 0)
- SetWindowText( hwndDlg, szTitle);
- }
+ if (mir_sntprintf(szTitle, SIZEOF(szTitle), szFormat, pszNick, sPath.c_str(), (pclDlg->bUtf8File ? _T("UTF8"):_T("ANSI"))) > 0)
+ SetWindowText(hwndDlg, szTitle);
}
-
WindowList_Add(hInternalWindowList,hwndDlg,pclDlg->hContact);
}
return TRUE;
case WM_RELOAD_FILE:
- bLoadFile(hwndDlg, pclDlg );
+ bLoadFile(hwndDlg, pclDlg);
return TRUE;
case WM_SIZE:
case WM_SIZING:
- SetWindowsCtrls( hwndDlg );
+ SetWindowsCtrls(hwndDlg);
return TRUE;
case WM_NCDESTROY:
- EnterCriticalSection( &csHistoryList );
- clHistoryDlgList.remove( pclDlg );
- LeaveCriticalSection( &csHistoryList );
+ EnterCriticalSection(&csHistoryList);
+ clHistoryDlgList.remove( pclDlg);
+ LeaveCriticalSection(&csHistoryList);
delete pclDlg;
SetWindowLongPtr(hwndDlg,GWLP_USERDATA,NULL);
@@ -1117,77 +1063,68 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_SYSCOMMAND:
{
- HMENU hSysMenu = GetSystemMenu( hwndDlg, FALSE );
+ HMENU hSysMenu = GetSystemMenu(hwndDlg, FALSE);
bool bUseSyntaxHL = (GetMenuState( hSysMenu , ID_FV_SYNTAX_HL, MF_BYCOMMAND) & MF_CHECKED)!=0;
- HWND hRichEdit = GetDlgItem( hwndDlg, IDC_RICHEDIT );
+ HWND hRichEdit = GetDlgItem(hwndDlg, IDC_RICHEDIT);
- if ((wParam & 0xFFF0) == ID_FV_FONT)
- {
+ if ((wParam & 0xFFF0) == ID_FV_FONT) {
LOGFONT lf = { 0 };
lf.lfHeight = 14L;
- { DWORD dwEffects = db_get_dw( NULL, MODULE, szFileViewDB "TEffects", 0 );
+ DWORD dwEffects = db_get_dw(NULL, MODULE, szFileViewDB "TEffects", 0);
lf.lfWeight = (dwEffects & CFE_BOLD) ? FW_BOLD : 0;
lf.lfUnderline = (dwEffects & CFE_UNDERLINE) != 0;
lf.lfStrikeOut = (dwEffects & CFE_STRIKEOUT) != 0;
lf.lfItalic = (dwEffects & CFE_ITALIC) != 0;
- }
- _tcscpy(lf.lfFaceName, _DBGetString( NULL, MODULE, szFileViewDB "TFace", _T("Courier New")).c_str());
+
+ _tcscpy(lf.lfFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", _T("Courier New")).c_str());
CHOOSEFONT cf = { 0 };
- cf.lStructSize = sizeof( cf );
+ cf.lStructSize = sizeof( cf);
cf.hwndOwner = hwndDlg;
cf.lpLogFont = &lf;
- cf.rgbColors = db_get_dw( NULL, MODULE, szFileViewDB "TColor", 0 );
+ cf.rgbColors = db_get_dw(NULL, MODULE, szFileViewDB "TColor", 0);
cf.Flags = CF_EFFECTS | CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT;
- if (ChooseFont( &cf))
- {
+ if ( ChooseFont(&cf)) {
DWORD dwEffects = (lf.lfWeight == FW_BOLD ? CFE_BOLD : 0) |
(lf.lfItalic ? CFE_ITALIC : 0) |
(lf.lfStrikeOut ? CFE_STRIKEOUT : 0) |
(lf.lfUnderline ? CFE_UNDERLINE : 0);
- db_set_dw( NULL, MODULE, szFileViewDB "TEffects", dwEffects );
- db_set_dw( NULL, MODULE, szFileViewDB "THeight", cf.iPointSize * 2 );
- db_set_dw( NULL, MODULE, szFileViewDB "TColor", cf.rgbColors );
- db_set_ts( NULL, MODULE, szFileViewDB "TFace", lf.lfFaceName );
- SetRichEditFont( hRichEdit, bUseSyntaxHL );
+ db_set_dw(NULL, MODULE, szFileViewDB "TEffects", dwEffects);
+ db_set_dw(NULL, MODULE, szFileViewDB "THeight", cf.iPointSize * 2);
+ db_set_dw(NULL, MODULE, szFileViewDB "TColor", cf.rgbColors);
+ db_set_ts(NULL, MODULE, szFileViewDB "TFace", lf.lfFaceName);
+ SetRichEditFont( hRichEdit, bUseSyntaxHL);
}
return TRUE;
}
- else if ((wParam & 0xFFF0) == ID_FV_COLOR)
- {
- BYTE bUseCC = ! db_get_b( NULL, MODULE, szFileViewDB "UseCC", 0 );
- if (bUseCC )
- {
+ if ((wParam & 0xFFF0) == ID_FV_COLOR) {
+ BYTE bUseCC = ! db_get_b(NULL, MODULE, szFileViewDB "UseCC", 0);
+ if (bUseCC) {
CHOOSECOLOR cc = {0};
- cc.lStructSize = sizeof( cc );
+ cc.lStructSize = sizeof( cc);
cc.hwndOwner = hwndDlg;
- cc.rgbResult = db_get_dw( NULL, MODULE, szFileViewDB "CustomC", RGB(255,255,255));
+ cc.rgbResult = db_get_dw(NULL, MODULE, szFileViewDB "CustomC", RGB(255,255,255));
cc.Flags = CC_ANYCOLOR | CC_FULLOPEN | CC_RGBINIT;
static COLORREF MyCustColors[16] = { 0xFFFFFFFF };
cc.lpCustColors = MyCustColors;
- if (ChooseColor( &cc))
- {
- SendMessage( hRichEdit, EM_SETBKGNDCOLOR, 0, cc.rgbResult );
- db_set_dw( NULL, MODULE, szFileViewDB "CustomC", cc.rgbResult );
+ if ( ChooseColor(&cc)) {
+ SendMessage( hRichEdit, EM_SETBKGNDCOLOR, 0, cc.rgbResult);
+ db_set_dw(NULL, MODULE, szFileViewDB "CustomC", cc.rgbResult);
}
- else
- {
- /*DWORD dwError =*/ CommDlgExtendedError();
+ else {
+ CommDlgExtendedError();
return TRUE;
}
}
- else
- {
- SendMessage( hRichEdit, EM_SETBKGNDCOLOR, TRUE, 0 );
- }
+ else SendMessage( hRichEdit, EM_SETBKGNDCOLOR, TRUE, 0);
+
CheckMenuItem( hSysMenu, ID_FV_COLOR, MF_BYCOMMAND | (bUseCC ? MF_CHECKED : 0));
- db_set_b( NULL, MODULE, szFileViewDB "UseCC", bUseCC );
+ db_set_b(NULL, MODULE, szFileViewDB "UseCC", bUseCC);
return TRUE;
}
- else if ((wParam & 0xFFF0) == ID_FV_SYNTAX_HL)
- {
+ if ((wParam & 0xFFF0) == ID_FV_SYNTAX_HL) {
// we use the current state from the menu not the DB value
// because we want to toggel the option for this window
// still the new option selected will be stored.
@@ -1195,24 +1132,22 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
bUseSyntaxHL = !bUseSyntaxHL;
CheckMenuItem( hSysMenu, ID_FV_SYNTAX_HL, MF_BYCOMMAND | (bUseSyntaxHL ? MF_CHECKED : 0));
- db_set_b( NULL, MODULE, szFileViewDB "UseSyntaxHL", bUseSyntaxHL );
+ db_set_b(NULL, MODULE, szFileViewDB "UseSyntaxHL", bUseSyntaxHL);
if (bUseSyntaxHL )
- bLoadFile(hwndDlg, pclDlg );
+ bLoadFile(hwndDlg, pclDlg);
else
- SetRichEditFont( hRichEdit, bUseSyntaxHL );
+ SetRichEditFont( hRichEdit, bUseSyntaxHL);
return TRUE;
}
- else if ((wParam & 0xFFF0) == ID_FV_SAVE_AS_RTF)
- {
+ if ((wParam & 0xFFF0) == ID_FV_SAVE_AS_RTF) {
tstring sFile = pclDlg->sPath;
sFile += _T(".rtf");
HANDLE hFile = CreateFile( sFile.c_str(), GENERIC_WRITE,
- FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
+ FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- if (hFile == INVALID_HANDLE_VALUE )
- {
+ if (hFile == INVALID_HANDLE_VALUE) {
DisplayLastError( LPGENT("Failed to create file"));
return TRUE;
}
@@ -1222,16 +1157,15 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
eds.dwError = 0;
eds.pfnCallback = RichEditStreamSaveFile;
LRESULT nWriteOk = SendMessage(hRichEdit, EM_STREAMOUT, (WPARAM)SF_RTF, (LPARAM)&eds);
- if (nWriteOk <= 0 || eds.dwError != 0 )
- {
+ if (nWriteOk <= 0 || eds.dwError != 0) {
DisplayLastError( TranslateT("Failed to save file"));
- CloseHandle( hFile );
+ CloseHandle( hFile);
return TRUE;
}
- CloseHandle( hFile );
+ CloseHandle( hFile);
tstring sReport = TranslateT("History was saved successfully in file\r\n");
sReport += sFile;
- MessageBox( NULL, sReport.c_str(),MSG_BOX_TITEL,MB_OK );
+ MessageBox(NULL, sReport.c_str(),MSG_BOX_TITEL,MB_OK);
return TRUE;
}
return FALSE;
@@ -1244,30 +1178,24 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
DestroyWindow(hwndDlg);
return TRUE;
case IDC_FV_EXTERNAL:
- bOpenExternaly( pclDlg->hContact );
+ bOpenExternaly( pclDlg->hContact);
return TRUE;
case IDC_FV_FIND:
- {
- if (pclDlg->hFindDlg )
- {
- BringWindowToTop( pclDlg->hFindDlg );
- return TRUE;
- }
- pclDlg->fr.hwndOwner = GetDlgItem( hwndDlg, IDC_RICHEDIT );
- pclDlg->hFindDlg = FindText( &pclDlg->fr );
+ if (pclDlg->hFindDlg ) {
+ BringWindowToTop( pclDlg->hFindDlg);
return TRUE;
}
+ pclDlg->fr.hwndOwner = GetDlgItem(hwndDlg, IDC_RICHEDIT);
+ pclDlg->hFindDlg = FindText(&pclDlg->fr);
+ return TRUE;
}
break;
case WM_NOTIFY:
- if (((NMHDR*)lParam)->idFrom == IDC_RICHEDIT )
- {
- if (((NMHDR*)lParam)->code == EN_LINK )
- {
+ if (((NMHDR*)lParam)->idFrom == IDC_RICHEDIT) {
+ if (((NMHDR*)lParam)->code == EN_LINK) {
ENLINK* pstLink = (ENLINK*)lParam;
- if (pstLink->msg == WM_LBUTTONUP )
- {
+ if (pstLink->msg == WM_LBUTTONUP) {
TCHAR szUrl[ 500 ];
if ((pstLink->chrg.cpMax - pstLink->chrg.cpMin) > (sizeof( szUrl) - 2))
return FALSE;
@@ -1276,9 +1204,8 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
stToGet.chrg = pstLink->chrg;
stToGet.lpstrText = szUrl;
if (SendMessage( pstLink->nmhdr.hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&stToGet) > 0 )
- {
CallService(MS_UTILS_OPENURL,1,(LPARAM)szUrl);
- }
+
return TRUE;
}
}
@@ -1305,25 +1232,23 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
// Developer : KN
/////////////////////////////////////////////////////////////////////
-bool bShowFileViewer( HANDLE hContact )
+bool bShowFileViewer(HANDLE hContact)
{
HWND hInternalWindow = WindowList_Find(hInternalWindowList,hContact);
- if(hInternalWindow)
- {
+ if(hInternalWindow) {
SetForegroundWindow(hInternalWindow);
SetFocus(hInternalWindow);
return true;
}
- CLHistoryDlg * pcl = new CLHistoryDlg( hContact );
- pcl->hWnd = CreateDialogParam( hInstance,MAKEINTRESOURCE(IDD_FILE_VIEWER),NULL,DlgProcFileViewer,(LPARAM)pcl);
- if (pcl->hWnd )
- {
- EnterCriticalSection( &csHistoryList );
- clHistoryDlgList.push_front( pcl );
- LeaveCriticalSection( &csHistoryList );
+ CLHistoryDlg *pcl = new CLHistoryDlg( hContact);
+ pcl->hWnd = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_FILE_VIEWER), NULL, DlgProcFileViewer, (LPARAM)pcl);
+ if (pcl->hWnd) {
+ EnterCriticalSection(&csHistoryList);
+ clHistoryDlgList.push_front(pcl);
+ LeaveCriticalSection(&csHistoryList);
- ShowWindow( pcl->hWnd, SW_SHOWNORMAL );
+ ShowWindow(pcl->hWnd, SW_SHOWNORMAL);
return true;
}
DisplayLastError( LPGENT("Failed to create history dialog"));
diff --git a/plugins/Msg_Export/src/FileViewer.h b/plugins/Msg_Export/src/FileViewer.h
index d857f060ba..d76509e4de 100755
--- a/plugins/Msg_Export/src/FileViewer.h
+++ b/plugins/Msg_Export/src/FileViewer.h
@@ -22,12 +22,12 @@
void Initialize();
void Uninitilize();
-void UpdateFileViews( const TCHAR *pszFile );
+void UpdateFileViews( const TCHAR *pszFile);
-bool bOpenExternaly( HANDLE hContact );
-bool bShowFileViewer( HANDLE hContact );
+bool bOpenExternaly( HANDLE hContact);
+bool bShowFileViewer( HANDLE hContact);
-bool bUseInternalViewer( bool bNew );
+bool bUseInternalViewer( bool bNew);
bool bUseInternalViewer();
extern tstring sFileViewerPrg;
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp
index 8b2dea52b3..9b76303565 100755
--- a/plugins/Msg_Export/src/options.cpp
+++ b/plugins/Msg_Export/src/options.cpp
@@ -100,7 +100,7 @@ int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
return _DBGetString( (HANDLE)lParam1, "Protocol", "p", _T("")).compare(
_DBGetString( (HANDLE)lParam2, "Protocol", "p", _T(""))
- );
+ );
}
if (lParamSort == 3 )
{
@@ -175,13 +175,13 @@ INT_PTR CALLBACK __stdcall DialogProc(
int nExportCompleatList(HWND hParent, bool bOnlySelected )
{
- HWND hMapUser = GetDlgItem( hParent, IDC_MAP_USER_LIST );
+ HWND hMapUser = GetDlgItem( hParent, IDC_MAP_USER_LIST);
- int nTotalContacts = ListView_GetItemCount( hMapUser );
+ int nTotalContacts = ListView_GetItemCount( hMapUser);
int nContacts;
if (bOnlySelected )
- nContacts = ListView_GetSelectedCount( hMapUser );
+ nContacts = ListView_GetSelectedCount( hMapUser);
else
nContacts = nTotalContacts;
@@ -192,8 +192,8 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected )
}
HWND hDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EXPORT_ALL_DLG), hParent, DialogProc);
- HWND hProg = GetDlgItem(hDlg, IDC_EXPORT_PROGRESS );
- HWND hStatus = GetDlgItem(hDlg, IDC_EXP_ALL_STATUS );
+ HWND hProg = GetDlgItem(hDlg, IDC_EXPORT_PROGRESS);
+ HWND hStatus = GetDlgItem(hDlg, IDC_EXP_ALL_STATUS);
SendMessage(hProg, PBM_SETRANGE, 0, MAKELPARAM(0, nContacts));
@@ -205,12 +205,12 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected )
RECT rDlg;
if (GetWindowRect( hParent, &rParrent) && GetWindowRect( hDlg, &rDlg))
{
- int x = ( (rParrent.right + rParrent.left) / 2) - ( (rDlg.right - rDlg.left) / 2 );
- int y = ( (rParrent.bottom + rParrent.top) / 2) - ( (rDlg.bottom - rDlg.top) / 2 );
- SetWindowPos( hDlg, 0, x, y, 0,0, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW );
+ int x = ( (rParrent.right + rParrent.left) / 2) - ( (rDlg.right - rDlg.left) / 2);
+ int y = ( (rParrent.bottom + rParrent.top) / 2) - ( (rDlg.bottom - rDlg.top) / 2);
+ SetWindowPos( hDlg, 0, x, y, 0,0, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
}
else
- ShowWindow( hDlg, SW_SHOWNORMAL );
+ ShowWindow( hDlg, SW_SHOWNORMAL);
}
// map with list to stored all DB history before it is exported
@@ -220,7 +220,7 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected )
LVITEM sItem = { 0 };
sItem.mask = LVIF_PARAM;
- for( int nCur = 0 ; nCur < nTotalContacts ; nCur++ )
+ for (int nCur = 0 ; nCur < nTotalContacts ; nCur++ )
{
if (bOnlySelected )
{
@@ -246,12 +246,12 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected )
}
SendMessage( hProg, PBM_SETPOS, nCur, 0);
- RedrawWindow( hDlg, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW );
+ RedrawWindow( hDlg, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);
}
/*
if (hContact )
- MessageBox( hParent, LPGENT("Failed to export at least one contact"),MSG_BOX_TITEL,MB_OK );
+ MessageBox( hParent, LPGENT("Failed to export at least one contact"),MSG_BOX_TITEL,MB_OK);
*/
}
@@ -267,24 +267,24 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected )
map<tstring, list< CLDBEvent >, less<tstring> >::iterator FileIterator;
int nCur=0;
- for( FileIterator = AllEvents.begin() ; FileIterator != AllEvents.end() ; ++FileIterator )
+ for (FileIterator = AllEvents.begin() ; FileIterator != AllEvents.end() ; ++FileIterator )
{
(FileIterator->second).sort(); // Sort is preformed here !!
// events with same time will not be swaped, they will
// remain in there original order
list< CLDBEvent >::const_iterator iterator;
- for( iterator = FileIterator->second.begin() ; iterator != FileIterator->second.end() ; ++iterator )
+ for (iterator = FileIterator->second.begin() ; iterator != FileIterator->second.end() ; ++iterator )
{
HANDLE hDbEvent = (*iterator).hDbEvent;
- nExportEvent( (WPARAM) (*iterator).hUser, (LPARAM) hDbEvent );
+ nExportEvent( (WPARAM) (*iterator).hUser, (LPARAM)hDbEvent);
}
SendMessage( hProg, PBM_SETPOS, ++nCur, 0);
- RedrawWindow( hDlg, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW );
+ RedrawWindow( hDlg, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);
}
}
- DestroyWindow( hDlg );
+ DestroyWindow( hDlg);
return 0;
}
@@ -303,9 +303,9 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected )
void SetToDefault( HWND hParent )
{
- HWND hMapUser = GetDlgItem( hParent, IDC_MAP_USER_LIST );
+ HWND hMapUser = GetDlgItem( hParent, IDC_MAP_USER_LIST);
- int nContacts = ListView_GetItemCount( hMapUser );
+ int nContacts = ListView_GetItemCount( hMapUser);
if (!hMapUser || nContacts <= 0 )
{
@@ -318,7 +318,7 @@ void SetToDefault( HWND hParent )
LVITEM sItem = { 0 };
- for( int nCur = 0 ; nCur < nContacts ; nCur++ )
+ for (int nCur = 0 ; nCur < nContacts ; nCur++ )
{
if ( !(ListView_GetItemState( hMapUser, nCur, LVIS_SELECTED) & LVIS_SELECTED))
continue;
@@ -329,12 +329,12 @@ void SetToDefault( HWND hParent )
continue;
tstring sFileName = szTemp;
- ReplaceDefines( (HANDLE)sItem.lParam, sFileName );
- ReplaceTimeVariables( sFileName );
+ ReplaceDefines( (HANDLE)sItem.lParam, sFileName);
+ ReplaceTimeVariables( sFileName);
sItem.mask = LVIF_TEXT;
sItem.pszText = (TCHAR*)sFileName.c_str();
- ListView_SetItem( hMapUser, &sItem );
+ ListView_SetItem( hMapUser, &sItem);
if ( !bUnaplyedChanges )
{
@@ -363,7 +363,7 @@ BOOL bApplyChanges( HWND hwndDlg )
BOOL bRet = true;
TCHAR szTemp[500];
- int nTmp = GetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, &bTrans, TRUE );
+ int nTmp = GetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, &bTrans, TRUE);
if ( !bTrans || nTmp < 5 )
{
mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Max line width must be at least %d"), 5);
@@ -375,53 +375,53 @@ BOOL bApplyChanges( HWND hwndDlg )
nMaxLineWidth = nTmp;
}
- GetDlgItemText( hwndDlg, IDC_EXPORT_TIMEFORMAT, szTemp, sizeof( szTemp));
+ GetDlgItemText(hwndDlg, IDC_EXPORT_TIMEFORMAT, szTemp, sizeof( szTemp));
sTimeFormat = szTemp;
- GetDlgItemText( hwndDlg, IDC_EXPORT_DIR, szTemp, sizeof( szTemp));
+ GetDlgItemText(hwndDlg, IDC_EXPORT_DIR, szTemp, sizeof( szTemp));
sExportDir = szTemp;
- GetDlgItemText( hwndDlg, IDC_DEFAULT_FILE, szTemp, sizeof( szTemp));
+ GetDlgItemText(hwndDlg, IDC_DEFAULT_FILE, szTemp, sizeof( szTemp));
sDefaultFile = szTemp;
- GetDlgItemText( hwndDlg, IDC_FILE_VIEWER, szTemp, sizeof( szTemp));
+ GetDlgItemText(hwndDlg, IDC_FILE_VIEWER, szTemp, sizeof( szTemp));
sFileViewerPrg = szTemp;
- bUseInternalViewer( IsDlgButtonChecked( hwndDlg, IDC_USE_INTERNAL_VIEWER ) == BST_CHECKED );
+ bUseInternalViewer( IsDlgButtonChecked(hwndDlg, IDC_USE_INTERNAL_VIEWER ) == BST_CHECKED);
- bool bNewRp = IsDlgButtonChecked( hwndDlg, IDC_REPLACE_MIRANDA_HISTORY) == BST_CHECKED;
+ bool bNewRp = IsDlgButtonChecked(hwndDlg, IDC_REPLACE_MIRANDA_HISTORY) == BST_CHECKED;
if (bReplaceHistory != bNewRp )
{
bReplaceHistory = bNewRp;
- MessageBox(hwndDlg, TranslateT("You need to restart miranda to change the history function"), MSG_BOX_TITEL, MB_OK );
+ MessageBox(hwndDlg, TranslateT("You need to restart miranda to change the history function"), MSG_BOX_TITEL, MB_OK);
}
- bAppendNewLine = IsDlgButtonChecked( hwndDlg, IDC_APPEND_NEWLINE) == BST_CHECKED;
- bUseUtf8InNewFiles = IsDlgButtonChecked( hwndDlg, IDC_USE_UTF8_IN_NEW_FILES) == BST_CHECKED;
+ bAppendNewLine = IsDlgButtonChecked(hwndDlg, IDC_APPEND_NEWLINE) == BST_CHECKED;
+ bUseUtf8InNewFiles = IsDlgButtonChecked(hwndDlg, IDC_USE_UTF8_IN_NEW_FILES) == BST_CHECKED;
- bUseLessAndGreaterInExport = IsDlgButtonChecked( hwndDlg, IDC_USE_LESS_AND_GREATER_IN_EXPORT) == BST_CHECKED;
+ bUseLessAndGreaterInExport = IsDlgButtonChecked(hwndDlg, IDC_USE_LESS_AND_GREATER_IN_EXPORT) == BST_CHECKED;
- HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST );
- int nCount = ListView_GetItemCount( hMapUser );
- for( int nCur = 0 ; nCur < nCount ; nCur++ )
+ HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST);
+ int nCount = ListView_GetItemCount( hMapUser);
+ for (int nCur = 0 ; nCur < nCount ; nCur++ )
{
LVITEM sItem = { 0 };
sItem.iItem = nCur;
sItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
sItem.pszText = szTemp;
- sItem.cchTextMax = sizeof( szTemp );
+ sItem.cchTextMax = sizeof( szTemp);
if (ListView_GetItem( hMapUser, &sItem))
{
HANDLE hUser = (HANDLE)sItem.lParam;
if (_tcslen( szTemp) > 0 )
- db_set_ts( hUser, MODULE, "FileName", szTemp );
+ db_set_ts( hUser, MODULE, "FileName", szTemp);
else
- db_unset( hUser, MODULE, "FileName" );
+ db_unset( hUser, MODULE, "FileName");
if (sItem.iImage )
- db_unset( hUser, MODULE, "EnableLog" ); // default is Enabled !!
+ db_unset( hUser, MODULE, "EnableLog"); // default is Enabled !!
else
db_set_b( hUser, MODULE, "EnableLog",0);
}
@@ -454,12 +454,12 @@ void ClearAllFileNames(HWND hwndDlg)
sItem.mask = LVIF_TEXT;
sItem.pszText = _T("");
- HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST );
- int nCount = ListView_GetItemCount( hMapUser );
- for( int nCur = 0 ; nCur < nCount ; nCur++ )
+ HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST);
+ int nCount = ListView_GetItemCount( hMapUser);
+ for (int nCur = 0 ; nCur < nCount ; nCur++ )
{
sItem.iItem = nCur;
- ListView_SetItem( hMapUser, &sItem );
+ ListView_SetItem( hMapUser, &sItem);
}
if ( !bUnaplyedChanges )
{
@@ -485,13 +485,13 @@ void AutoFindeFileNames(HWND hwndDlg)
{
TCHAR szDefaultFile[500];
- GetDlgItemText( hwndDlg, IDC_DEFAULT_FILE, szDefaultFile, sizeof( szDefaultFile));
+ GetDlgItemText(hwndDlg, IDC_DEFAULT_FILE, szDefaultFile, sizeof( szDefaultFile));
LVITEM sItem = { 0 };
- HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST );
- int nCount = ListView_GetItemCount( hMapUser );
- for( int nCur = 0 ; nCur < nCount ; nCur++ )
+ HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST);
+ int nCount = ListView_GetItemCount( hMapUser);
+ for (int nCur = 0 ; nCur < nCount ; nCur++ )
{
TCHAR szSearch[ 100 ];
@@ -499,7 +499,7 @@ void AutoFindeFileNames(HWND hwndDlg)
sItem.iItem = nCur;
sItem.iSubItem = 1;
sItem.pszText = szSearch;
- sItem.cchTextMax = sizeof( szSearch );
+ sItem.cchTextMax = sizeof( szSearch);
if ( !ListView_GetItem( hMapUser, &sItem))
{
@@ -509,7 +509,7 @@ void AutoFindeFileNames(HWND hwndDlg)
int nShortestMatch = 0xFFFF;
HANDLE hStortest = 0;
int nStortestIndex = -1;
- for( int nSubCur = 0 ; nSubCur < nCount ; nSubCur++ )
+ for (int nSubCur = 0 ; nSubCur < nCount ; nSubCur++ )
{
if (nSubCur == nCur )
continue;
@@ -518,10 +518,10 @@ void AutoFindeFileNames(HWND hwndDlg)
sItem.iItem = nSubCur;
sItem.iSubItem = 1;
sItem.pszText = szSubCur;
- sItem.cchTextMax = sizeof( szSubCur );
+ sItem.cchTextMax = sizeof( szSubCur);
if (ListView_GetItem( hMapUser, &sItem))
{
- size_t nLen = _tcslen( szSubCur );
+ size_t nLen = _tcslen( szSubCur);
if (_tcsncicmp( szSubCur, szSearch, nLen) == 0 )
{
if (nLen < (size_t)nShortestMatch )
@@ -551,8 +551,8 @@ void AutoFindeFileNames(HWND hwndDlg)
if (sFileName.empty())
{
sFileName = szDefaultFile;
- ReplaceDefines( hStortest, sFileName );
- ReplaceTimeVariables( sFileName );
+ ReplaceDefines( hStortest, sFileName);
+ ReplaceTimeVariables( sFileName);
}
if (!bPriHasFileName )
@@ -589,7 +589,7 @@ void OpenHelp(HWND hwndDlg)
TCHAR szPath[MAX_PATH];
if (GetModuleFileName( hInstance, szPath, sizeof( szPath)) )
{
- size_t nLen = _tcslen( szPath );
+ size_t nLen = _tcslen( szPath);
if (nLen > 3 )
{
szPath[nLen-1] = 't';
@@ -639,10 +639,10 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
{
bWindowTextSet = FALSE;
- HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST );
+ HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST);
{ // init adv. win styles
- DWORD dw = ListView_GetExtendedListViewStyle( hMapUser );
+ DWORD dw = ListView_GetExtendedListViewStyle( hMapUser);
dw |= LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT;
ListView_SetExtendedListViewStyle( hMapUser, dw /*| LVS_EX_LABELTIP*/);
}
@@ -663,22 +663,22 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
cCol.mask = LVCF_TEXT | LVCF_WIDTH;
cCol.cx = nColumnWidth;
cCol.pszText = TranslateT("File");
- ListView_InsertColumn( hMapUser, 0, &cCol );
+ ListView_InsertColumn( hMapUser, 0, &cCol);
cCol.pszText = TranslateT("Nick");
- ListView_InsertColumn( hMapUser, 1, &cCol );
+ ListView_InsertColumn( hMapUser, 1, &cCol);
cCol.cx = nProtoColWitdh;
cCol.pszText = TranslateT("Proto");
- ListView_InsertColumn( hMapUser, 2, &cCol );
+ ListView_InsertColumn( hMapUser, 2, &cCol);
cCol.cx = nUINColWitdh;
cCol.mask |= LVCF_FMT;
cCol.fmt = LVCFMT_RIGHT;
cCol.pszText = TranslateT("UIN");
- ListView_InsertColumn( hMapUser, 3, &cCol );
+ ListView_InsertColumn( hMapUser, 3, &cCol);
/*
int nOrder[3] = { 1, 2, 0 };
- ListView_SetColumnOrderArray( hMapUser, 3, nOrder );*/
+ ListView_SetColumnOrderArray( hMapUser, 3, nOrder);*/
}
{
@@ -693,31 +693,31 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
tstring sTmp;
LVITEM sItem = { 0 };
HANDLE hContact = db_find_first();
- for( int nUser = 0; /*hContact*/ ; nUser++ )
+ for (int nUser = 0; /*hContact*/ ; nUser++ )
{
sItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
sItem.iItem = nUser;
sItem.iSubItem = 0;
sItem.iImage = db_get_b(hContact,MODULE, "EnableLog", 1);
- sItem.lParam = (LPARAM) hContact;
+ sItem.lParam = (LPARAM)hContact;
sTmp = _DBGetString( hContact, MODULE, "FileName", _T(""));
sItem.pszText = (TCHAR*)sTmp.c_str();
- ListView_InsertItem( hMapUser, &sItem );
+ ListView_InsertItem( hMapUser, &sItem);
sItem.mask = LVIF_TEXT;
sItem.iSubItem = 1;
sItem.pszText = (TCHAR*)NickFromHandle(hContact);
- ListView_SetItem( hMapUser, &sItem );
+ ListView_SetItem( hMapUser, &sItem);
sItem.iSubItem = 2;
sTmp = _DBGetString( hContact, "Protocol", "p", _T(""));
- string sTmpA = _DBGetStringA( hContact, "Protocol", "p", "" );
+ string sTmpA = _DBGetStringA( hContact, "Protocol", "p", "");
sItem.pszText = (TCHAR*)sTmp.c_str();
- ListView_SetItem( hMapUser, &sItem );
+ ListView_SetItem( hMapUser, &sItem);
DWORD dwUIN = db_get_dw(hContact, sTmpA.c_str(), "UIN", 0);
@@ -725,38 +725,38 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
mir_sntprintf(szTmp, SIZEOF(szTmp),_T("%d"), dwUIN);
sItem.iSubItem = 3;
sItem.pszText = szTmp;
- ListView_SetItem( hMapUser, &sItem );
+ ListView_SetItem( hMapUser, &sItem);
if ( !hContact) // written like this to add the current user ( handle = 0 )
break;
hContact = db_find_next(hContact);
}
- ListView_SortItems( hMapUser, CompareFunc, 1 );
+ ListView_SortItems( hMapUser, CompareFunc, 1);
sItem.mask = LVIF_STATE;
sItem.iItem = 0;
sItem.iSubItem = 0;
sItem.state = LVIS_FOCUSED;
sItem.stateMask = LVIS_FOCUSED;
- ListView_SetItem( hMapUser, &sItem );
+ ListView_SetItem( hMapUser, &sItem);
}
HWND hComboBox;
- SetDlgItemInt( hwndDlg, IDC_MAX_CLOUMN_WIDTH, nMaxLineWidth, TRUE );
+ SetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, nMaxLineWidth, TRUE);
{// Export dir
- SetDlgItemText( hwndDlg, IDC_EXPORT_DIR, sExportDir.c_str());
- hComboBox = GetDlgItem( hwndDlg, IDC_EXPORT_DIR );
+ SetDlgItemText(hwndDlg, IDC_EXPORT_DIR, sExportDir.c_str());
+ hComboBox = GetDlgItem(hwndDlg, IDC_EXPORT_DIR);
SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%dbpath%\\MsgExport\\"));
SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("C:\\Backup\\MsgExport\\"));
SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%dbpath%\\MsgExport\\%group% - "));
SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%dbpath%\\MsgExport\\%group%\\"));
}
{// default file
- SetDlgItemText( hwndDlg, IDC_DEFAULT_FILE, sDefaultFile.c_str());
- hComboBox = GetDlgItem( hwndDlg, IDC_DEFAULT_FILE );
+ SetDlgItemText(hwndDlg, IDC_DEFAULT_FILE, sDefaultFile.c_str());
+ hComboBox = GetDlgItem(hwndDlg, IDC_DEFAULT_FILE);
SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%nick%.txt"));
SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%UIN%.txt"));
SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%group%.txt"));
@@ -770,29 +770,29 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("History.txt"));
}
{// time format
- SetDlgItemText( hwndDlg, IDC_EXPORT_TIMEFORMAT, sTimeFormat.c_str());
- hComboBox = GetDlgItem( hwndDlg, IDC_EXPORT_TIMEFORMAT );
- SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d t") );
- SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d s") );
- SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d m") );
- SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("D s") );
+ SetDlgItemText(hwndDlg, IDC_EXPORT_TIMEFORMAT, sTimeFormat.c_str());
+ hComboBox = GetDlgItem(hwndDlg, IDC_EXPORT_TIMEFORMAT);
+ SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d t") );
+ SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d s") );
+ SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d m") );
+ SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("D s") );
SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("D m :"));
}
{// File viewer
- SetDlgItemText( hwndDlg, IDC_FILE_VIEWER, sFileViewerPrg.c_str());
- hComboBox = GetDlgItem( hwndDlg, IDC_FILE_VIEWER );
- SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("") );
- SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("C:\\Windows\\Notepad.exe") );
- SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("C:\\WinNT\\Notepad.exe") );
- //EnableWindow( GetDlgItem( hwndDlg, IDC_FILE_VIEWER ), ! bUseInternalViewer());
+ SetDlgItemText(hwndDlg, IDC_FILE_VIEWER, sFileViewerPrg.c_str());
+ hComboBox = GetDlgItem(hwndDlg, IDC_FILE_VIEWER);
+ SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("") );
+ SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("C:\\Windows\\Notepad.exe") );
+ SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("C:\\WinNT\\Notepad.exe") );
+ //EnableWindow( GetDlgItem(hwndDlg, IDC_FILE_VIEWER ), ! bUseInternalViewer());
}
- CheckDlgButton( hwndDlg, IDC_USE_INTERNAL_VIEWER , bUseInternalViewer() ? BST_CHECKED : BST_UNCHECKED );
- CheckDlgButton( hwndDlg, IDC_REPLACE_MIRANDA_HISTORY, bReplaceHistory ? BST_CHECKED : BST_UNCHECKED );
- CheckDlgButton( hwndDlg, IDC_APPEND_NEWLINE, bAppendNewLine ? BST_CHECKED : BST_UNCHECKED );
- CheckDlgButton( hwndDlg, IDC_USE_UTF8_IN_NEW_FILES, bUseUtf8InNewFiles ? BST_CHECKED : BST_UNCHECKED );
- CheckDlgButton( hwndDlg, IDC_USE_LESS_AND_GREATER_IN_EXPORT, bUseLessAndGreaterInExport ? BST_CHECKED : BST_UNCHECKED );
+ CheckDlgButton(hwndDlg, IDC_USE_INTERNAL_VIEWER , bUseInternalViewer() ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_REPLACE_MIRANDA_HISTORY, bReplaceHistory ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_APPEND_NEWLINE, bAppendNewLine ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USE_UTF8_IN_NEW_FILES, bUseUtf8InNewFiles ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USE_LESS_AND_GREATER_IN_EXPORT, bUseLessAndGreaterInExport ? BST_CHECKED : BST_UNCHECKED);
TranslateDialogDefault(hwndDlg);
@@ -814,13 +814,13 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
return TRUE;
if (res == IDYES )
{
- if ( !bApplyChanges( hwndDlg))
+ if ( !bApplyChanges(hwndDlg))
{
return TRUE;
}
}
}
- nExportCompleatList( hwndDlg, LOWORD(wParam) == ID_EXPORTSELECTED );
+ nExportCompleatList(hwndDlg, LOWORD(wParam) == ID_EXPORTSELECTED);
return TRUE;
}
case IDC_EXPORT_DIR:
@@ -853,8 +853,8 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
case IDC_USE_INTERNAL_VIEWER:
/* {
EnableWindow(
- GetDlgItem( hwndDlg, IDC_FILE_VIEWER ),
- !IsDlgButtonChecked( hwndDlg, IDC_USE_INTERNAL_VIEWER )
+ GetDlgItem(hwndDlg, IDC_FILE_VIEWER ),
+ !IsDlgButtonChecked(hwndDlg, IDC_USE_INTERNAL_VIEWER )
);
}// fall thru here !!*/
case IDC_REPLACE_MIRANDA_HISTORY:
@@ -873,8 +873,8 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
{
LVITEM sItem = { 0 };
sItem.mask = LVIF_PARAM;
- HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST );
- sItem.iItem = ListView_GetNextItem( hMapUser, -1, LVIS_SELECTED );
+ HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST);
+ sItem.iItem = ListView_GetNextItem( hMapUser, -1, LVIS_SELECTED);
if (sItem.iItem >= 0 && ListView_GetItem( hMapUser, &sItem ))
{
CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)sItem.lParam,0);
@@ -899,7 +899,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
}
case ID_SET_TO_DEFAULT:
{
- SetToDefault( hwndDlg );
+ SetToDefault(hwndDlg);
return TRUE;
}
case IDC_FILE_VIEWER_BROWSE:
@@ -907,7 +907,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
OPENFILENAME ofn = { 0 }; // common dialog box structure
TCHAR szFile[260]; // buffer for file name
- GetDlgItemText( hwndDlg, IDC_FILE_VIEWER, szFile, sizeof(szFile));
+ GetDlgItemText(hwndDlg, IDC_FILE_VIEWER, szFile, sizeof(szFile));
// Initialize OPENFILENAME
//ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
@@ -927,7 +927,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
if (GetOpenFileName(&ofn))
{
- SetDlgItemText( hwndDlg, IDC_FILE_VIEWER, szFile );
+ SetDlgItemText(hwndDlg, IDC_FILE_VIEWER, szFile);
bUnaplyedChanges = TRUE;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
@@ -939,7 +939,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
{
LPMALLOC pMalloc;
- //CoInitializeEx(NULL,COINIT_APARTMENTTHREADED );
+ //CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);
// Get the shells allocator
if (FAILED(SHGetMalloc(&pMalloc))) // we need to use this to support old Windows versions
{
@@ -970,19 +970,19 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
if (psItemIDList )
{
SHGetPathFromIDList(psItemIDList, lpDestDir);
- size_t n = _tcslen( lpDestDir );
+ size_t n = _tcslen( lpDestDir);
if (n > 0 && lpDestDir[n] != '\\' )
{
lpDestDir[n] = '\\' ;
lpDestDir[n+1] = 0;
}
- SetDlgItemText( hwndDlg, IDC_EXPORT_DIR, lpDestDir );
+ SetDlgItemText(hwndDlg, IDC_EXPORT_DIR, lpDestDir);
bUnaplyedChanges = TRUE;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
// Clean up
- pMalloc->Free( psItemIDList );
+ pMalloc->Free( psItemIDList);
}
- pMalloc->Free( lpDestDir );
+ pMalloc->Free( lpDestDir);
pMalloc->Release();
return TRUE;
}
@@ -991,7 +991,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
}
case WM_CONTEXTMENU:
{
- if (wParam != (WPARAM)GetDlgItem( hwndDlg, IDC_MAP_USER_LIST))
+ if (wParam != (WPARAM)GetDlgItem(hwndDlg, IDC_MAP_USER_LIST))
return FALSE;
HMENU hMainMenu = LoadMenu(hInstance,MAKEINTRESOURCE(IDR_MSG_EXPORT));
@@ -1004,11 +1004,11 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
pt.y=(short)HIWORD(lParam);
if (pt.x == -1 && pt.y == -1 )
{
- HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST );
- int nFirst = ListView_GetNextItem( hMapUser, -1, LVNI_FOCUSED );
+ HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST);
+ int nFirst = ListView_GetNextItem( hMapUser, -1, LVNI_FOCUSED);
if (nFirst >= 0 )
{
- ListView_GetItemPosition( hMapUser, nFirst, &pt );
+ ListView_GetItemPosition( hMapUser, nFirst, &pt);
}
if (pt.y < 16 )
@@ -1016,7 +1016,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
else
{
RECT rUserList;
- GetClientRect( hMapUser, &rUserList );
+ GetClientRect( hMapUser, &rUserList);
if (pt.y > rUserList.bottom - 16 )
pt.y = rUserList.bottom - 16;
else
@@ -1064,7 +1064,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
if (pdi->item.mask & LVIF_TEXT )
{
pdi->item.mask &= LVIF_TEXT;
- ListView_SetItem( p->hwndFrom, &pdi->item );
+ ListView_SetItem( p->hwndFrom, &pdi->item);
bUnaplyedChanges = TRUE;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -1077,10 +1077,10 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
if (lpnmk->wVKey == 'A' && (GetKeyState( VK_CONTROL) & 0x8000))
{
// select all
- int nCount = ListView_GetItemCount( p->hwndFrom );
- for( int nCur = 0 ; nCur < nCount ; nCur++ )
+ int nCount = ListView_GetItemCount( p->hwndFrom );
+ for (int nCur = 0 ; nCur < nCount ; nCur++ )
{
- ListView_SetItemState( p->hwndFrom, nCur, LVIS_SELECTED, LVIS_SELECTED );
+ ListView_SetItemState( p->hwndFrom, nCur, LVIS_SELECTED, LVIS_SELECTED);
}
return TRUE;
}
@@ -1096,9 +1096,9 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
if (hEdit && lpnmk->wVKey != VK_F2 )
{
if (isupper( lpnmk->wVKey))
- SendMessage( hEdit, WM_CHAR, tolower( lpnmk->wVKey ), 0 );
+ SendMessage( hEdit, WM_CHAR, tolower( lpnmk->wVKey ), 0);
else
- SendMessage( hEdit, WM_CHAR, lpnmk->wVKey, 0 );
+ SendMessage( hEdit, WM_CHAR, lpnmk->wVKey, 0);
}
}
return TRUE;
@@ -1108,7 +1108,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
NMITEMACTIVATE * pdi = (NMITEMACTIVATE *) lParam;
if (pdi->iItem >= 0 )
{
- ListView_EditLabel( p->hwndFrom, pdi->iItem );
+ ListView_EditLabel( p->hwndFrom, pdi->iItem);
}
return TRUE;
}
@@ -1126,7 +1126,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
{
if (lplvcd->nmcd.lItemlParam == 0 )
{
- lplvcd->clrText = RGB( 0, 0, 255 );
+ lplvcd->clrText = RGB( 0, 0, 255);
}
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_NEWFONT);
return true;
@@ -1142,7 +1142,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
{
case PSN_APPLY:
{
- bApplyChanges( hwndDlg );
+ bApplyChanges(hwndDlg);
return TRUE;
}
case HDN_ITEMCLICK:
@@ -1150,8 +1150,8 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
NMHEADER * phdr = (LPNMHEADER) p;
if (phdr->iButton == 0 )// 0 => Left button
{
- HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST );
- ListView_SortItems( hMapUser, CompareFunc, phdr->iItem );
+ HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST);
+ ListView_SortItems( hMapUser, CompareFunc, phdr->iItem);
return TRUE;
}
return FALSE;
@@ -1179,26 +1179,26 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
BOOL bApplyChanges2( HWND hwndDlg )
{
- if (IsDlgButtonChecked( hwndDlg, IDC_FC_PROMPT) == BST_CHECKED )
+ if (IsDlgButtonChecked(hwndDlg, IDC_FC_PROMPT) == BST_CHECKED )
enRenameAction = eDAPromptUser;
- else if (IsDlgButtonChecked( hwndDlg, IDC_FC_RENAME) == BST_CHECKED )
+ else if (IsDlgButtonChecked(hwndDlg, IDC_FC_RENAME) == BST_CHECKED )
enRenameAction = eDAAutomatic;
- else if (IsDlgButtonChecked( hwndDlg, IDC_FC_NOTHING) == BST_CHECKED )
+ else if (IsDlgButtonChecked(hwndDlg, IDC_FC_NOTHING) == BST_CHECKED )
enRenameAction = eDANothing;
- if (IsDlgButtonChecked( hwndDlg, IDC_FD_PROMPT) == BST_CHECKED )
+ if (IsDlgButtonChecked(hwndDlg, IDC_FD_PROMPT) == BST_CHECKED )
enDeleteAction = eDAPromptUser;
- else if (IsDlgButtonChecked( hwndDlg, IDC_FD_DELETE) == BST_CHECKED )
+ else if (IsDlgButtonChecked(hwndDlg, IDC_FD_DELETE) == BST_CHECKED )
enDeleteAction = eDAAutomatic;
- else if (IsDlgButtonChecked( hwndDlg, IDC_FD_NOTHING) == BST_CHECKED )
+ else if (IsDlgButtonChecked(hwndDlg, IDC_FD_NOTHING) == BST_CHECKED )
enDeleteAction = eDANothing;
char szTemp[ 500 ];
- strcpy( szTemp, "DisableProt_" );
+ strcpy( szTemp, "DisableProt_");
- HWND hMapUser = GetDlgItem( hwndDlg, IDC_EXPORT_PROTOS );
- int nCount = ListView_GetItemCount( hMapUser );
- for( int nCur = 0 ; nCur < nCount ; nCur++ )
+ HWND hMapUser = GetDlgItem(hwndDlg, IDC_EXPORT_PROTOS);
+ int nCount = ListView_GetItemCount( hMapUser);
+ for (int nCur = 0 ; nCur < nCount ; nCur++ )
{
LVITEMA sItem = { 0 };
sItem.iItem = nCur;
@@ -1208,9 +1208,9 @@ BOOL bApplyChanges2( HWND hwndDlg )
if (::SendMessage(hMapUser, LVM_GETITEMA, 0, (LPARAM)&sItem))
{
if (sItem.iImage )
- db_unset( NULL, MODULE, szTemp ); // default is Enabled !!
+ db_unset(NULL, MODULE, szTemp); // default is Enabled !!
else
- db_set_b( NULL, MODULE, szTemp,0);
+ db_set_b(NULL, MODULE, szTemp,0);
}
}
SaveSettings();
@@ -1245,31 +1245,31 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa
switch( enRenameAction )
{
case eDAPromptUser:
- CheckDlgButton( hwndDlg, IDC_FC_PROMPT, true );
+ CheckDlgButton(hwndDlg, IDC_FC_PROMPT, true);
break;
case eDAAutomatic:
- CheckDlgButton( hwndDlg, IDC_FC_RENAME, true );
+ CheckDlgButton(hwndDlg, IDC_FC_RENAME, true);
break;
case eDANothing:
- CheckDlgButton( hwndDlg, IDC_FC_NOTHING, true );
+ CheckDlgButton(hwndDlg, IDC_FC_NOTHING, true);
break;
}
switch( enDeleteAction )
{
case eDAPromptUser:
- CheckDlgButton( hwndDlg, IDC_FD_PROMPT, true );
+ CheckDlgButton(hwndDlg, IDC_FD_PROMPT, true);
break;
case eDAAutomatic:
- CheckDlgButton( hwndDlg, IDC_FD_DELETE, true );
+ CheckDlgButton(hwndDlg, IDC_FD_DELETE, true);
break;
case eDANothing:
- CheckDlgButton( hwndDlg, IDC_FD_NOTHING, true );
+ CheckDlgButton(hwndDlg, IDC_FD_NOTHING, true);
break;
}
- HWND hMapUser = GetDlgItem( hwndDlg, IDC_EXPORT_PROTOS );
+ HWND hMapUser = GetDlgItem(hwndDlg, IDC_EXPORT_PROTOS);
/*
{ // init adv. win styles
- DWORD dw = ListView_GetExtendedListViewStyle( hMapUser );
+ DWORD dw = ListView_GetExtendedListViewStyle( hMapUser);
dw |= LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT;
ListView_SetExtendedListViewStyle( hMapUser, dw /);
}
@@ -1278,7 +1278,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa
RECT rListSize;
if (GetWindowRect( hMapUser, &rListSize))
{
- nColumnWidth = (rListSize.right - rListSize.left- GetSystemMetrics(SM_CXVSCROLL) - 5 );
+ nColumnWidth = (rListSize.right - rListSize.left- GetSystemMetrics(SM_CXVSCROLL) - 5);
if (nColumnWidth < 10)
nColumnWidth = 10;
}
@@ -1288,7 +1288,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa
cCol.mask = LVCF_TEXT | LVCF_WIDTH;
cCol.cx = nColumnWidth;
cCol.pszText = TranslateT("Export Protocols");
- ListView_InsertColumn( hMapUser, 0, &cCol );
+ ListView_InsertColumn( hMapUser, 0, &cCol);
}
{
@@ -1308,12 +1308,12 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa
ProtoEnumAccounts(&nCount, &proto);
- for( int i=0 ; i < nCount ; i++)
+ for (int i=0 ; i < nCount ; i++)
{
mir_snprintf(szTemp, SIZEOF(szTemp), "DisableProt_%s", proto[i]->szModuleName);
sItem.pszText = proto[i]->szModuleName;
sItem.iImage = db_get_b(NULL,MODULE,szTemp,1);
- ::SendMessage( hMapUser, LVM_INSERTITEMA, 0,(LPARAM)&sItem );
+ ::SendMessage( hMapUser, LVM_INSERTITEMA, 0,(LPARAM)&sItem);
sItem.iItem++;
}
}
diff --git a/plugins/Msg_Export/src/options.h b/plugins/Msg_Export/src/options.h
index e25db6b573..d8fb7afdb6 100755
--- a/plugins/Msg_Export/src/options.h
+++ b/plugins/Msg_Export/src/options.h
@@ -20,7 +20,7 @@
#ifndef MSG_EXP_OPTIONS_H
#define MSG_EXP_OPTIONS_H
-int OptionsInitialize( WPARAM, LPARAM );
-int nExportCompleatList(HWND hParent, bool bOnlySelected );
+int OptionsInitialize( WPARAM, LPARAM);
+int nExportCompleatList(HWND hParent, bool bOnlySelected);
#endif \ No newline at end of file
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp
index a05718e66f..66c0ee9a20 100755
--- a/plugins/Msg_Export/src/utils.cpp
+++ b/plugins/Msg_Export/src/utils.cpp
@@ -118,8 +118,8 @@ void ShowDebugInfo()
sDebug += _T("\r\nsDefaultFile :");
sDebug += sDefaultFile;
- sDebug += _T("\r\nGetFilePathFromUser( NULL) :");
- sDebug += GetFilePathFromUser( NULL );
+ sDebug += _T("\r\nGetFilePathFromUser(NULL) :");
+ sDebug += GetFilePathFromUser(NULL);
MessageBox(NULL, sDebug.c_str(), MSG_BOX_TITEL, MB_OK);
}
@@ -144,7 +144,7 @@ int nGetFormatCount( const TCHAR *pszToCheck )
return 0;
int nCount = 0;
- for( ; pszToCheck[1] != 0 ; pszToCheck++)
+ for (; pszToCheck[1] != 0 ; pszToCheck++)
{
if (pszToCheck[0] == '%' && pszToCheck[1] != '%' )
nCount++;
@@ -168,12 +168,12 @@ int nGetFormatCount( const TCHAR *pszToCheck )
/*
TCHAR *CheckedTranslate( const TCHAR *szEng, int nFormatCount )//= -1
{
- TCHAR *szRet = TranslateTS( szEng );
+ TCHAR *szRet = TranslateTS( szEng);
if (szEng == szRet )
return (TCHAR*)szEng;
if (nFormatCount == -1 )
- nFormatCount = nGetFormatCount( szEng );
+ nFormatCount = nGetFormatCount( szEng);
if (nFormatCount != nGetFormatCount( szRet))
{
@@ -181,7 +181,7 @@ TCHAR *CheckedTranslate( const TCHAR *szEng, int nFormatCount )//= -1
sError += szEng;
sError += _T("\r\n--------------- It was translated to ---------------\r\n");
sError += szRet;
- MessageBox( NULL, sError.c_str(),MSG_BOX_TITEL,MB_OK );
+ MessageBox(NULL, sError.c_str(),MSG_BOX_TITEL,MB_OK);
return (TCHAR*)szEng;
}
return szRet;
@@ -210,7 +210,7 @@ tstring sGetErrorString(DWORD dwError)
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
- NULL );
+ NULL);
// Process any inserts in lpMsgBuf.
// ...
// Display the string.
@@ -220,7 +220,7 @@ tstring sGetErrorString(DWORD dwError)
ReplaceAll( ret, _T(" "), _T(" "));
// Free the buffer.
- LocalFree( lpMsgBuf );
+ LocalFree( lpMsgBuf);
return ret;
}
@@ -257,7 +257,7 @@ void DisplayLastError(const TCHAR *pszError)
const TCHAR* NickFromHandle(HANDLE hContact)
{
- const TCHAR *psz = (const TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR );
+ const TCHAR *psz = (const TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
if (psz )
return psz;
return pszNickError;
@@ -344,7 +344,7 @@ void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew)
string::size_type nCur = 0;
while( (nCur = sSrc.find(pszReplace,nCur)) != sSrc.npos )
{
- sSrc.replace( nCur, _tcslen( pszReplace ), sNew );
+ sSrc.replace( nCur, _tcslen( pszReplace ), sNew);
nCur += sNew.size();
}
}
@@ -352,7 +352,7 @@ void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew)
void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew)
{
tstring sNew = pszNew;
- ReplaceAll( sSrc, pszReplace, sNew );
+ ReplaceAll( sSrc, pszReplace, sNew);
}
@@ -371,7 +371,7 @@ void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew)
bool bCreatePathToFile( tstring sFilePath )
{
- string::size_type nPos = sFilePath.rfind( '\\' );
+ string::size_type nPos = sFilePath.rfind( '\\');
if ( nPos != string::npos )
{
if (nPos + 1 < sFilePath.size())
@@ -496,7 +496,7 @@ bool bWriteNewLine( HANDLE hFile, DWORD dwIndent )
{
if (dwIndent > sizeof( szNewLineIndent) - 2 )
dwIndent = sizeof( szNewLineIndent) - 2;
- return bWriteToFile( hFile, szNewLineIndent, dwIndent + 2 );
+ return bWriteToFile( hFile, szNewLineIndent, dwIndent + 2);
}
/////////////////////////////////////////////////////////////////////
@@ -518,7 +518,7 @@ bool bWriteHexToFile( HANDLE hFile, void * pData, int nSize )
{
char cBuf[10];
BYTE * p = (BYTE*)pData;
- for( int n = 0 ; n < nSize ; n++ )
+ for (int n = 0 ; n < nSize ; n++ )
{
mir_snprintf(cBuf, SIZEOF(cBuf), "%.2X ", p[n]);
if ( !bWriteToFile( hFile, cBuf, 3))
@@ -570,7 +570,7 @@ bool bReadMirandaDirAndPath()
void ReplaceDBPath( tstring &sRet )
{
- ReplaceAll( sRet, _T("%dbpath%"), sDBPath );
+ ReplaceAll( sRet, _T("%dbpath%"), sDBPath);
// Try to firure out if it is a relative path ( ..\..\MsgExport\ )
if (sRet.size() <= 2 || ! ( sRet[1] == ':' ||
( sRet[0] == '\\' && sRet[1] == '\\')))
@@ -602,12 +602,12 @@ tstring GetFilePathFromUser( HANDLE hContact )
bool bNickUsed = sFilePath.find( _T("%nick%")) != string::npos;
- ReplaceDefines( hContact, sFilePath );
+ ReplaceDefines( hContact, sFilePath);
tstring sNoDBPath = sFilePath;
- ReplaceTimeVariables( sFilePath );
- ReplaceDBPath( sFilePath );
+ ReplaceTimeVariables( sFilePath);
+ ReplaceDBPath( sFilePath);
// Previous file name check to see if it has changed !!
tstring sPrevFileName = _DBGetString( hContact, MODULE, "PrevFileName", _T(""));
@@ -615,7 +615,7 @@ tstring GetFilePathFromUser( HANDLE hContact )
{
if ( !sPrevFileName.empty())
{
- ReplaceDBPath( sPrevFileName );
+ ReplaceDBPath( sPrevFileName);
// Here we will try to avoide the (Unknown Contact) in cases where the protocol for
// this user has been removed.
@@ -638,11 +638,11 @@ tstring GetFilePathFromUser( HANDLE hContact )
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
- NULL );
+ NULL);
if (hPrevFile != INVALID_HANDLE_VALUE )
{
- CloseHandle( hPrevFile );
+ CloseHandle( hPrevFile);
TCHAR szTemp[500];
// There is a previous file we can move
// ask user ?
@@ -668,7 +668,7 @@ tstring GetFilePathFromUser( HANDLE hContact )
{
// this might be because the new path isent created
// so we will try to create it
- bCreatePathToFile( sFilePath );
+ bCreatePathToFile( sFilePath);
while( ! MoveFile( sPrevFileName.c_str(), sFilePath.c_str()))
{
@@ -709,7 +709,7 @@ tstring GetFilePathFromUser( HANDLE hContact )
tstring FileNickFromHandle( HANDLE hContact)
{
- tstring ret = NickFromHandle( hContact );
+ tstring ret = NickFromHandle( hContact);
string::size_type nCur = 0;
while( (nCur = ret.find_first_of(_T(":\\"),nCur)) != ret.npos )
ret[nCur] = cBadCharReplace;
@@ -737,7 +737,7 @@ void ReplaceAllNoColon( tstring &sSrc, const TCHAR *pszReplace, tstring &sNew)
tstring::size_type nCur = 0;
while( (nCur = sNew.find_first_of(_T(':'),nCur)) != sNew.npos )
sNew[nCur] = cBadCharReplace;
- ReplaceAll( sSrc, pszReplace, sNew );
+ ReplaceAll( sSrc, pszReplace, sNew);
}
/////////////////////////////////////////////////////////////////////
@@ -768,7 +768,7 @@ void ReplaceDefines( HANDLE hContact, tstring & sTarget )
if (bUINUsed || bEMailUsed || bProtoUsed || bIdentifierUsed )
{
- string sProto = _DBGetStringA( hContact, "Protocol", "p", "" );
+ string sProto = _DBGetStringA( hContact, "Protocol", "p", "");
if (bUINUsed || ( bIdentifierUsed && sProto == "ICQ"))
{
DWORD dwUIN = db_get_dw(hContact, sProto.c_str(), "UIN", 0);
@@ -781,15 +781,15 @@ void ReplaceDefines( HANDLE hContact, tstring & sTarget )
}
else
{
- sReplaceUin = FileNickFromHandle( hContact );
+ sReplaceUin = FileNickFromHandle( hContact);
}
if (bUINUsed )
- ReplaceAll( sTarget, _T("%UIN%"), sReplaceUin );
+ ReplaceAll( sTarget, _T("%UIN%"), sReplaceUin);
if (bIdentifierUsed && sProto == "ICQ" )
{
bIdentifierUsed = false;
- ReplaceAll( sTarget, _T("%identifier%"), sReplaceUin );
+ ReplaceAll( sTarget, _T("%identifier%"), sReplaceUin);
}
}
@@ -802,15 +802,15 @@ void ReplaceDefines( HANDLE hContact, tstring & sTarget )
if (sEMail.empty())
{
// We can't finde the E-mail address we will use the the nick
- sEMail = FileNickFromHandle( hContact );
+ sEMail = FileNickFromHandle( hContact);
}
}
if (bEMailUsed )
- ReplaceAllNoColon( sTarget, _T("%e-mail%"), sEMail );
+ ReplaceAllNoColon( sTarget, _T("%e-mail%"), sEMail);
if (bIdentifierUsed && sProto == "MSN")
{
bIdentifierUsed = false;
- ReplaceAllNoColon( sTarget, _T("%identifier%"), sEMail );
+ ReplaceAllNoColon( sTarget, _T("%identifier%"), sEMail);
}
}
if (bIdentifierUsed && sProto == "Jabber" )
@@ -818,15 +818,15 @@ void ReplaceDefines( HANDLE hContact, tstring & sTarget )
tstring sReplace = _DBGetString( hContact, "Jabber", "jid", _T(""));
if (sReplace.empty())
{
- sReplace = FileNickFromHandle( hContact );
+ sReplace = FileNickFromHandle( hContact);
}
bIdentifierUsed = false;
- ReplaceAll( sTarget, _T("%identifier%"), sReplace );
+ ReplaceAll( sTarget, _T("%identifier%"), sReplace);
}
if (bProtoUsed )
{
tstring tmp = _DBGetString( hContact, "Protocol", "p", _T(""));
- ReplaceAllNoColon( sTarget, _T("%protocol%"), tmp );
+ ReplaceAllNoColon( sTarget, _T("%protocol%"), tmp);
}
if (bIdentifierUsed )
{
@@ -838,7 +838,7 @@ void ReplaceDefines( HANDLE hContact, tstring & sTarget )
if (sTarget.find( _T("%group%")) != string::npos )
{
tstring sGroup = _DBGetString( hContact, "CList", "Group", _T(""));
- ReplaceAllNoColon( sTarget, _T("%group%"), sGroup );
+ ReplaceAllNoColon( sTarget, _T("%group%"), sGroup);
}
// We can't replace the : here because if the user uses C:\... in the file path
@@ -870,15 +870,15 @@ void ReplaceTimeVariables( tstring &sRet )
sRet.find( _T("%day%")) != string::npos )
{
SYSTEMTIME stTime;
- GetLocalTime( &stTime );
+ GetLocalTime(&stTime);
TCHAR sTmp[20];
mir_sntprintf(sTmp, SIZEOF(sTmp), _T("%d"), stTime.wYear);
- ReplaceAll( sRet, _T("%year%"), sTmp );
+ ReplaceAll( sRet, _T("%year%"), sTmp);
mir_sntprintf(sTmp, SIZEOF(sTmp), _T("%.2d"), stTime.wMonth);
- ReplaceAll( sRet, _T("%month%"), sTmp );
+ ReplaceAll( sRet, _T("%month%"), sTmp);
mir_sntprintf(sTmp, SIZEOF(sTmp), _T("%.2d"), stTime.wDay);
- ReplaceAll( sRet, _T("%day%"), sTmp );
+ ReplaceAll( sRet, _T("%day%"), sTmp);
}
}
@@ -900,7 +900,7 @@ void UpdateFileToColWidth()
clFileTo1ColWidth.clear();
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- tstring sNick = NickFromHandle( hContact );
+ tstring sNick = NickFromHandle( hContact);
string::size_type &rnValue = clFileTo1ColWidth[ GetFilePathFromUser( hContact) ];
if (rnValue < sNick.size())
rnValue = sNick.size();
@@ -961,24 +961,24 @@ void DisplayErrorDialog( const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL); // file handle
- bWriteTextToFile( hf, sError.c_str(), false );
+ bWriteTextToFile( hf, sError.c_str(), false);
if (dbei )
{
- bWriteToFile( hf, "\r\ndbei :" );
+ bWriteToFile( hf, "\r\ndbei :");
bWriteHexToFile( hf, dbei, sizeof( DBEVENTINFO ));
if (dbei->pBlob )
{
- bWriteToFile( hf, "\r\ndbei.pBlob :" );
+ bWriteToFile( hf, "\r\ndbei.pBlob :");
bWriteHexToFile( hf, dbei->pBlob, min( dbei->cbBlob, 10000 ));
}
if (dbei->szModule )
{
- bWriteToFile( hf, "\r\ndbei.szModule :" );
- bWriteToFile( hf, dbei->szModule );
+ bWriteToFile( hf, "\r\ndbei.szModule :");
+ bWriteToFile( hf, dbei->szModule);
}
}
- CloseHandle( hf );
+ CloseHandle( hf);
}
}
}
@@ -1000,24 +1000,24 @@ void DisplayErrorDialog( const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO
void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
{
TCHAR szTemp[500];
- tstring sFilePath = GetFilePathFromUser( hContact );
+ tstring sFilePath = GetFilePathFromUser( hContact);
GetLastError();// Clear last error !!
- HANDLE hFile = CreateFile( sFilePath.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0,OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
+ HANDLE hFile = CreateFile( sFilePath.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0,OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE )
{
// this might be because the path isent created
// so we will try to create it
if (bCreatePathToFile( sFilePath))
{
- hFile = CreateFile( sFilePath.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0,OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
+ hFile = CreateFile( sFilePath.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0,OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
}
}
if (hFile == INVALID_HANDLE_VALUE )
{
- DisplayErrorDialog( LPGENT("Failed to open or create file :\n"), sFilePath, NULL );
+ DisplayErrorDialog( LPGENT("Failed to open or create file :\n"), sFilePath, NULL);
return;
}
@@ -1035,8 +1035,8 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
{
sLocalUser = NickFromHandle(0);
sRemoteUser = NickFromHandle(hContact);
- nFirstColumnWidth = max( sRemoteUser.size(), clFileTo1ColWidth[sFilePath] );
- nFirstColumnWidth = max( sLocalUser.size(), nFirstColumnWidth );
+ nFirstColumnWidth = max( sRemoteUser.size(), clFileTo1ColWidth[sFilePath]);
+ nFirstColumnWidth = max( sLocalUser.size(), nFirstColumnWidth);
nFirstColumnWidth += 2;
}
@@ -1046,7 +1046,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
DWORD dwLowSize;
DWORD dwHighSize = 0;
- dwLowSize = GetFileSize( hFile, &dwHighSize );
+ dwLowSize = GetFileSize( hFile, &dwHighSize);
if (dwLowSize == INVALID_FILE_SIZE || dwLowSize != 0 || dwHighSize != 0 )
{
@@ -1054,15 +1054,15 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
BYTE ucByteOrder[3];
if (ReadFile( hFile, ucByteOrder, 3, &dwDataRead, NULL))
{
- bWriteUTF8Format = bIsUtf8Header( ucByteOrder );
+ bWriteUTF8Format = bIsUtf8Header( ucByteOrder);
}
- DWORD dwPtr = SetFilePointer( hFile, 0, 0, FILE_END );
+ DWORD dwPtr = SetFilePointer( hFile, 0, 0, FILE_END);
if (dwPtr == INVALID_SET_FILE_POINTER )
{
// we need to aborte mission here because if we continue we risk
// overwriting old log.
- DisplayErrorDialog( LPGENT("Failed to move to the end of the file :\n"), sFilePath, NULL );
- CloseHandle( hFile );
+ DisplayErrorDialog( LPGENT("Failed to move to the end of the file :\n"), sFilePath, NULL);
+ CloseHandle( hFile);
return;
}
}
@@ -1073,8 +1073,8 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
{
if ( !bWriteToFile( hFile, szUtf8ByteOrderHeader, sizeof( szUtf8ByteOrderHeader) - 1))
{
- DisplayErrorDialog( LPGENT("Failed to UTF8 byte order code to file :\n"), sFilePath, NULL );
- CloseHandle( hFile );
+ DisplayErrorDialog( LPGENT("Failed to UTF8 byte order code to file :\n"), sFilePath, NULL);
+ CloseHandle( hFile);
return;
}
}
@@ -1098,30 +1098,30 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
// This is written this way because I expect this will become a string the user may set
// in the options dialog.
- ReplaceAll( output, _T("%User%"), sRemoteUser );
+ ReplaceAll( output, _T("%User%"), sRemoteUser);
- string sProto = _DBGetStringA( hContact, "Protocol", "p", "" );
+ string sProto = _DBGetStringA( hContact, "Protocol", "p", "");
ReplaceAll( output, _T("%Proto%"), _DBGetString( hContact, "Protocol", "p", _T("")));
- for( int nCur = 0 ; nCur < 9 ; nCur++ )
+ for (int nCur = 0 ; nCur < 9 ; nCur++ )
{
ReplaceAll( output, pszReplaceList[nCur], _DBGetString( hContact, sProto.c_str(), pszReplaceListA[nCur], _T("")));
}
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%d"), db_get_dw(hContact, sProto.c_str(), "UIN", 0));
- ReplaceAll( output, _T("%UIN%"), szTemp );
+ ReplaceAll( output, _T("%UIN%"), szTemp);
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%d"), db_get_w(hContact, sProto.c_str(), "Age", 0));
- ReplaceAll( output, _T("%Age%"), szTemp );
+ ReplaceAll( output, _T("%Age%"), szTemp);
szTemp[0] = (TCHAR)db_get_b(hContact, sProto.c_str(), "Gender", 0);
szTemp[1] = 0;
- ReplaceAll( output, _T("%Gender%"), szTemp );
+ ReplaceAll( output, _T("%Gender%"), szTemp);
if ( !bWriteTextToFile( hFile, output.data(), bWriteUTF8Format, (int)output.size()))
{
- DisplayErrorDialog( LPGENT("Failed to write user details to file :\n"), sFilePath, NULL );
- CloseHandle( hFile );
+ DisplayErrorDialog( LPGENT("Failed to write user details to file :\n"), sFilePath, NULL);
+ CloseHandle( hFile);
return;
}
}
@@ -1141,14 +1141,14 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT,dbei.timestamp,(LPARAM)&dbtts);
- nIndent = (int)_tcslen( szTemp );
+ nIndent = (int)_tcslen( szTemp);
szTemp[nIndent++] = ' ';
// Write first part of line with name and timestamp
if ( !bWriteTextToFile( hFile, szTemp, bWriteUTF8Format, nIndent))
{
- DisplayErrorDialog( LPGENT("Failed to write timestamp and username to file :\n"), sFilePath, &dbei );
- CloseHandle( hFile );
+ DisplayErrorDialog( LPGENT("Failed to write timestamp and username to file :\n"), sFilePath, &dbei);
+ CloseHandle( hFile);
return;
}
}
@@ -1161,10 +1161,10 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
{
case EVENTTYPE_MESSAGE:
{
- TCHAR* msg = DbGetEventTextT( &dbei, CP_ACP );
+ TCHAR* msg = DbGetEventTextT(&dbei, CP_ACP);
if ( !bWriteIndentedToFile( hFile, nIndent, msg, bWriteUTF8Format))
{
- DisplayErrorDialog( LPGENT("Failed to write message to the file :\n"), sFilePath, &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write message to the file :\n"), sFilePath, &dbei);
}
mir_free(msg);
break;
@@ -1187,7 +1187,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
}
if ( !bWriteIndentedToFile( hFile, nIndent, pszData, bWriteUTF8Format))
{
- DisplayErrorDialog( _T("Failed to write message to the file :\n"), sFilePath, &dbei );
+ DisplayErrorDialog( _T("Failed to write message to the file :\n"), sFilePath, &dbei);
}
break;*/
}
@@ -1210,7 +1210,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
bool bWriteOk = false;
- int nLen = (int)strlen( pszData );
+ int nLen = (int)strlen( pszData);
if ((pszData - (char *)dbei.pBlob) + nLen < (int)dbei.cbBlob )
{
if (bWriteTextToFile( hFile, pszType, bWriteUTF8Format) &&
@@ -1223,7 +1223,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
}
else
{
- nLen = (int)strlen( pszData );
+ nLen = (int)strlen( pszData);
if ((pszData - (char *)dbei.pBlob) + nLen < (int)dbei.cbBlob )
{
if (bWriteNewLine( hFile, nIndent) &&
@@ -1238,7 +1238,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
}
if ( !bWriteOk )
- DisplayErrorDialog( LPGENT("Failed to write URL/File to the file :\n"), sFilePath, &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write URL/File to the file :\n"), sFilePath, &dbei);
break;
}
case EVENTTYPE_AUTHREQUEST:
@@ -1255,7 +1255,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
{
int n = mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Invalid Database event received. Type %d, size %d"), dbei.eventType, dbei.cbBlob);
if ( !bWriteTextToFile( hFile, szTemp, bWriteUTF8Format, n))
- DisplayErrorDialog( LPGENT("Failed to write Invalid Database event the file :\n"), sFilePath, &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write Invalid Database event the file :\n"), sFilePath, &dbei);
break;
}
@@ -1288,7 +1288,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
if (bWriteTextToFile( hFile, szTemp, bWriteUTF8Format, n))
{
char *pszEnd = (char *) (dbei.pBlob + dbei.cbSize);
- for( int n = 0 ; n < nStringCount && pszCurBlobPos < pszEnd ; n++ )
+ for (int n = 0 ; n < nStringCount && pszCurBlobPos < pszEnd ; n++ )
{
if (*pszCurBlobPos )
{
@@ -1298,7 +1298,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
{
break;
}
- pszCurBlobPos += strlen( pszCurBlobPos );
+ pszCurBlobPos += strlen( pszCurBlobPos);
}
pszCurBlobPos++;
}
@@ -1307,7 +1307,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
}
if ( !bWriteOk )
- DisplayErrorDialog( LPGENT("Failed to write AUTHREQUEST or ADDED to the file :\n"), sFilePath, &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write AUTHREQUEST or ADDED to the file :\n"), sFilePath, &dbei);
break;
}
@@ -1332,33 +1332,33 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
if (dbei.eventType == ICQEVENTTYPE_EMAILEXPRESS )
bWriteTextToFile( hFile, LPGENT("EmailExpress from:"), bWriteUTF8Format);
else
- bWriteTextToFile( hFile, LPGENT("WebPager from:"), bWriteUTF8Format );
+ bWriteTextToFile( hFile, LPGENT("WebPager from:"), bWriteUTF8Format);
- bWriteNewLine( hFile, nIndent );
+ bWriteNewLine( hFile, nIndent);
size_t nMsgLenght = strlen( pszStr) + 1;
if (nMsgLenght < dbei.cbBlob )
{
- size_t nFriendlyLen = strlen( &pszStr[nMsgLenght] );
- bWriteTextToFile( hFile, &pszStr[nMsgLenght], bWriteUTF8Format, (int)nFriendlyLen );
+ size_t nFriendlyLen = strlen(&pszStr[nMsgLenght]);
+ bWriteTextToFile( hFile, &pszStr[nMsgLenght], bWriteUTF8Format, (int)nFriendlyLen);
size_t nEmailOffset = nMsgLenght + nFriendlyLen + 1;
if (nEmailOffset < dbei.cbBlob )
{
- bWriteTextToFile( hFile, _T("<"), bWriteUTF8Format );
- size_t nEmailLen = strlen( &pszStr[nEmailOffset] );
- bWriteTextToFile( hFile, &pszStr[nEmailOffset], bWriteUTF8Format, (int)nEmailLen );
- bWriteTextToFile( hFile, _T(">"), bWriteUTF8Format );
+ bWriteTextToFile( hFile, _T("<"), bWriteUTF8Format);
+ size_t nEmailLen = strlen(&pszStr[nEmailOffset]);
+ bWriteTextToFile( hFile, &pszStr[nEmailOffset], bWriteUTF8Format, (int)nEmailLen);
+ bWriteTextToFile( hFile, _T(">"), bWriteUTF8Format);
}
}
else
{
- bWriteTextToFile( hFile, LPGENT("No from address"), bWriteUTF8Format );
+ bWriteTextToFile( hFile, LPGENT("No from address"), bWriteUTF8Format);
}
if ( !bWriteNewLine( hFile, nIndent) ||
! bWriteIndentedToFile( hFile, nIndent, pszStr, bWriteUTF8Format))
{
- DisplayErrorDialog( LPGENT("Failed to write EmailExpress to the file :\n"), sFilePath, &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write EmailExpress to the file :\n"), sFilePath, &dbei);
}
break;
}
@@ -1366,7 +1366,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
{
if ( !bWriteIndentedToFile( hFile, nIndent, (const char*)dbei.pBlob, bWriteUTF8Format))
{
- DisplayErrorDialog( LPGENT("Failed to write SMS to the file :\n"), sFilePath, &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write SMS to the file :\n"), sFilePath, &dbei);
}
break;
}
@@ -1375,7 +1375,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
int n = mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
if ( !bWriteTextToFile( hFile, szTemp, bWriteUTF8Format, n))
{
- DisplayErrorDialog( LPGENT("Failed to write Unknown event to the file :\n"), sFilePath, &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write Unknown event to the file :\n"), sFilePath, &dbei);
}
break;
}
@@ -1384,11 +1384,11 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
else
{
int n = mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
- bWriteTextToFile( hFile, szTemp, bWriteUTF8Format, n );
+ bWriteTextToFile( hFile, szTemp, bWriteUTF8Format, n);
}
- bWriteToFile( hFile, bAppendNewLine ? "\r\n\r\n" : "\r\n" );
+ bWriteToFile( hFile, bAppendNewLine ? "\r\n\r\n" : "\r\n");
- CloseHandle( hFile );
+ CloseHandle( hFile);
UpdateFileViews( sFilePath.c_str());
}
@@ -1418,7 +1418,7 @@ int nExportEvent(WPARAM wparam,LPARAM lparam)
int nSize = db_event_getBlobSize(hDbEvent);
if (nSize > 0) {
dbei.cbBlob = nSize;
- dbei.pBlob = (PBYTE)malloc(dbei.cbBlob + 2 );
+ dbei.pBlob = (PBYTE)malloc(dbei.cbBlob + 2);
dbei.pBlob[dbei.cbBlob] = 0;
dbei.pBlob[dbei.cbBlob+1] = 0;
// Double null terminate, this shut pervent most errors
@@ -1430,7 +1430,7 @@ int nExportEvent(WPARAM wparam,LPARAM lparam)
char szTemp[500];
mir_snprintf(szTemp, SIZEOF(szTemp), "DisableProt_%s", dbei.szModule);
if (db_get_b(NULL,MODULE,szTemp,1))
- ExportDBEventInfo( hContact, dbei );
+ ExportDBEventInfo( hContact, dbei);
}
}
if (dbei.pBlob )
@@ -1441,13 +1441,13 @@ int nExportEvent(WPARAM wparam,LPARAM lparam)
#ifdef _UNICODE
bool bWriteIndentedToFile( HANDLE hFile, int nIndent, const char *pszSrc, bool bUtf8File )
{
- int nLen = (int)strlen( pszSrc );
+ int nLen = (int)strlen( pszSrc);
wchar_t * pszWstr = new wchar_t[nLen+1];
bool bRet = false;
if (MultiByteToWideChar(CP_ACP, 0, pszSrc, nLen, pszWstr, nLen) == nLen )
{
pszWstr[nLen] = NULL;
- bRet = bWriteIndentedToFile( hFile, nIndent, pszWstr, bUtf8File );
+ bRet = bWriteIndentedToFile( hFile, nIndent, pszWstr, bUtf8File);
}
return bRet;
}
@@ -1490,9 +1490,9 @@ bool bWriteIndentedToFile( HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool
// then we will look for a ? and so on.
const TCHAR ac[] = { _T(' '),_T('?'),_T('-'),_T('.'),_T(',') };
- for( int y = 0 ; y < sizeof( ac) ; y++)
+ for (int y = 0 ; y < sizeof( ac) ; y++)
{
- for( int n = nLineLen ; n > 0 ; n-- )
+ for (int n = nLineLen ; n > 0 ; n-- )
{
if (pszSrc[n] == ac[y] )
{
@@ -1505,7 +1505,7 @@ bool bWriteIndentedToFile( HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool
}
nLineLen++;
}
- while( pszSrc[nLineLen] );
+ while( pszSrc[nLineLen]);
// trim away traling spaces !!
if (nLineLen > 0 )
@@ -1532,7 +1532,7 @@ SuperBreak:
// Programming error writing UTF8 string to ansi file
if ( !bUtf8File )
{
- MessageBox( NULL, _T("Programming error writing UTF8 string to ansi file") ,MSG_BOX_TITEL,MB_OK );
+ MessageBox(NULL, _T("Programming error writing UTF8 string to ansi file") ,MSG_BOX_TITEL,MB_OK);
// bUtf8File must be true here
}
if (!bWriteToFile( hFile, pszSrc, nLineLen))
@@ -1593,7 +1593,7 @@ int nContactDeleted(WPARAM wparam,LPARAM /*lparam*/)
if (enDeleteAction == eDANothing )
return 0;
- tstring sFilePath = GetFilePathFromUser( hContact );
+ tstring sFilePath = GetFilePathFromUser( hContact);
// Test if there is another user using this file
for(HANDLE hOtherContact = db_find_first();hOtherContact;hOtherContact = db_find_next(hOtherContact))
@@ -1607,11 +1607,11 @@ int nContactDeleted(WPARAM wparam,LPARAM /*lparam*/)
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
- NULL );
+ NULL);
if (hPrevFile != INVALID_HANDLE_VALUE )
{
- CloseHandle( hPrevFile );
+ CloseHandle( hPrevFile);
TCHAR szTemp[500];
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s\r\n%s"),
@@ -1627,7 +1627,7 @@ int nContactDeleted(WPARAM wparam,LPARAM /*lparam*/)
TranslateT("Failed to delete the file"),
sFilePath.c_str());
- DisplayLastError( szTemp );
+ DisplayLastError( szTemp);
}
}
}
@@ -1649,19 +1649,19 @@ int nContactDeleted(WPARAM wparam,LPARAM /*lparam*/)
void SaveSettings()
{
- db_set_w( NULL, MODULE, "MaxLineWidth", (WORD) nMaxLineWidth );
- db_set_ts( NULL, MODULE, "ExportDir", sExportDir.c_str());
- db_set_ts( NULL, MODULE, "DefaultFile", sDefaultFile.c_str());
- db_set_ts( NULL, MODULE, "TimeFormat", sTimeFormat.c_str());
-
- db_set_ts( NULL, MODULE, "FileViewerPrg", sFileViewerPrg.c_str());
- db_set_b( NULL, MODULE, "UseInternalViewer", bUseInternalViewer());
- db_set_b( NULL, MODULE, "ReplaceHistory", bReplaceHistory );
- db_set_b( NULL, MODULE, "AppendNewLine", bAppendNewLine );
- db_set_b( NULL, MODULE, "UseUtf8InNewFiles", bUseUtf8InNewFiles );
- db_set_b( NULL, MODULE, "UseLessAndGreaterInExport", bUseLessAndGreaterInExport );
-
- db_set_b( NULL, MODULE, "RenameAction", (BYTE)enRenameAction );
- db_set_b( NULL, MODULE, "DeleteAction", (BYTE)enDeleteAction );
+ db_set_w(NULL, MODULE, "MaxLineWidth", (WORD) nMaxLineWidth);
+ db_set_ts(NULL, MODULE, "ExportDir", sExportDir.c_str());
+ db_set_ts(NULL, MODULE, "DefaultFile", sDefaultFile.c_str());
+ db_set_ts(NULL, MODULE, "TimeFormat", sTimeFormat.c_str());
+
+ db_set_ts(NULL, MODULE, "FileViewerPrg", sFileViewerPrg.c_str());
+ db_set_b(NULL, MODULE, "UseInternalViewer", bUseInternalViewer());
+ db_set_b(NULL, MODULE, "ReplaceHistory", bReplaceHistory);
+ db_set_b(NULL, MODULE, "AppendNewLine", bAppendNewLine);
+ db_set_b(NULL, MODULE, "UseUtf8InNewFiles", bUseUtf8InNewFiles);
+ db_set_b(NULL, MODULE, "UseLessAndGreaterInExport", bUseLessAndGreaterInExport);
+
+ db_set_b(NULL, MODULE, "RenameAction", (BYTE)enRenameAction);
+ db_set_b(NULL, MODULE, "DeleteAction", (BYTE)enDeleteAction);
}
diff --git a/plugins/Msg_Export/src/utils.h b/plugins/Msg_Export/src/utils.h
index 6264ad2a62..276f85c8be 100755
--- a/plugins/Msg_Export/src/utils.h
+++ b/plugins/Msg_Export/src/utils.h
@@ -51,7 +51,7 @@ tstring sGetErrorString(DWORD dwError);
tstring sGetErrorString();
void DisplayLastError(const TCHAR *pszError);
-TCHAR *CheckedTranslate( const TCHAR *szEng, int nFormatCount = -1 );
+TCHAR *CheckedTranslate( const TCHAR *szEng, int nFormatCount = -1);
void SaveSettings();
void ShowDebugInfo();
@@ -61,8 +61,8 @@ int nContactDeleted(WPARAM wparam,LPARAM lparam);
const TCHAR *NickFromHandle(HANDLE hContact);
-tstring __inline _DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting, const TCHAR *pszError );
-string __inline _DBGetStringA(HANDLE hContact,const char *szModule,const char *szSetting, const char *pszError );
+tstring __inline _DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting, const TCHAR *pszError);
+string __inline _DBGetStringA(HANDLE hContact,const char *szModule,const char *szSetting, const char *pszError);
void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew);
void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew);
@@ -70,16 +70,16 @@ void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew);
void UpdateFileToColWidth();
bool bReadMirandaDirAndPath();
-tstring GetFilePathFromUser( HANDLE hContact );
+tstring GetFilePathFromUser( HANDLE hContact);
-void ReplaceDefines( HANDLE hContact, tstring & sTarget );
-void ReplaceTimeVariables( tstring &sRet );
+void ReplaceDefines( HANDLE hContact, tstring & sTarget);
+void ReplaceTimeVariables( tstring &sRet);
-bool bCreatePathToFile( tstring sFilePath );
+bool bCreatePathToFile( tstring sFilePath);
-bool bWriteIndentedToFile( HANDLE hFile, int nIndent, const char *pszSrc, bool bUtf8File );
-bool bWriteIndentedToFile( HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool bUtf8File );
-bool bWriteNewLine( HANDLE hFile, DWORD dwIndent );
-bool bIsUtf8Header( BYTE * pucByteOrder );
+bool bWriteIndentedToFile( HANDLE hFile, int nIndent, const char *pszSrc, bool bUtf8File);
+bool bWriteIndentedToFile( HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool bUtf8File);
+bool bWriteNewLine( HANDLE hFile, DWORD dwIndent);
+bool bIsUtf8Header( BYTE * pucByteOrder);
#endif
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index 2891cb5b90..7fd80940b1 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -115,25 +115,19 @@ void LoadLogIcons(void)
hIcons[ICON_STATUS4] = LoadIconEx(IDI_STATUS4, "status4", 16, 16);
hIcons[ICON_STATUS0] = LoadIconEx(IDI_STATUS0, "status0", 16, 16);
hIcons[ICON_STATUS5] = LoadIconEx(IDI_STATUS5, "status5", 16, 16);
-
- return;
}
void LoadIcons(void)
{
- int i;
-
- for (i=0; i < 20; i++)
+ for (int i=0; i < 20; i++)
hIcons[i] = NULL;
LoadLogIcons();
g_Settings.hIconOverlay = LoadIconEx(IDI_OVERLAY, "overlay", 16, 16);
LoadMsgLogBitmaps();
- return ;
}
void FreeIcons(void)
{
FreeMsgLogBitmaps();
- return;
}