summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-25 14:58:56 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-25 14:58:56 +0300
commit0f9e1002ec21154bc476fbfeab0d21f796515823 (patch)
tree678f870457343d977afe06b154cfa5323b75e8da /src/mir_app
parentee7a91629442ba40e876e19e4cdd7af173e8e840 (diff)
DbEvent_GetTextW: useless second parameter removed
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/chat_log.cpp2
-rw-r--r--src/mir_app/src/chat_tools.cpp2
-rw-r--r--src/mir_app/src/db_events.cpp12
-rw-r--r--src/mir_app/src/srmm_base.cpp4
4 files changed, 8 insertions, 12 deletions
diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp
index 830430b0d5..6ff849e8b0 100644
--- a/src/mir_app/src/chat_log.cpp
+++ b/src/mir_app/src/chat_log.cpp
@@ -330,7 +330,7 @@ void CRtfLogWindow::CreateChatRtfMessage(RtfChatLogStreamData *streamData, const
return;
}
}
- lin.write(streamData, false, buf, ptrW(DbEvent_GetTextW(&dbei, CP_UTF8)));
+ lin.write(streamData, false, buf, ptrW(DbEvent_GetTextW(&dbei)));
return;
}
}
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 2692678a69..ec5eefaa74 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -735,7 +735,7 @@ void Chat_EventToGC(SESSION_INFO *si, MEVENT hDbEvent)
return;
Utf2T wszUserId(dbei.szUserId);
- CMStringW wszText(ptrW(DbEvent_GetTextW(&dbei, CP_UTF8)));
+ CMStringW wszText(ptrW(DbEvent_GetTextW(&dbei)));
wszText.Replace(L"%", L"%%");
GCEVENT gce = { si, GC_EVENT_MESSAGE };
diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp
index 1fb1a25a12..de410800ee 100644
--- a/src/mir_app/src/db_events.cpp
+++ b/src/mir_app/src/db_events.cpp
@@ -185,12 +185,8 @@ static INT_PTR DbEventGetTextWorker(const DB::EventInfo *dbei, int codepage, int
memcpy(str, dbei->pBlob, dbei->cbBlob);
str[dbei->cbBlob] = 0;
- if (dbei->flags & DBEF_UTF) {
- wchar_t *msg = nullptr;
- mir_utf8decodecp(str, codepage, &msg);
- if (msg)
- return (INT_PTR)msg;
- }
+ if (dbei->flags & DBEF_UTF)
+ return (INT_PTR)mir_utf8decodeW(str);
return (INT_PTR)mir_a2u_cp(str, codepage);
}
@@ -210,9 +206,9 @@ MIR_APP_DLL(char*) DbEvent_GetTextA(const DBEVENTINFO *dbei, int codepage)
return (char*)DbEventGetTextWorker((DB::EventInfo *)dbei, codepage, DBVT_ASCIIZ);
}
-MIR_APP_DLL(wchar_t*) DbEvent_GetTextW(const DBEVENTINFO *dbei, int codepage)
+MIR_APP_DLL(wchar_t*) DbEvent_GetTextW(const DBEVENTINFO *dbei)
{
- return (wchar_t*)DbEventGetTextWorker((DB::EventInfo *)dbei, codepage, DBVT_WCHAR);
+ return (wchar_t*)DbEventGetTextWorker((DB::EventInfo *)dbei, CP_ACP, DBVT_WCHAR);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index a744a3e9e3..af0a3bcba8 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -731,7 +731,7 @@ void CSrmmBaseDialog::UpdateChatLog()
continue;
Utf2T wszUserId(dbei.szUserId);
- CMStringW wszText(ptrW(DbEvent_GetTextW(&dbei, CP_ACP)));
+ CMStringW wszText(ptrW(DbEvent_GetTextW(&dbei)));
wszText.Replace(L"%", L"%%");
GCEVENT gce = { m_si, GC_EVENT_MESSAGE };
@@ -1091,7 +1091,7 @@ void CSrmmBaseDialog::SetQuoteEvent(MEVENT hEvent)
if (dbei) {
CMStringW wszText(TranslateT("In reply to"));
wszText += L": ";
- wszText += ptrW(DbEvent_GetTextW(&dbei, CP_UTF8)).get();
+ wszText += ptrW(DbEvent_GetTextW(&dbei)).get();
m_Quote.SetText(wszText);
m_hQuoteEvent = hEvent;