OSDN Git Service

Bold Subject at log dialog
authorFrank Li <lznuaa@gmail.com>
Sat, 22 Aug 2009 16:03:17 +0000 (00:03 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 22 Aug 2009 16:03:17 +0000 (00:03 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/LogDlg.cpp

index a6e662e..835d591 100644 (file)
@@ -466,7 +466,7 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
        // and also populate the changed files list control\r
        // according to the selected revision(s).\r
 \r
-       CWnd * pMsgView = GetDlgItem(IDC_MSGVIEW);\r
+       CRichEditCtrl * pMsgView = (CRichEditCtrl*)GetDlgItem(IDC_MSGVIEW);\r
        // empty the log message view\r
        pMsgView->SetWindowText(_T(" "));\r
        // empty the changed files list\r
@@ -519,9 +519,29 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
                }else\r
                {\r
                        // set the log message text\r
-                       pMsgView->SetWindowText(_T("Commit:")+pLogEntry->m_CommitHash+_T("\r\n\r\n* ")+pLogEntry->m_Subject+_T("\n\n")+pLogEntry->m_Body);\r
+                       pMsgView->SetWindowText(_T("Commit:")+pLogEntry->m_CommitHash+_T("\r\n\r\n"));\r
                        // turn bug ID's into links if the bugtraq: properties have been set\r
                        // and we can find a match of those in the log message\r
+                       \r
+                       pMsgView->SetSel(-1,-1);\r
+                       CHARFORMAT2 format;\r
+                       SecureZeroMemory(&format, sizeof(CHARFORMAT2));\r
+                       format.cbSize = sizeof(CHARFORMAT2);\r
+                       format.dwMask = CFM_BOLD;\r
+                       format.dwEffects = CFE_BOLD;\r
+                       pMsgView->SendMessage(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&format);\r
+                       \r
+                       CString msg=_T("* ");\r
+                       msg+=pLogEntry->m_Subject;\r
+                       pMsgView->ReplaceSel(msg);\r
+\r
+                       pMsgView->SetSel(-1,-1);\r
+                       format.dwEffects = 0;\r
+                       pMsgView->SendMessage(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&format);\r
+                       \r
+                       msg=_T("\n\n");\r
+                       msg+=pLogEntry->m_Body;\r
+                       pMsgView->ReplaceSel(msg);\r
 \r
                        CString text;\r
                        pMsgView->GetWindowText(text);\r