summaryrefslogtreecommitdiff
path: root/plugins/HistoryLinkListPlus
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/HistoryLinkListPlus')
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist.cpp24
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist_dlg.cpp52
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist_fct.cpp64
3 files changed, 70 insertions, 70 deletions
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp
index b64547ed7c..3c8a94d11a 100644
--- a/plugins/HistoryLinkListPlus/src/linklist.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist.cpp
@@ -67,12 +67,12 @@ extern "C" __declspec(dllexport) int Load(void)
wndclass.lpfnWndProc = ProgressBarDlg;
wndclass.hInstance = hInst;
wndclass.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON));
- wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wndclass.lpszClassName = L"Progressbar";
RegisterClass(&wndclass);
- splitCursor = LoadCursor(NULL, IDC_SIZENS);
+ splitCursor = LoadCursor(nullptr, IDC_SIZENS);
HookEvent(ME_OPT_INITIALISE, InitOptionsDlg);
HookEvent(ME_DB_EVENT_ADDED, DBUpdate);
@@ -108,7 +108,7 @@ int InitOptionsDlg(WPARAM wParam, LPARAM)
static INT_PTR LinkList_Main(WPARAM hContact, LPARAM)
{
HWND hWnd = WindowList_Find(hWindowList, hContact);
- if (hWnd != NULL) {
+ if (hWnd != nullptr) {
SetForegroundWindow(hWnd);
SetFocus(hWnd);
int len = GetWindowTextLength(GetDlgItem(hWnd, IDC_MAIN));
@@ -118,7 +118,7 @@ static INT_PTR LinkList_Main(WPARAM hContact, LPARAM)
MEVENT hEvent = db_event_first(hContact);
if (hEvent == NULL) {
- MessageBox(NULL, TXT_EMPTYHISTORY, TXT_PLUGINNAME, (MB_OK | MB_ICONINFORMATION));
+ MessageBox(nullptr, TXT_EMPTYHISTORY, TXT_PLUGINNAME, (MB_OK | MB_ICONINFORMATION));
return 0;
}
@@ -132,10 +132,10 @@ static INT_PTR LinkList_Main(WPARAM hContact, LPARAM)
RECT DesktopRect;
GetWindowRect(GetDesktopWindow(), &DesktopRect);
- HWND hWndProgress = CreateWindow(L"Progressbar", TranslateT("Processing history..."), WS_OVERLAPPED, CW_USEDEFAULT, CW_USEDEFAULT, 350, 45, NULL, NULL, hInst, NULL);
- if (hWndProgress == NULL) {
+ HWND hWndProgress = CreateWindow(L"Progressbar", TranslateT("Processing history..."), WS_OVERLAPPED, CW_USEDEFAULT, CW_USEDEFAULT, 350, 45, nullptr, nullptr, hInst, nullptr);
+ if (hWndProgress == nullptr) {
mir_free(dbe.pBlob);
- MessageBox(NULL, TranslateT("Could not create window!"), TranslateT("Error"), MB_OK | MB_ICONEXCLAMATION );
+ MessageBox(nullptr, TranslateT("Could not create window!"), TranslateT("Error"), MB_OK | MB_ICONEXCLAMATION );
return -1;
}
SetWindowPos(hWndProgress, HWND_TOP, (int)((DesktopRect.right / 2) - 175), (int)((DesktopRect.bottom / 2) - 22), 0, 0, SWP_NOSIZE);
@@ -151,7 +151,7 @@ static INT_PTR LinkList_Main(WPARAM hContact, LPARAM)
if (ExtractURI(&dbe, hEvent, listStart) < 0) {
mir_free(dbe.pBlob);
RemoveList(listStart);
- MessageBox(NULL, TranslateT("Could not allocate memory!"), TranslateT("Error"), MB_OK | MB_ICONEXCLAMATION);
+ MessageBox(nullptr, TranslateT("Could not allocate memory!"), TranslateT("Error"), MB_OK | MB_ICONEXCLAMATION);
return -1;
}
}
@@ -172,7 +172,7 @@ static INT_PTR LinkList_Main(WPARAM hContact, LPARAM)
SendMessage(hWndProgress, WM_CLOSE, 0, 0);
if (ListCount(listStart) <= 0) {
RemoveList(listStart);
- MessageBox(NULL, TXT_NOLINKINHISTORY, TXT_PLUGINNAME, (MB_OK | MB_ICONINFORMATION));
+ MessageBox(nullptr, TXT_NOLINKINHISTORY, TXT_PLUGINNAME, (MB_OK | MB_ICONINFORMATION));
return 0;
}
@@ -183,11 +183,11 @@ static INT_PTR LinkList_Main(WPARAM hContact, LPARAM)
DlgParam->chrg.cpMax = -1;
DlgParam->chrg.cpMin = -1;
- HWND hWndMain = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MAIN_DLG), NULL, MainDlgProc, (LPARAM)DlgParam);
- if (hWndMain == NULL) {
+ HWND hWndMain = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MAIN_DLG), nullptr, MainDlgProc, (LPARAM)DlgParam);
+ if (hWndMain == nullptr) {
mir_free(DlgParam);
RemoveList(listStart);
- MessageBox(NULL, TranslateT("Could not create window!"), TranslateT("Error"), (MB_OK | MB_ICONEXCLAMATION));
+ MessageBox(nullptr, TranslateT("Could not create window!"), TranslateT("Error"), (MB_OK | MB_ICONEXCLAMATION));
return -1;
}
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
index 563f2bc406..e039b792c8 100644
--- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
@@ -88,7 +88,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
// This is used in srmm... and I think he knew what he did... :)
SendDlgItemMessage(hDlg, IDC_MAIN, EM_LIMITTEXT, (WPARAM)-1, 0);
- WriteLinkList(hDlg, WLL_ALL, (LISTELEMENT*)DlgParam->listStart, NULL, 0);
+ WriteLinkList(hDlg, WLL_ALL, (LISTELEMENT*)DlgParam->listStart, nullptr, 0);
return TRUE;
// open browser an load url if link is pressed
@@ -114,12 +114,12 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case WM_LBUTTONUP:
link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 2) * sizeof(wchar_t));
- if (link == NULL)
+ if (link == nullptr)
break;
SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)&pENLink->chrg);
SendDlgItemMessage(hDlg, IDC_MAIN, EM_GETSELTEXT, 0, (LPARAM)link);
- if (wcsstr(link, L"mailto:") != NULL)
- ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL);
+ if (wcsstr(link, L"mailto:") != nullptr)
+ ShellExecute(HWND_TOP, nullptr, link, nullptr, nullptr, SW_SHOWNORMAL);
else {
bool openNewWindow = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, 0xFF) != 0xFF;
Utils_OpenUrlW(link, openNewWindow);
@@ -138,7 +138,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
EnableMenuItem(hSubMenu, IDM_SHOWMESSAGE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
TranslateMenu(hSubMenu);
link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 4) * sizeof(wchar_t));
- if (link == NULL)
+ if (link == nullptr)
break;
SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)&pENLink->chrg);
SendDlgItemMessage(hDlg, IDC_MAIN, EM_GETSELTEXT, 0, (LPARAM)link);
@@ -147,17 +147,17 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
pt.y = (short)HIWORD(pENLink->lParam);
ClientToScreen(((NMHDR*)lParam)->hwndFrom, &pt);
- switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hDlg, NULL)) {
+ switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hDlg, nullptr)) {
case IDM_LINK_OPEN:
- if (wcsstr(link, L"mailto:") != NULL)
- ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL);
+ if (wcsstr(link, L"mailto:") != nullptr)
+ ShellExecute(HWND_TOP, nullptr, link, nullptr, nullptr, SW_SHOWNORMAL);
else
Utils_OpenUrlW(link, false);
break;
case IDM_LINK_OPENNEW:
- if (wcsstr(link, L"mailto:") != NULL)
- ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL);
+ if (wcsstr(link, L"mailto:") != nullptr)
+ ShellExecute(HWND_TOP, nullptr, link, nullptr, nullptr, SW_SHOWNORMAL);
else
Utils_OpenUrlW(link);
break;
@@ -191,7 +191,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
listMenu = GetMenu(hDlg);
switch (wParam) {
case IDM_SEARCH: // open Search Box
- if (DlgParam != 0) {
+ if (DlgParam != nullptr) {
HWND hWndSearchDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEARCH_DLG), hDlg, SearchDlgProc, (LPARAM)DlgParam);
EnableMenuItem(listMenu, IDM_SEARCH, (MF_BYCOMMAND | MF_DISABLED | MF_GRAYED));
ShowWindow(hWndSearchDlg, SW_SHOW);
@@ -203,7 +203,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
GetFilterText(listMenu, filter, _countof(filter));
SetDlgItemText(hDlg, IDC_STATUS, filter);
SetDlgItemText(hDlg, IDC_MAIN, L"");
- WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, NULL, 0);
+ WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, nullptr, 0);
break;
case IDM_SAVE: // save button
@@ -224,12 +224,12 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
SetDlgItemText(hDlg, IDC_MAIN, L"");
if (GetMenuState(listMenu, IDM_DIR_IN, MF_BYCOMMAND) == MF_CHECKED) {
CheckMenuItem(listMenu, IDM_DIR_IN, MF_UNCHECKED);
- WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, NULL, 0);
+ WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, nullptr, 0);
}
else {
CheckMenuItem(listMenu, IDM_DIR_IN, MF_CHECKED);
CheckMenuItem(listMenu, IDM_DIR_OUT, MF_UNCHECKED);
- WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, NULL, 0);
+ WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, nullptr, 0);
}
GetFilterText(GetMenu(hDlg), filter, _countof(filter));
SetDlgItemText(hDlg, IDC_STATUS, filter);
@@ -243,12 +243,12 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
SetDlgItemText(hDlg, IDC_MAIN, L"");
if (GetMenuState(listMenu, IDM_DIR_OUT, MF_BYCOMMAND) == MF_CHECKED) {
CheckMenuItem(listMenu, IDM_DIR_OUT, MF_UNCHECKED);
- WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, NULL, 0);
+ WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, nullptr, 0);
}
else {
CheckMenuItem(listMenu, IDM_DIR_OUT, MF_CHECKED);
CheckMenuItem(listMenu, IDM_DIR_IN, MF_UNCHECKED);
- WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, NULL, 0);
+ WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, nullptr, 0);
}
GetFilterText(listMenu, filter, _countof(filter));
SetDlgItemText(hDlg, IDC_STATUS, filter);
@@ -263,12 +263,12 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
SetDlgItemText(hDlg, IDC_MAIN, L"");
if (GetMenuState(listMenu, IDM_TYPE_WEB, MF_BYCOMMAND) == MF_CHECKED) {
CheckMenuItem(listMenu, IDM_TYPE_WEB, MF_UNCHECKED);
- WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, NULL, 0);
+ WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, nullptr, 0);
}
else {
CheckMenuItem(listMenu, IDM_TYPE_WEB, MF_CHECKED);
CheckMenuItem(listMenu, IDM_TYPE_MAIL, MF_UNCHECKED);
- WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, NULL, 0);
+ WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, nullptr, 0);
}
GetFilterText(listMenu, filter, _countof(filter));
SetDlgItemText(hDlg, IDC_STATUS, filter);
@@ -280,12 +280,12 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
SetDlgItemText(hDlg, IDC_MAIN, L"");
if (GetMenuState(listMenu, IDM_TYPE_MAIL, MF_BYCOMMAND) == MF_CHECKED) {
CheckMenuItem(listMenu, IDM_TYPE_MAIL, MF_UNCHECKED);
- WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, NULL, 0);
+ WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, nullptr, 0);
}
else {
CheckMenuItem(listMenu, IDM_TYPE_MAIL, MF_CHECKED);
CheckMenuItem(listMenu, IDM_TYPE_WEB, MF_UNCHECKED);
- WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, NULL, 0);
+ WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, nullptr, 0);
}
GetFilterText(listMenu, filter, _countof(filter));
SetDlgItemText(hDlg, IDC_STATUS, filter);
@@ -311,8 +311,8 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_SIZE:
Utils_ResizeDialog(hDlg, hInst, MAKEINTRESOURCEA(IDD_MAIN_DLG), LinklistResizer, (LPARAM)DlgParam);
// To get some scrollbars if needed...
- RedrawWindow(GetDlgItem(hDlg, IDC_MAIN), NULL, NULL, RDW_INVALIDATE);
- RedrawWindow(GetDlgItem(hDlg, IDC_MESSAGE), NULL, NULL, RDW_INVALIDATE);
+ RedrawWindow(GetDlgItem(hDlg, IDC_MAIN), nullptr, nullptr, RDW_INVALIDATE);
+ RedrawWindow(GetDlgItem(hDlg, IDC_MESSAGE), nullptr, nullptr, RDW_INVALIDATE);
break;
case DM_LINKSPLITTER:
@@ -341,7 +341,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case WM_DESTROY:
- if (DlgParam != NULL) {
+ if (DlgParam != nullptr) {
hContact = ((db_get_b(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, 0) == 0) ? NULL : DlgParam->hContact);
Utils_SaveWindowPosition(hDlg, hContact, LINKLIST_MODULE, "Linklist");
db_set_dw(NULL, LINKLIST_MODULE, LINKLIST_SPLITPOS, DlgParam->splitterPosNew);
@@ -386,7 +386,7 @@ INT_PTR CALLBACK SearchDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
wchar_t filter[FILTERTEXT];
HWND hListDlg = WindowList_Find(hWindowList, DlgParam->hContact);
- if (hListDlg == NULL)
+ if (hListDlg == nullptr)
break;
SetDlgItemText(hListDlg, IDC_MAIN, L"");
@@ -587,7 +587,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
else {
int mCol = GetMirandaColour(&colourSet);
if (mCol == 1) {
- MessageBox(NULL, TXT_NOSETTING, TXT_ERROR, MB_OK | MB_ICONEXCLAMATION);
+ MessageBox(nullptr, TXT_NOSETTING, TXT_ERROR, MB_OK | MB_ICONEXCLAMATION);
CheckDlgButton(hDlg, IDC_CHECK1, BST_UNCHECKED);
break;
}
@@ -733,7 +733,7 @@ LRESULT CALLBACK ProgressBarDlg(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
switch (message) {
case WM_CREATE:
- hwndPB = CreateWindowEx(0, PROGRESS_CLASS, L"", WS_CHILD | WS_VISIBLE, 0, 2, 343, 17, hwnd, NULL, hInst, NULL);
+ hwndPB = CreateWindowEx(0, PROGRESS_CLASS, L"", WS_CHILD | WS_VISIBLE, 0, 2, 343, 17, hwnd, nullptr, hInst, nullptr);
SendMessage(hwndPB, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
return 0;
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
index 977b934ccd..21ad54c0a2 100644
--- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
@@ -51,7 +51,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
wchar_t templink[LINK_MAX + 1];
wchar_t dbdate[DATE_SIZE + TIME_SIZE];
- if (listStart == NULL)
+ if (listStart == nullptr)
return -1;
link[0] = 0;
@@ -59,7 +59,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
time[0] = 0;
msg = DbEvent_GetTextW(dbei, CP_ACP);
- if (msg == NULL)
+ if (msg == nullptr)
return 0;
for (i = 0; msg[i]; ) {
@@ -104,7 +104,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
wordlen = (i - wordStart + 1);
word = (LPTSTR)mir_alloc(wordlen * sizeof(wchar_t));
wordsearch = (LPTSTR)mir_alloc(wordlen * sizeof(wchar_t));
- if (word == NULL || wordsearch == NULL) {
+ if (word == nullptr || wordsearch == nullptr) {
mir_free(word);
mir_free(wordsearch);
linkFound = -1;
@@ -138,7 +138,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
}
if (isLink && wordlen <= LINK_MAX) {
- if (wcsstr(wordsearch, L"www.") != NULL && wcsstr(wordsearch, L"http://") == NULL && wcsstr(wordsearch, L"https://") == NULL) {
+ if (wcsstr(wordsearch, L"www.") != nullptr && wcsstr(wordsearch, L"http://") == nullptr && wcsstr(wordsearch, L"https://") == nullptr) {
wcsncpy_s(link, L"http://", LINK_MAX);
wcsncat_s(link, word, LINK_MAX);
} else {
@@ -147,7 +147,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
TimeZone_ToStringT(dbei->timestamp, L"d-t", dbdate, _countof(dbdate));
date_ptr = wcstok_s(dbdate, L"-", &tok_ctx);
- time_ptr = wcstok_s(NULL, L"-", &tok_ctx);
+ time_ptr = wcstok_s(nullptr, L"-", &tok_ctx);
wcsncpy_s(date, date_ptr, _TRUNCATE);
wcsncpy_s(time, time_ptr, _TRUNCATE);
@@ -156,7 +156,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
else
direction = DIRECTION_IN;
- if (type == LINK_MAIL && wcsstr(link, L"mailto:") == NULL) {
+ if (type == LINK_MAIL && wcsstr(link, L"mailto:") == nullptr) {
wcsncpy_s(templink, link, _TRUNCATE);
wcsncpy_s(link, L"mailto:", _TRUNCATE);
wcsncpy_s((link + _mstrlen(L"mailto:")), (_countof(link) - _mstrlen(L"mailto:")), templink, _TRUNCATE);
@@ -164,7 +164,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
// Add new Element to list:
newElement = (LISTELEMENT*)mir_alloc(sizeof(LISTELEMENT));
- if (newElement == NULL) {
+ if (newElement == nullptr) {
linkFound = -1;
break;
}
@@ -177,7 +177,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
newElement->hEvent = hEvent;
actualElement = listStart;
- while (actualElement->nextElement != NULL) {
+ while (actualElement->nextElement != nullptr) {
actualElement = actualElement->nextElement;
}
@@ -200,11 +200,11 @@ int RemoveList(LISTELEMENT *listStart)
{
LISTELEMENT *actualElement, *tempElement;
- if ( listStart == NULL )
+ if ( listStart == nullptr )
return -1;
actualElement = listStart->nextElement;
- while ( actualElement != NULL )
+ while ( actualElement != nullptr )
{
tempElement = actualElement->nextElement;
mir_free(actualElement);
@@ -223,11 +223,11 @@ int ListCount(LISTELEMENT *listStart)
LISTELEMENT *actualElement;
int count = 0;
- if ( listStart == NULL )
+ if ( listStart == nullptr )
return -1;
actualElement = listStart->nextElement;
- while ( actualElement != NULL )
+ while ( actualElement != nullptr )
{
count++;
actualElement = actualElement->nextElement;
@@ -245,7 +245,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
{
CHARFORMAT2 cf;
PARAFORMAT2 pf;
- HWND hwndProgress = NULL;
+ HWND hwndProgress = nullptr;
RECT DesktopRect;
MYCOLOURSET colourSet;
wchar_t textLine[LINK_MAX + DIR_SIZE + TIME_SIZE + TYPE_SIZE + 6];
@@ -295,7 +295,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
pf.wAlignment = PFA_LEFT;
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETPARAFORMAT, FALSE, (LPARAM) &pf);
- if ( searchString != NULL )
+ if ( searchString != nullptr )
{
memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
@@ -342,17 +342,17 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
{
// Create Progressbar
GetWindowRect(GetDesktopWindow(), &DesktopRect);
- hwndProgress = CreateWindow(L"Progressbar", TranslateT("Processing list..."), WS_OVERLAPPED, CW_USEDEFAULT, CW_USEDEFAULT, 350, 45, NULL, NULL, hInst, NULL);
+ hwndProgress = CreateWindow(L"Progressbar", TranslateT("Processing list..."), WS_OVERLAPPED, CW_USEDEFAULT, CW_USEDEFAULT, 350, 45, nullptr, nullptr, hInst, nullptr);
SetWindowPos(hwndProgress,HWND_TOP,(int)(DesktopRect.right*0.5)-175,(int)(DesktopRect.bottom*0.5)-22,0,0,SWP_NOSIZE);
- if ( hwndProgress != NULL )
+ if ( hwndProgress != nullptr )
{
ShowWindow(hwndProgress, SW_SHOW);
SetForegroundWindow(hwndProgress);
}
}
- while ( actualElement != NULL )
+ while ( actualElement != nullptr )
{
filter1 = 0;
filter2 = 0;
@@ -371,7 +371,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
filter2 = 1;
- if ( searchString != NULL )
+ if ( searchString != nullptr )
{
if ( params & SLL_DEEP )
{
@@ -478,7 +478,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
if ((actCount < listCount) && (append == 0) && (options.showLine != 0))
DrawLine(hDlg, lineLen);
}
- else if ( searchString == NULL )
+ else if ( searchString == nullptr )
{
memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
@@ -519,7 +519,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B
SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETEVENTMASK, 0, (LPARAM)ENM_LINK);
SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_AUTOURLDETECT, TRUE, 0);
SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETBKGNDCOLOR, FALSE, BGColourSel);
- SetDlgItemText(hDlg, IDC_OPTIONS_RE, NULL);
+ SetDlgItemText(hDlg, IDC_OPTIONS_RE, nullptr);
memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
@@ -608,7 +608,7 @@ Write Message to window
void WriteMessage(HWND hDlg, LISTELEMENT *listStart, int actLinePos)
{
LISTELEMENT *actualElement = listStart->nextElement;
- while (actualElement != NULL) {
+ while (actualElement != nullptr) {
if (actualElement->linePos == actLinePos) {
MEVENT hEvent = actualElement->hEvent;
if (hEvent != NULL ) {
@@ -618,7 +618,7 @@ void WriteMessage(HWND hDlg, LISTELEMENT *listStart, int actLinePos)
db_event_get(hEvent, &dbe);
dbe.pBlob[dbe.cbBlob] = 0;
LPCTSTR msg = DbEvent_GetTextW(&dbe, CP_ACP);
- SetDlgItemText(hDlg, IDC_MESSAGE, NULL);
+ SetDlgItemText(hDlg, IDC_MESSAGE, nullptr);
SendDlgItemMessage(hDlg, IDC_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)msg);
mir_free((void*)msg);
mir_free(dbe.pBlob);
@@ -744,7 +744,7 @@ void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, siz
*realElementCount = 0;
actualElement = listStart->nextElement;
- while ( actualElement != NULL )
+ while ( actualElement != nullptr )
{
(*realElementCount)++;
@@ -762,7 +762,7 @@ void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, siz
else if ( (params & WLL_URL) && (actualElement->type == LINK_URL))
filter2 = 1;
- if ( searchString != NULL )
+ if ( searchString != nullptr )
{
if ( params & SLL_DEEP )
{
@@ -906,11 +906,11 @@ void ClearLinePos(LISTELEMENT *listStart)
{
LISTELEMENT *actualElement;
- if ( listStart == NULL )
+ if ( listStart == nullptr )
return;
actualElement = listStart->nextElement;
- while ( actualElement != NULL )
+ while ( actualElement != nullptr )
{
actualElement->linePos = -1;
actualElement = actualElement->nextElement;
@@ -922,11 +922,11 @@ int GetLastLinePos(LISTELEMENT *listStart)
LISTELEMENT *actualElement;
int maxPos = -1;
- if ( listStart == NULL )
+ if ( listStart == nullptr )
return -1;
actualElement = listStart->nextElement;
- while ( actualElement != NULL )
+ while ( actualElement != nullptr )
{
if ( actualElement->linePos > maxPos )
maxPos = actualElement->linePos;
@@ -1187,7 +1187,7 @@ int DBUpdate(WPARAM wParam, LPARAM hEvent)
// Call function to find URIs
linkNum = ExtractURI(&dbe, hEvent, DlgParam->listStart);
if ( linkNum > 0 )
- WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, NULL, linkNum);
+ WriteLinkList(hDlg, GetFlags(listMenu), DlgParam->listStart, nullptr, linkNum);
}
mir_free(dbe.pBlob);
}
@@ -1256,8 +1256,8 @@ BOOL SaveEditAsStream( HWND hDlg )
if ( ! GetSaveFileName( &ofn ))
return FALSE;
// Create the specified file
- hFile = CreateFile( szFilename, GENERIC_WRITE, 0, NULL,
- CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
+ hFile = CreateFile( szFilename, GENERIC_WRITE, 0, nullptr,
+ CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr );
// Quit if file creation fails
if ( hFile == INVALID_HANDLE_VALUE )
return FALSE;
@@ -1281,7 +1281,7 @@ DWORD CALLBACK RTFSaveStreamCallback(DWORD_PTR dwCookie, LPBYTE lpBuffer, LONG l
// Initialize "amount read" variable for WriteFile()
*plRead = 0;
// dwCookie is the file handle
- WriteFile( (HANDLE)dwCookie, lpBuffer, lSize, (LPDWORD)plRead, NULL );
+ WriteFile( (HANDLE)dwCookie, lpBuffer, lSize, (LPDWORD)plRead, nullptr );
// Continue, if needed
return 0;
}