OSDN Git Service

Merge remove x86 build
[tortoisegit/TortoiseGitJp.git] / src / Git / GitStatusListCtrl.cpp
index dc19db7..df54196 100644 (file)
@@ -1083,6 +1083,7 @@ void CGitStatusListCtrl::Show(DWORD dwShow, DWORD dwCheck /*=0*/, bool bShowFold
                        m_arStatusArray.push_back((CTGitPath*)&m_IgnoreFileList[i]);\r
                }\r
        }\r
+       int index =0;\r
        for(int i=0;i<this->m_arStatusArray.size();i++)\r
        {\r
                //set default checkbox status\r
@@ -1090,7 +1091,10 @@ void CGitStatusListCtrl::Show(DWORD dwShow, DWORD dwCheck /*=0*/, bool bShowFold
                        ((CTGitPath*)m_arStatusArray[i])->m_Checked=true;\r
 \r
                if(((CTGitPath*)m_arStatusArray[i])->m_Action & dwShow)\r
-                       AddEntry((CTGitPath*)m_arStatusArray[i],langID,i);\r
+               {\r
+                       AddEntry((CTGitPath*)m_arStatusArray[i],langID,index);\r
+                       index++;\r
+               }\r
        }\r
        \r
        int maxcol = ((CHeaderCtrl*)(GetDlgItem(0)))->GetItemCount()-1;\r
@@ -1449,7 +1453,7 @@ void CGitStatusListCtrl::AddEntry(CTGitPath * GitPath, WORD langID, int listInde
        // relative path\r
        CString rename;\r
        rename.Format(_T("(from %s)"),GitPath->GetGitOldPathString());\r
-       if(GitPath->m_Action & CTGitPath::LOGACTIONS_REPLACED)\r
+       if(GitPath->m_Action & (CTGitPath::LOGACTIONS_REPLACED|CTGitPath::LOGACTIONS_COPY))\r
                entryname+=rename;\r
        \r
        InsertItem(index, entryname, icon_idx);\r
@@ -2060,7 +2064,7 @@ bool CGitStatusListCtrl::BuildStatistics()
        {\r
                int status=((CTGitPath*)m_arStatusArray[i])->m_Action;\r
 \r
-               if(status&CTGitPath::LOGACTIONS_ADDED)\r
+               if(status&(CTGitPath::LOGACTIONS_ADDED|CTGitPath::LOGACTIONS_COPY))\r
                        m_nAdded++;\r
                \r
                if(status&CTGitPath::LOGACTIONS_DELETED)\r
@@ -2228,14 +2232,14 @@ void CGitStatusListCtrl::OnContextMenuGroup(CWnd * /*pWnd*/, CPoint point)
                                                lv.mask = LVIF_GROUPID;\r
                                                lv.iItem = i;\r
                                                GetItem(&lv);\r
-#if 0\r
+\r
                                                if (lv.iGroupId == group)\r
                                                {\r
-                                                       FileEntry * entry = GetListEntry(i);\r
+                                                       CTGitPath * entry = (CTGitPath*)GetItemData(i);\r
                                                        if (entry)\r
                                                        {\r
-                                                               bool bOldCheck = !!GetCheck(i);\r
-                                                               //SetEntryCheck(entry, i, bCheck);\r
+                                                               bool bOldCheck = entry->m_Checked;\r
+                                                               SetEntryCheck(entry, i, bCheck);\r
                                                                if (bCheck != bOldCheck)\r
                                                                {\r
                                                                        if (bCheck)\r
@@ -2245,7 +2249,7 @@ void CGitStatusListCtrl::OnContextMenuGroup(CWnd * /*pWnd*/, CPoint point)
                                                                }\r
                                                        }\r
                                                }\r
-#endif\r
+\r
                                        }\r
                                        GetStatisticsString();\r
                                        NotifyCheck();\r
@@ -4248,7 +4252,7 @@ void CGitStatusListCtrl::StartDiff(int fileindex)
 \r
        CTGitPath file1=*(CTGitPath*)GetItemData(fileindex);\r
        CTGitPath file2;\r
-       if(file1.m_Action & CTGitPath::LOGACTIONS_REPLACED)\r
+       if(file1.m_Action & (CTGitPath::LOGACTIONS_REPLACED|CTGitPath::LOGACTIONS_COPY))\r
        {\r
                file2.SetFromGit(file1.GetGitOldPathString());\r
        }else\r
@@ -4526,11 +4530,11 @@ void CGitStatusListCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)
                                {\r
                                        crText = m_Colors.GetColor(CColors::Conflict);\r
 \r
-                               }else if(entry->m_Action & CTGitPath::LOGACTIONS_MODIFIED)\r
+                               }else if(entry->m_Action & (CTGitPath::LOGACTIONS_MODIFIED))\r
                                {\r
                                        crText = m_Colors.GetColor(CColors::Modified);\r
 \r
-                               }else if(entry->m_Action & CTGitPath::LOGACTIONS_ADDED)\r
+                               }else if(entry->m_Action & (CTGitPath::LOGACTIONS_ADDED|CTGitPath::LOGACTIONS_COPY))\r
                                {\r
                                        crText = m_Colors.GetColor(CColors::Added);\r
                                }\r