OSDN Git Service

merge original branch.
[tortoisegit/TortoiseGitJp.git] / src / TortoiseGitBlame / TortoiseGitBlameView.cpp
index fccce3f..d686479 100644 (file)
@@ -1086,11 +1086,11 @@ void CTortoiseGitBlameView::DrawBlame(HDC hDC)
                                oldfont = (HFONT)::SelectObject(hDC, m_font);\r
                        ::SetBkColor(hDC, m_windowcolor);\r
                        ::SetTextColor(hDC, m_textcolor);\r
-                       if (m_CommitHash[i].GetLength()>0)\r
+                       if (!m_CommitHash[i].IsEmpty())\r
                        {\r
                                //if (m_CommitHash[i].Compare(m_MouseHash)==0)\r
                                //      ::SetBkColor(hDC, m_mouseauthorcolor);\r
-                               if (m_CommitHash[i].Compare(m_SelectedHash)==0)\r
+                               if (m_CommitHash[i] == m_SelectedHash )\r
                                {\r
                                        ::SetBkColor(hDC, m_selectedauthorcolor);\r
                                        ::SetTextColor(hDC, m_texthighlightcolor);\r
@@ -2438,6 +2438,10 @@ void CTortoiseGitBlameView::UpdateInfo()
        while( pos>=0 )\r
        {\r
                one=data.Tokenize(_T("\n"),pos);\r
+               \r
+               if(one.GetLength()>1 && one[0] == _T('^'))\r
+                       one=one.Mid(1);\r
+\r
                if(one.IsEmpty())\r
                        continue;\r
                m_CommitHash.push_back(one.Left(40));\r
@@ -2467,7 +2471,7 @@ void CTortoiseGitBlameView::UpdateInfo()
                if(id>=0 && id <(int)GetLogData()->size())\r
                {\r
                        m_ID.push_back(pRevs->size()-id);\r
-                       m_Authors.push_back(pRevs->at(id).m_AuthorName);\r
+                       m_Authors.push_back(pRevs->GetGitRevAt(id).m_AuthorName);\r
                }else\r
                {\r
                        m_ID.push_back(id);\r
@@ -2535,7 +2539,7 @@ void CTortoiseGitBlameView::OnLButtonDown(UINT nFlags,CPoint point)
                                                                                                                        LVIS_SELECTED);\r
 \r
                                GitRev *pRev;\r
-                               pRev=&this->GetLogData()->at(this->GetLogList()->GetItemCount()-m_ID[line]);\r
+                               pRev=&this->GetLogData()->GetGitRevAt(this->GetLogList()->GetItemCount()-m_ID[line]);\r
                                this->GetDocument()->GetMainFrame()->m_wndProperties.UpdateProperties(pRev);\r
                        }else\r
                        {\r
@@ -2614,13 +2618,13 @@ void CTortoiseGitBlameView::OnMouseHover(UINT nFlags, CPoint point)
 \r
                        }else\r
                        {\r
-                               pRev=&this->GetLogData()->at(this->GetLogList()->GetItemCount()-m_ID[line]);\r
+                               pRev=&this->GetLogData()->GetGitRevAt(this->GetLogList()->GetItemCount()-m_ID[line]);\r
                        }\r
 \r
                        this->ClientToScreen(&point);\r
 \r
                        CString str;\r
-                       str.Format(_T("%s\n<b>%s</b>\n%s %s\n%s"),pRev->m_CommitHash,\r
+                       str.Format(_T("%s\n<b>%s</b>\n%s %s\n%s"),pRev->m_CommitHash.ToString(),\r
                                                                                                           pRev->m_Subject,\r
                                                                                                           pRev->m_AuthorName,\r
                                                                                                           CAppUtils::FormatDateAndTime( pRev->m_AuthorDate, m_DateFormat ), \r
@@ -2717,7 +2721,7 @@ void CTortoiseGitBlameView::OnViewPrev()
        FindNextLine(this->m_SelectedHash,true);\r
 }\r
 \r
-int CTortoiseGitBlameView::FindNextLine(CString CommitHash,bool bUpOrDown)\r
+int CTortoiseGitBlameView::FindNextLine(CGitHash CommitHash,bool bUpOrDown)\r
 {\r
        LONG_PTR line = SendEditor(SCI_GETFIRSTVISIBLELINE);\r
        LONG_PTR startline =line;\r