From 90ac4c689e1322b48f6ca53a0c8fff81daf73c9c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Apr 2023 18:50:46 +0300 Subject: code cleaning --- plugins/HistoryLinkListPlus/src/linklist.cpp | 5 +---- plugins/HistoryLinkListPlus/src/linklist_fct.cpp | 19 ++++++------------- 2 files changed, 7 insertions(+), 17 deletions(-) (limited to 'plugins/HistoryLinkListPlus/src') diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp index 016724e8fe..69cd060b33 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist.cpp @@ -90,10 +90,7 @@ static INT_PTR LinkList_Main(WPARAM hContact, LPARAM) memset(listStart, 0, sizeof(LISTELEMENT)); do { - DB::EventInfo dbe; - dbe.cbBlob = -1; - db_event_get(hEvent, &dbe); - + DB::EventInfo dbe(hEvent); if (dbe.eventType == EVENTTYPE_MESSAGE) { // Call function to find URIs if (ExtractURI(&dbe, hEvent, listStart) < 0) { diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index 406ce734be..4b4736ea53 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -380,9 +380,7 @@ void WriteLinkList(HWND hDlg, uint8_t params, LISTELEMENT *listStart, LPCTSTR se // Perform deep scan if (actualElement->hEvent != NULL) { - DB::EventInfo dbe; - dbe.cbBlob = -1; - db_event_get(actualElement->hEvent, &dbe); + DB::EventInfo dbe(actualElement->hEvent); ptrW msg(DbEvent_GetTextW(&dbe, CP_ACP)); if (wcsstr(msg, searchString)) @@ -610,11 +608,9 @@ void WriteMessage(HWND hDlg, LISTELEMENT *listStart, int actLinePos) if (actualElement->linePos == actLinePos) { MEVENT hEvent = actualElement->hEvent; if (hEvent != NULL) { - DB::EventInfo dbe; - dbe.cbBlob = -1; - db_event_get(hEvent, &dbe); - SetDlgItemTextW(hDlg, IDC_MESSAGE, L""); + + DB::EventInfo dbe(hEvent); SendDlgItemMessage(hDlg, IDC_MESSAGE, EM_REPLACESEL, FALSE, ptrW(DbEvent_GetTextW(&dbe, CP_ACP))); } break; @@ -763,9 +759,7 @@ void GetListInfo(uint8_t params, LISTELEMENT *listStart, LPCTSTR searchString, s // Perform deep scan if (actualElement->hEvent != NULL) { - DB::EventInfo dbe; - dbe.cbBlob = -1; - db_event_get(actualElement->hEvent, &dbe); + DB::EventInfo dbe(actualElement->hEvent); if (wcsstr((LPTSTR)dbe.pBlob, searchString)) filter3 = 1; @@ -1165,9 +1159,8 @@ int DBUpdate(WPARAM wParam, LPARAM hEvent) return 0; if (hDlg) { - DB::EventInfo dbe; - dbe.cbBlob = -1; - if (db_event_get(hEvent, &dbe)) + DB::EventInfo dbe(hEvent); + if (!dbe) return 0; if (dbe.eventType == EVENTTYPE_MESSAGE) { -- cgit v1.2.3