From 90ac4c689e1322b48f6ca53a0c8fff81daf73c9c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Apr 2023 18:50:46 +0300 Subject: code cleaning --- src/core/stdfile/src/filerecvdlg.cpp | 5 ++--- src/core/stdmsg/src/msglog.cpp | 5 ++--- src/core/stduihist/src/history.cpp | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src/core') diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 760633e225..29e0a7f53c 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -243,9 +243,8 @@ public: db_event_markRead(dat->hContact, dat->hDbEvent); - DB::EventInfo dbei; - dbei.cbBlob = -1; - if (db_event_get(dat->hDbEvent, &dbei)) + DB::EventInfo dbei(dat->hDbEvent); + if (!dbei) return false; dat->fs = m_lParam ? (HANDLE)m_lParam : (HANDLE)*(PDWORD)dbei.pBlob; diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 2b501c487b..c20b597beb 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -200,9 +200,8 @@ bool DbEventIsShown(const DBEVENTINFO *dbei) static bool CreateRTFFromDbEvent(LogStreamData *dat) { - DB::EventInfo dbei; - dbei.cbBlob = -1; - if (db_event_get(dat->hDbEvent, &dbei)) + DB::EventInfo dbei(dat->hDbEvent); + if (!dbei) return false; if (!DbEventIsShown(&dbei)) diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index ae92875fab..2e59abcf9e 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -272,9 +272,8 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEHISTORY), TRUE); MEVENT hDbEvent = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0); - DB::EventInfo dbei; - dbei.cbBlob = -1; - if (!db_event_get(hDbEvent, &dbei)) { + DB::EventInfo dbei(hDbEvent); + if (dbei) { ptrW wszDescr(DbEvent_GetTextW(&dbei, CP_ACP)); if (wszDescr) SetDlgItemText(hwndDlg, IDC_EDIT, wszDescr); -- cgit v1.2.3