From c7d065645853b2e614e8557fa01057efaf5e6517 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 13 May 2024 14:23:13 +0300 Subject: DbEvent_GetTextA: unused function removed --- plugins/AutoShutdown/src/watcher.cpp | 2 +- plugins/BasicHistory/src/EventList.cpp | 2 +- plugins/Boltun/src/boltun.cpp | 2 +- plugins/CmdLine/src/mimcmd_handlers.cpp | 2 +- plugins/HistoryLinkListPlus/src/linklist_fct.cpp | 6 +++--- plugins/HistoryPlusPlus/hpp_events.pas | 4 ++-- plugins/IEHistory/src/utils.cpp | 2 +- plugins/IEView/src/HTMLBuilder.cpp | 6 +++--- plugins/Import/src/textjson.cpp | 2 +- plugins/Msg_Export/src/export.cpp | 2 +- plugins/NewEventNotify/src/popup.cpp | 11 +++-------- plugins/NewStory/src/history_array.cpp | 8 ++++---- plugins/NewStory/src/history_dlg.cpp | 2 +- plugins/Scriver/src/msgdialog.cpp | 2 +- plugins/Scriver/src/msglog.cpp | 2 +- plugins/TabSRMM/src/msgdialog.cpp | 2 +- plugins/TabSRMM/src/msglog.cpp | 6 +++--- plugins/TipperYM/src/subst.cpp | 2 +- plugins/Variables/src/parse_miranda.cpp | 2 +- plugins/wbOSD/src/events.cpp | 4 ++-- 20 files changed, 33 insertions(+), 38 deletions(-) (limited to 'plugins') diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index d290a65c78..57ee51f9f4 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -72,7 +72,7 @@ static int MsgEventAdded(WPARAM, LPARAM hDbEvent) DBVARIANT dbv; if (!g_plugin.getWString("Message", &dbv)) { ltrimw(rtrimw(dbv.pwszVal)); - ptrW wszMsg(DbEvent_GetTextW(&dbei)); + ptrW wszMsg(dbei.getText()); if (wszMsg != nullptr && wcsstr(wszMsg, dbv.pwszVal) != nullptr) ShutdownAndStopWatcher(); /* msg with specified text recvd */ mir_free(dbv.pwszVal); /* does NULL check */ diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 2be9c30110..7a5ba2f3b0 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -443,7 +443,7 @@ std::wstring HistoryEventList::GetContactId() static void GetMessageDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf) { - wchar_t *msg = DbEvent_GetTextW(dbei); + wchar_t *msg = DbEvent_GetText(dbei); wcsncpy_s(buf, cbBuf, msg ? msg : TranslateT("Invalid message"), _TRUNCATE); buf[cbBuf - 1] = 0; mir_free(msg); diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 7b691a29be..0d6e1301c2 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -202,7 +202,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) if (Config.MarkAsRead) db_event_markRead(hContact, hDbEvent); - AnswerToContact(hContact, ptrW(DbEvent_GetTextW(&dbei))); + AnswerToContact(hContact, ptrW(dbei.getText())); return 0; } diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index e41ec820a4..4259f9226b 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1223,7 +1223,7 @@ void AddHistoryEvent(DBEVENTINFO *dbEvent, wchar_t *contact, PReply reply) TimeZone_ToString(dbEvent->timestamp, "D, s", timestamp, _countof(timestamp)); wchar_t *sender = (dbEvent->flags & DBEF_SENT) ? TranslateT("[me]") : contact; - wchar_t *message = DbEvent_GetTextW(dbEvent); + wchar_t *message = DbEvent_GetText(dbEvent); static wchar_t buffer[8192]; mir_snwprintf(buffer, L"[%S] %15s: %s", timestamp, sender, message); diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index 7d3b6d6f7f..e413ea1fe3 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -57,7 +57,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) date[0] = 0; time[0] = 0; - msg = DbEvent_GetTextW(dbei); + msg = DbEvent_GetText(dbei); if (msg == nullptr) return 0; @@ -382,7 +382,7 @@ void WriteLinkList(HWND hDlg, uint8_t params, LISTELEMENT *listStart, LPCTSTR se { DB::EventInfo dbe(actualElement->hEvent); - ptrW msg(DbEvent_GetTextW(&dbe)); + ptrW msg(dbe.getText()); if (wcsstr(msg, searchString)) filter3 = 1; } @@ -611,7 +611,7 @@ void WriteMessage(HWND hDlg, LISTELEMENT *listStart, int actLinePos) SetDlgItemTextW(hDlg, IDC_MESSAGE, L""); DB::EventInfo dbe(hEvent); - SendDlgItemMessage(hDlg, IDC_MESSAGE, EM_REPLACESEL, FALSE, ptrW(DbEvent_GetTextW(&dbe))); + SendDlgItemMessage(hDlg, IDC_MESSAGE, EM_REPLACESEL, FALSE, ptrW(dbe.getText())); } break; } diff --git a/plugins/HistoryPlusPlus/hpp_events.pas b/plugins/HistoryPlusPlus/hpp_events.pas index 35991b82fc..f1ca2ddf0b 100644 --- a/plugins/HistoryPlusPlus/hpp_events.pas +++ b/plugins/HistoryPlusPlus/hpp_events.pas @@ -525,7 +525,7 @@ begin Result := False; msg := nil; try - msg := DbEvent_GetTextW(@EventInfo); + msg := DbEvent_GetText(@EventInfo); Result := Assigned(msg); except if Assigned(msg) then mir_free(msg); @@ -608,7 +608,7 @@ begin cp := CP_UTF8 else cp := Hi.CodePage; - PText := DbEvent_GetTextW(@EventInfo); + PText := DbEvent_GetText(@EventInfo); if not Assigned(PText) then PText := mir_wstrdup(''); Hi.Text := Format(TranslateUnicodeString(Hi.Text), [PText]); diff --git a/plugins/IEHistory/src/utils.cpp b/plugins/IEHistory/src/utils.cpp index a16465d843..8508918230 100644 --- a/plugins/IEHistory/src/utils.cpp +++ b/plugins/IEHistory/src/utils.cpp @@ -141,7 +141,7 @@ SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchDat switch (type) { case SEARCH_TEXT: { - ptrW data(DbEvent_GetTextW(&dbEvent)); + ptrW data(DbEvent_GetText(&dbEvent)); wchar_t *tmp = wcsstr(data, (wchar_t *)searchData); if (tmp) found = true; diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 6ea13100b7..802998a5cb 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -230,11 +230,11 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) } if (dbei.eventType == EVENTTYPE_FILE) { - eventData->szText.w = DbEvent_GetTextW(&dbei); + eventData->szText.w = dbei.getText(); eventData->iType = IEED_EVENT_FILE; } else if (dbei.isSrmm()) { - eventData->szText.w = DbEvent_GetTextW(&dbei); + eventData->szText.w = dbei.getText(); if (dbei.eventType == EVENTTYPE_MESSAGE) eventData->iType = IEED_EVENT_MESSAGE; else @@ -253,7 +253,7 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) eventData->iType = IEED_EVENT_SYSTEM; } else { // custom event - eventData->szText.w = DbEvent_GetTextW(&dbei); + eventData->szText.w = dbei.getText(); eventData->iType = IEED_EVENT_MESSAGE; } diff --git a/plugins/Import/src/textjson.cpp b/plugins/Import/src/textjson.cpp index f660e8f173..19e2d3aee7 100644 --- a/plugins/Import/src/textjson.cpp +++ b/plugins/Import/src/textjson.cpp @@ -356,7 +356,7 @@ public: flags += "r"; pRoot.push_back(JSONNode("flags", flags)); - ptrW msg(DbEvent_GetTextW(&dbei)); + ptrW msg(dbei.getText()); if (msg) pRoot.push_back(JSONNode("body", T2Utf(msg).get())); diff --git a/plugins/Msg_Export/src/export.cpp b/plugins/Msg_Export/src/export.cpp index 95675786df..1d53c39269 100644 --- a/plugins/Msg_Export/src/export.cpp +++ b/plugins/Msg_Export/src/export.cpp @@ -318,7 +318,7 @@ static bool ExportDBEventInfo(MCONTACT hContact, HANDLE hFile, const wstring &sF switch (dbei.eventType) { case EVENTTYPE_MESSAGE: - output += ptrW(DbEvent_GetTextW(&dbei)); + output += ptrW(dbei.getText()); break; case EVENTTYPE_FILE: diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 4fb80b8342..a33b7f5f4c 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -157,7 +157,7 @@ static wchar_t* ShortenPreview(DB::EventInfo &dbei) if (iPreviewLimit > 500 || iPreviewLimit == 0) iPreviewLimit = 500; - wchar_t *buf = DbEvent_GetTextW(&dbei); + wchar_t *buf = dbei.getText(); if (mir_wstrlen(buf) > iPreviewLimit) { fAddEllipsis = true; size_t iIndex = iPreviewLimit; @@ -294,7 +294,7 @@ static wchar_t* GetEventPreview(DB::EventInfo &dbei) // support for custom database event types DBEVENTTYPEDESCR *pei = DbEvent_GetType(dbei.szModule, dbei.eventType); if (pei && pBlob) { - comment1 = DbEvent_GetTextW(&dbei); + comment1 = dbei.getText(); commentFix = pei->descr; } else commentFix = POPUP_COMMENT_OTHER; @@ -363,12 +363,7 @@ int PopupShow(MCONTACT hContact, MEVENT hEvent, UINT eventType) } // get DBEVENTINFO with pBlob if preview is needed (when is test then is off) - DB::EventInfo dbe; - if (hEvent) { - if ((g_plugin.bPreview || eventType == EVENTTYPE_ADDED || eventType == EVENTTYPE_AUTHREQUEST)) - dbe.cbBlob = -1; - db_event_get(hEvent, &dbe); - } + DB::EventInfo dbe(hEvent, g_plugin.bPreview || eventType == EVENTTYPE_ADDED || eventType == EVENTTYPE_AUTHREQUEST); // retrieve correct hContact for AUTH events if (dbe.pBlob && (eventType == EVENTTYPE_ADDED || eventType == EVENTTYPE_AUTHREQUEST)) diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 580234ca0d..d73e137b64 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -59,7 +59,7 @@ bool Filter::check(ItemData *item) const if (!item->fetch()) return false; - return CheckFilter(ptrW(DbEvent_GetTextW(&item->dbe)), text); + return CheckFilter(ptrW(item->dbe.getText()), text); } return true; @@ -370,7 +370,7 @@ void ItemData::load(bool bLoadAlways) switch (dbe.eventType) { case EVENTTYPE_MESSAGE: pOwner->MarkRead(this); - wtext = DbEvent_GetTextW(&dbe); + wtext = dbe.getText(); break; case EVENTTYPE_STATUSCHANGE: @@ -427,7 +427,7 @@ void ItemData::load(bool bLoadAlways) break; default: - wtext = DbEvent_GetTextW(&dbe); + wtext = dbe.getText(); break; } @@ -452,7 +452,7 @@ void ItemData::load(bool bLoadAlways) str.AppendFormat(L"%s %s %s:\n", wszTime, wszNick.c_str(), TranslateT("wrote")); - ptrW wszText(DbEvent_GetTextW(&dbei)); + ptrW wszText(dbei.getText()); if (mir_wstrlen(wszText) > 43) wcscpy(wszText.get() + 40, L"..."); str.Append(wszText); diff --git a/plugins/NewStory/src/history_dlg.cpp b/plugins/NewStory/src/history_dlg.cpp index e4a30e114a..b8553dc00d 100644 --- a/plugins/NewStory/src/history_dlg.cpp +++ b/plugins/NewStory/src/history_dlg.cpp @@ -159,7 +159,7 @@ class CHistoryDlg : public CDlgBase if (!dbei) continue; - ptrW pwszText(DbEvent_GetTextW(&dbei)); + ptrW pwszText(dbei.getText()); if (!mir_wstrlen(pwszText)) continue; diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 426ff11eab..778503d3ae 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -382,7 +382,7 @@ void CMsgDialog::onClick_Quote(CCtrlButton*) return; if (dbei.isSrmm()) { - ptrW wszText(DbEvent_GetTextW(&dbei)); + ptrW wszText(dbei.getText()); SetMessageText(Srmm_Quote(wszText)); } } diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index f5566ea31c..9cfc82d963 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -389,7 +389,7 @@ public: } bool bIsRtl = (dbei.flags & DBEF_RTL) != 0; - ptrW wszText(DbEvent_GetTextW(&dbei)), wszNick; + ptrW wszText(dbei.getText()), wszNick; // test contact if (streamData->dbei == 0) { diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 7870fced95..dca1013faa 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -934,7 +934,7 @@ void CMsgDialog::onClick_Quote(CCtrlButton*) if (szQuoted.IsEmpty()) { DB::EventInfo dbei(hDBEvent); if (dbei) - szQuoted = Srmm_Quote(ptrW(DbEvent_GetTextW(&dbei)), iOutputWidth); + szQuoted = Srmm_Quote(ptrW(dbei.getText()), iOutputWidth); } } diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 143c55b36f..d3ae86f9cf 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -573,7 +573,7 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe if (!isSent && bIsStatusChangeEvent) dbei.wipeNotify(); - CMStringW msg(ptrW(DbEvent_GetTextW(&dbei))); + CMStringW msg(ptrW(dbei.getText())); if (msg.IsEmpty()) return false; @@ -981,7 +981,7 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe if (blob.isOffline()) InsertFileLink(str, streamData->hDbEvent, blob); else - AppendUnicodeToBuffer(str, ptrW(DbEvent_GetTextW(&dbei)), 0); + AppendUnicodeToBuffer(str, ptrW(dbei.getText()), 0); } break; @@ -991,7 +991,7 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe str.AppendChar(' '); } - ptrW tszText(DbEvent_GetTextW(&dbei)); + ptrW tszText(dbei.getText()); AppendUnicodeToBuffer(str, tszText, 0); } break; diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 035e90cff6..54a6f9bd5e 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -173,7 +173,7 @@ wchar_t* GetLastMessageText(MCONTACT hContact, bool received) if (dbei.cbBlob == 0 || dbei.pBlob == nullptr) return nullptr; - wchar_t *buff = DbEvent_GetTextW(&dbei); + wchar_t *buff = DbEvent_GetText(&dbei); wchar_t *swzMsg = mir_wstrdup(buff); mir_free(buff); diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 7c15c9cc83..845dfc33ae 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -565,7 +565,7 @@ static wchar_t* parseDbEvent(ARGUMENTSINFO *ai) return nullptr; DB::EventInfo dbe(hDbEvent); - return (dbe) ? DbEvent_GetTextW(&dbe) : nullptr; + return (dbe) ? dbe.getText() : nullptr; } static wchar_t* parseTranslate(ARGUMENTSINFO *ai) diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index a408f69655..9083460d92 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -181,12 +181,12 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) if (i1 == 1) c1 = mir_wstrdup(Clist_GetContactDisplayName(wParam)); else if (i1 == 2) - c1 = DbEvent_GetTextW(&dbe); + c1 = dbe.getText(); if (i2 == 1) c2 = mir_wstrdup(Clist_GetContactDisplayName(wParam)); else if (i2 == 2) - c2 = DbEvent_GetTextW(&dbe); + c2 = dbe.getText(); wchar_t buffer[512]; mir_snwprintf(buffer, buf, c1, c2); -- cgit v1.2.3