Skip to content

Commit

Permalink
Correct character display when character set missing. Enhance Status …
Browse files Browse the repository at this point in the history
…Bar.Enhance inline image handling..
  • Loading branch information
zigm committed Jul 23, 2019
1 parent 587adc2 commit 84210a6
Show file tree
Hide file tree
Showing 13 changed files with 1,344 additions and 220 deletions.
7 changes: 5 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ Changes
v 1.0.3.2

- To improve mboxview, please post reviews on what works, what doesn't, create bug tickets and enhancment requests;
- Improved handling of missing character set in the raw email that could result in improper text display;
- Improved handling of Mail Retrieval Status Text in the Status Bar to reliably display Mail Retrival In Progress Status text;
- Enhanced handling of missing character set in the raw email that could result in improper text display;
- Added Mail Retrival In Progress Status text in the Status Bar;
- Added Mail Archive Open in Progress Status text in the Status Bar;
- Added Sort Column in Progress Status text in the Status Bar;
- Enhanced handling of inline images;
- Updated User Manual to describe new and updated features;

v 1.0.3.1
Expand Down
7 changes: 5 additions & 2 deletions ReadMe.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ Changes
v 1.0.3.2

- To improve mboxview, please post reviews on what works, what doesn't, create bug tickets and enhancment requests;
- Improved handling of missing character set in the raw email that could result in improper text display;
- Improved handling of Mail Retrieval Status Text in the Status Bar to reliably display Mail Retrival In Progress Status text;
- Enhanced handling of missing character set in the raw email that could result in improper text display;
- Added Mail Retrival In Progress Status text in the Status Bar;
- Added Mail Archive Open in Progress Status text in the Status Bar;
- Added Sort Column in Progress Status text in the Status Bar;
- Enhanced handling of inline images;
- Updated User Manual to describe new and updated features;

v 1.0.3.1
Expand Down
Binary file modified UserGuide.odt
Binary file not shown.
Binary file modified UserGuide.pdf
Binary file not shown.
10 changes: 10 additions & 0 deletions src/CPictureCtrlDemoDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,14 @@ BOOL CCPictureCtrlDemoDlg::isSupportedPictureFile(LPCSTR file)
return FALSE;
}

int __cdecl FooPred(void const * first, void const * second)
{
CString *f = *((CString**)first);
CString *s = *((CString**)second);
int ret = strcmp(f->operator LPCSTR(), s->operator LPCSTR());
return ret;
}

BOOL CCPictureCtrlDemoDlg::LoadImageFileNames(CString & dir)
{
WIN32_FIND_DATA FileData;
Expand Down Expand Up @@ -356,6 +364,8 @@ BOOL CCPictureCtrlDemoDlg::LoadImageFileNames(CString & dir)
bFinished = TRUE;
}
FindClose(hSearch);

qsort(m_ImageFileNameArray.GetData(), m_ImageFileNameArray.GetCount(), sizeof(void*), FooPred);
return TRUE;
}

Expand Down
3 changes: 0 additions & 3 deletions src/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2585,9 +2585,6 @@ BOOL MySelectFolder::OnFileNameOK()
return TRUE;
}




void CMainFrame::OnClose()
{
// TODO: Add your message handler code here and/or call default
Expand Down
9 changes: 7 additions & 2 deletions src/MboxMail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int MboxMail::nWhichMailList = -1;

BOOL PathFileExist(LPCSTR path);
BOOL RemoveDir(CString & dir, bool recursive = false);
int fixInlineSrcImgPath(char *inData, int indDataLen, SimpleString *outbuf, CListCtrl *attachments, int mailPosition, bool useMailPosition);
//int fixInlineSrcImgPath(char *inData, int indDataLen, SimpleString *outbuf, CListCtrl *attachments, int mailPosition, bool useMailPosition);
UINT getCodePageFromHtmlBody(SimpleString *buffer, std::string &charset);

///////
Expand Down Expand Up @@ -3711,7 +3711,8 @@ int MboxMail::printSingleMailToHtmlFile(/*out*/CFile &fp, int mailPosition, /*in
SimpleString *workbuf = MboxMail::m_workbuf;
workbuf->ClearAndResize(outbuflarge->Count() * 2);
bool useMailPosition = true;
fixInlineSrcImgPath(outbuflarge->Data(), outbuflarge->Count(), workbuf, 0, mailPosition, useMailPosition);
//fixInlineSrcImgPath(outbuflarge->Data(), outbuflarge->Count(), workbuf, 0, mailPosition, useMailPosition);
NListView::UpdateInlineSrcImgPath(outbuflarge->Data(), outbuflarge->Count(), workbuf, 0, mailPosition, useMailPosition);
outbuflarge->Copy(*workbuf);

bdy = "<div style=\'background-color:transparent;margin-left:5px;text-align:left\'>";
Expand Down Expand Up @@ -4693,6 +4694,8 @@ int MboxMail::DecodeBody(CFile &fpm, MailBodyContent *body, int mailPosition, Si
if ((body->m_contentOffset + body->m_contentLength) > m->m_length) {
// something is not consistent
bodyLength = m->m_length - body->m_contentOffset;
if (bodyLength < 0)
bodyLength = 0;
}

fileOffset = m->m_startOff + body->m_contentOffset;
Expand Down Expand Up @@ -4791,6 +4794,8 @@ int MboxMail::GetMailBody_mboxview(CFile &fpm, int mailPosition, SimpleString *o
if ((body->m_contentOffset + body->m_contentLength) > m->m_length) {
// something is not consistent
bodyLength = m->m_length - body->m_contentOffset;
if (bodyLength < 0)
bodyLength = 0;
}

fileOffset = m->m_startOff + body->m_contentOffset;
Expand Down
Loading

0 comments on commit 84210a6

Please sign in to comment.