Skip to content

Commit

Permalink
Enhanced handling of mails with multiple plain text blocks and differ…
Browse files Browse the repository at this point in the history
…nt character sets such as mails from Apple Mail.
  • Loading branch information
zigm committed Sep 15, 2022
1 parent be77928 commit d02a9cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/NListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4074,6 +4074,7 @@ void NListView::SelectItem(int iItem, BOOL ignoreViewMessageHeader)
// For now use instead as below
//SimpleStringWrapper str((char*)(LPCSTR)bdy, bdy.GetLength());
SimpleString &str = *MboxMail::m_largelocal3;
str.Clear();
str.Append((char*)(LPCSTR)bdy, bdy.GetLength());

SimpleString *wBuff = MboxMail::m_largelocal1;
Expand All @@ -4100,6 +4101,7 @@ void NListView::SelectItem(int iItem, BOOL ignoreViewMessageHeader)
// For now use instead as below
//SimpleStringWrapper str(contentData, contentDataLength);
SimpleString &str = *MboxMail::m_largelocal3;
str.Clear();
str.Append(contentData, contentDataLength);

SimpleString *wBuff = MboxMail::m_largelocal1;
Expand Down Expand Up @@ -6547,8 +6549,12 @@ BOOL NListView::AdvancedFindInMailContent(int mailPosition, BOOL bContent, BOOL
{
DWORD tc_start = GetTickCount();

//const SimpleStringWrapper inbuf(pData, datalen);
SimpleStringWrapper inbuf(pData, datalen);
// TODO: investigate memory leak reported by VS when using SimpleStringWrapper
// For now use instead as below
// SimpleStringWrapper inbuf(pData, datalen);
SimpleString &inbuf = *MboxMail::m_largelocal1;
inbuf.Clear();
inbuf.Append(pData, datalen);

UINT pageCode = CP_UTF8;
if (body->m_pageCode)
Expand Down

0 comments on commit d02a9cf

Please sign in to comment.